﻿/* ---------- Thir.st brand tokens ---------- */
:root {
    --thst-orange: #F9612B; /* primary */
    --thst-orange-hover: #DB5525; /* hover */
    --thst-gold: #FFFFFF; /* banner shell */
    --thst-gold-hover: #DCA024;
    --thst-ink: #2F2F2E; /* near-black text */
    --thst-grey: #8D8C92; /* secondary text */
    --thst-ow: #F7EDE4; /* off-white panel (legacy) */
    --border: #E6E3DE; /* subtle border */
    --focus-ring: rgba(249,97,43,.22); /* orange focus */
}

/* ---------- Base ---------- */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    background: #fff;
    color: var(--thst-ink);
    max-width: 100%;
    overflow-x: hidden;
}

/* ---------- 2-pane layout (logo left, card right) ---------- */
.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 60px);
    column-gap: clamp(16px, 4vw, 48px);
}

    /* Single-column variant (Registration / Step screens) */
    .login-layout.single {
        grid-template-columns: 1fr;
        max-width: 980px;
    }

/* LEFT: brand/logo */
.brand-pane {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Default logo (single brand) */
.brand-logo {
    width: min(520px, 78%);
    height: auto;
}

/* NEW: logo lock-up banner support */
/* Wrapper should be block-level; center contents */
.brand-lockup {
    display: block;
    width: 100%;
    text-align: center;
}

/* The actual image */
.brand-lockup-img {
    display: inline-block;
    width: min(640px, 95%);
    height: auto;
}}

/* RIGHT: pane */
.login-pane {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Card shell + card ---------- */
.card-shell {
    background: transparent;
    padding: 0;
    display: inline-block;
    flex: 0 0 auto;
    align-self: center;
    box-shadow: none;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    width: 420px;
    max-width: 420px;
    text-align: left;
    border: 1px solid var(--border);
}

/* Wider card for registration */
.login-card-wide {
    width: 820px;
    max-width: 820px;
}

/* ---------- Typography ---------- */
.login-title {
    font-weight: 700;
    font-size: 18pt;
    color: var(--thst-ink);
    margin: 0 0 18px 0;
    text-align: center;
    letter-spacing: .2px;
}

.subtitle {
    font-size: 10pt;
    color: var(--thst-grey);
    margin: 6px 0 18px 0;
    text-align: center;
}

/* Step headings (generic) */
.form-step {
    font-weight: 700;
    font-size: 10pt;
    color: var(--thst-orange);
    margin: 0 0 12px;
    text-align: left;
}

/* Labels */
.login-card label {
    font-size: 10pt;
    font-weight: 400;
    color: var(--thst-ink);
    display: block;
    margin: 8px 0 4px;
    text-align: left;
}

/* ---------- Inputs (generic) ---------- */
.login-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 10pt;
    color: var(--thst-ink);
    background: #fff;
    margin: 0;
}

    .login-input::placeholder {
        color: var(--thst-grey);
    }

/* Required indicator */
.login-card input[required],
.login-card select[required],
.login-card textarea[required] {
    border-left: 3px solid var(--thst-orange);
    padding-left: 10px;
}

/* Focus */
.login-card input:focus,
.login-card select:focus,
.login-card textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Invalid (light) */
.login-card input:invalid:not(:placeholder-shown),
.login-card select:invalid,
.login-card textarea:invalid:not(:placeholder-shown) {
    border-color: var(--thst-orange);
    background: #FFF3EC;
}

/* ---------- Primary Button ---------- */
.login-button {
    background: var(--thst-orange);
    color: #fff;
    font-weight: 700;
    font-size: 10pt;
    border: none;
    border-radius: 6px;
    padding: 12px;
    width: 100%;
    cursor: pointer;
    transition: background-color .2s ease, transform .02s ease;
    margin-top: 10px;
}

    .login-button:hover {
        background: var(--thst-orange-hover);
    }

    .login-button:active {
        transform: translateY(1px);
    }

/* Registration page: black primary CTA */
.donor-reg .login-button {
    background: #000;
}

    .donor-reg .login-button:hover {
        background: #111;
    }

/* ---------- Alerts + validation ---------- */
.ywca-alert {
    margin: 0 0 16px 0;
    padding: 10px 12px;
    border: 1px solid var(--thst-orange);
    background: #FFF3EC;
    color: #7a2a15;
    font-size: 10pt;
    border-radius: 6px;
    text-align: left;
}

    .ywca-alert.success {
        border-color: #28a745;
        background: #e6f9ee;
        color: #155724;
    }

.field-error {
    display: block;
    margin-top: 6px;
    font-size: .95rem;
    color: #dc2626;
}

    .field-error:empty {
        display: none;
    }

input.input-validation-error,
.login-input.input-validation-error {
    border-color: var(--thst-orange) !important;
}

/* ---------- Links ---------- */
.login-links {
    margin-top: 16px;
    font-size: 10pt;
    color: var(--thst-ink);
    text-align: center;
}

    .login-links p {
        margin: 0;
        line-height: 1.5;
    }

.login-links-label {
    display: inline-block;
    margin-top: 4px;
}

.login-links .link-bold {
    font-weight: 700;
    color: var(--thst-orange);
    text-decoration: none;
}

    .login-links .link-bold:hover {
        text-decoration: underline;
    }

.login-links .link-muted {
    color: var(--thst-orange);
    text-decoration: none;
}

    .login-links .link-muted:hover {
        text-decoration: underline;
    }

/* ---------- Password eye toggle ---------- */
.login-card .password-field {
    position: relative;
    margin-top: 12px;
}

.login-card .login-input.has-toggle {
    display: block;
    width: 100%;
    padding-right: 46px !important;
}

.login-card .password-field .eye-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #6b7280;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
    line-height: 0;
}

    .login-card .password-field .eye-toggle:hover,
    .login-card .password-field .eye-toggle:focus {
        color: #374151;
    }

    .login-card .password-field .eye-toggle svg {
        width: 20px;
        height: 20px;
    }

.icon-eye-closed {
    display: none;
}

/* ---------- Donor Registration (scoped) ---------- */
.donor-reg .login-card-wide {
    width: 820px;
    max-width: 820px;
}

/* 2-col layout */
.donor-reg .form-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 12px;
}

.donor-reg .form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

/* Inputs inside donor-reg (override generic) */
.donor-reg .login-input {
    font-size: 10pt;
}

/* Two equal columns (password pair) */
.donor-reg .grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Inline label + input (DOB) */
.donor-reg .inline-field {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

    .donor-reg .inline-field > label {
        margin: 0;
        white-space: nowrap;
        font-size: 10pt;
        min-width: 120px;
        color: var(--thst-ink);
    }

    .donor-reg .inline-field > .login-input {
        flex: 1;
    }

/* Full width row */
.donor-reg .fullrow {
    width: 100%;
}

/* Donor registration: spacing under Category pills */
.donor-reg .seg-choices-3 {
    margin-bottom: 12px;
}

/* PDPA consent: align text to checkbox and keep spacing consistent */
.donor-reg #pw-helper {
    margin-top: 10px;
    margin-bottom: 8px;
}

.donor-reg .pdpa-consent {
    margin-top: 0;
    display: flex;
    justify-content: center;
}

.donor-reg .checkbox-line {
    margin: 0; /* override label margin */
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 10pt;
    line-height: 1.5;
    max-width: 720px;
}

    .donor-reg .checkbox-line input[type="checkbox"] {
        flex-shrink: 0;
        margin-top: 3px;
    }

/* ---------- Segmented buttons (Category) ---------- */
.donor-reg .seg-choices-3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

    .donor-reg .seg-choices-3 .radio-pill {
        position: relative;
        display: block;
        margin: 0;
        cursor: pointer;
        user-select: none;
    }

        .donor-reg .seg-choices-3 .radio-pill input[type="radio"] {
            position: absolute;
            inset: 0;
            opacity: 0;
            pointer-events: none;
        }

        .donor-reg .seg-choices-3 .radio-pill span {
            display: block;
            text-align: center;
            padding: 10px 14px;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: #fff;
            color: var(--thst-ink);
            font-weight: 600;
            line-height: 1.15;
            transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
        }

        .donor-reg .seg-choices-3 .radio-pill:hover span {
            border-color: #d9d6d1;
        }

        .donor-reg .seg-choices-3 .radio-pill input[type="radio"]:checked + span {
            background: var(--thst-orange);
            border-color: var(--thst-orange);
            color: #fff;
            box-shadow: 0 0 0 3px rgba(249,97,43,.18);
        }

        .donor-reg .seg-choices-3 .radio-pill input[type="radio"]:focus-visible + span {
            box-shadow: 0 0 0 3px var(--focus-ring);
        }

/* ---------- Responsive: main login layout ---------- */
@media (max-width: 980px) {
    .login-layout {
        grid-template-columns: 1fr;
        padding: 18px 14px;
        row-gap: 14px;
        justify-items: center;
        align-items: start;
        min-height: auto;
    }

    .brand-pane {
        justify-content: center;
        align-items: center;
        padding-top: 6px;
    }

    .brand-logo {
        width: min(420px, 92%);
    }

    .brand-lockup-img {
        width: min(520px, 96%);
    }

    .login-card {
        width: 100%;
        max-width: 460px;
        margin: 0 auto;
    }

    .login-card-wide {
        width: 100%;
        max-width: 560px;
    }
}

/* Mobile: remove "card frame", use full width, increase font size to stop iOS zoom */
@media (max-width: 600px) {
    .login-layout {
        padding: 12px;
        row-gap: 10px;
    }

    /* Remove framed look */
    .login-card {
        width: 100%;
        max-width: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 16px 12px;
    }

    .login-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .login-links, .subtitle {
        font-size: 14px;
    }

    /* iOS zoom fix: inputs >= 16px */
    .login-input {
        font-size: 16px;
    }

    .login-button {
        font-size: 16px;
        padding: 12px;
    }

    .login-card label {
        font-size: 14px;
    }

    .login-card .password-field .eye-toggle {
        width: 42px;
        height: 42px;
        right: 6px;
    }

    /* Registration single layout full width */
    .login-layout.single.donor-reg {
        display: block;
        width: 100%;
        max-width: 100%;
        padding: 10px;
        margin: 0;
    }

        .login-layout.single.donor-reg .login-card-wide {
            width: 100%;
            max-width: 100%;
            padding: 16px 12px;
            border: 0;
            border-radius: 0;
            box-shadow: none;
        }

    /* Donor-reg inputs also need 16px for iOS */
    .donor-reg .login-input {
        font-size: 16px;
    }

    /* Stack DOB label/input */
    .donor-reg .inline-field {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

        .donor-reg .inline-field > label {
            min-width: 0;
        }

    /* Two column grids collapse */
    .donor-reg .form-grid2 {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }

    .donor-reg .grid-two {
        grid-template-columns: 1fr;
    }
}

/* Extra small */
@media (max-width: 420px) {
    .brand-lockup-img {
        width: 96vw;
    }
}
/* Donor registration: prevent any horizontal scrolling on mobile */
.login-layout.single.donor-reg,
.login-layout.single.donor-reg * {
    max-width: 100%;
}

.login-layout.single.donor-reg {
    overflow-x: hidden;
}

/* Validation summary can cause overflow */
.donor-reg .form-summary-errors,
.donor-reg .form-summary-errors ul {
    padding-left: 18px; /* keep neat */
    margin: 8px 0 0;
    max-width: 100%;
    overflow-wrap: anywhere; /* breaks long strings */
    word-break: break-word;
}

/* Individual field errors: ensure long text wraps */
.donor-reg .field-error {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 600px) {
    .login-pane,
    .card-shell,
    .login-card,
    .login-card-wide {
        width: 100% !important;
        max-width: 100% !important;
    }
}
@media (max-width: 600px) {
    .donor-reg .login-input,
    .donor-reg select.login-input,
    .donor-reg input[type="date"] {
        width: 100%;
        min-width: 0;
    }
}
/* iOS Safari: make date input truly full-width + aligned */
.donor-reg .inline-field input[type="date"].login-input,
.donor-reg input[type="date"].login-input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block;
    box-sizing: border-box;
    -webkit-appearance: none; /* helps override iOS intrinsic sizing */
    appearance: none;
}

/* Ensure the inline-field container doesn't constrain the input */
@media (max-width: 600px) {
    .donor-reg .inline-field {
        width: 100%;
    }
}
/* Force single-page forms (Registration etc.) to be perfectly centered */
.login-layout.single {
    width: 100%;
    max-width: 980px; /* keep your desired cap */
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center; /* grid-level centering */
    justify-items: center; /* centers the grid children */
    padding-left: 16px; /* keep symmetric padding */
    padding-right: 16px;
}

    /* Make sure the main pane stretches full width so centering is reliable */
    .login-layout.single .login-pane {
        width: 100%;
    }

    /* Center the card shell inside the pane */
    .login-layout.single .card-shell {
        width: 100%;
        display: flex;
        justify-content: center;
    }