/* =============================================================================
   AUTH — split-screen sign-in / sign-up
   Mobile: stacked (brand strip → form)
   Desktop (≥1024px): fixed 42/58 split
   Loaded only by auth.php via $page_css.
============================================================================= */

/* auth.php renders without the global fixed site header.
   Cancel the 69px body padding-top that layout.css applies on every other page,
   and ensure the page fills the full viewport with no residual gaps. */
html, body { height: 100%; }
body        { padding-top: 0; padding-bottom: 0; }

/* ── Page shell ───────────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Brand panel ─────────────────────────────────────────────────────────── */
.auth-brand {
    position: relative;
    background: var(--navy);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    flex-shrink: 0;
}

/* CR: fysh-auth-bg-2026-07-16 — self-hosted field photo replaces blocked Unsplash URL;
   gradient overlay mirrors hero technique (no opacity hack — full image + navy tint) */
.auth-brand__bg {
    position: absolute;
    inset: 0;
    background-image: url('/assets/img/20260524_133047158_iOS.jpg');
    background-size: cover;
    background-position: center 25%;
    pointer-events: none;
}
.auth-brand__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15, 35, 64, 0.72) 0%,
        rgba(15, 35, 64, 0.52) 40%,
        rgba(15, 35, 64, 0.84) 100%
    );
}

/* ── Brand top strip: logo + back link ────────────────────────────────────── */
.auth-brand__top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* White-mode logo overrides for dark panel */
.auth-logo .logo__name       { color: var(--white); }
.auth-logo .logo__name span  { color: var(--gold);  }

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    transition: color var(--ease);
    white-space: nowrap;
}
.auth-back-link svg { flex-shrink: 0; }
.auth-back-link:hover { color: var(--gold); }

/* ── Brand body: headline, perks, quote — hidden on mobile ───────────────── */
.auth-brand__body {
    display: none;
}

/* ── Form panel ──────────────────────────────────────────────────────────── */
.auth-form-panel {
    flex: 1;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-form-wrap {
    width: 100%;
    max-width: 440px;
}

/* ── Desktop split ────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    .auth-page {
        flex-direction: row;
    }

    .auth-brand {
        width: 42%;
        padding: 3rem;
        min-height: 100vh;
        position: sticky;
        top: 0;
    }

    .auth-brand__body {
        display: flex;
        flex-direction: column;
        gap: 2.5rem;
        position: relative;
        z-index: 1;
        flex: 1;
        justify-content: center;
    }

    .auth-form-panel {
        width: 58%;
        padding: 4rem 3rem;
        align-items: flex-start;
        padding-top: max(4rem, 10vh);
    }
}

/* ── Brand body content ───────────────────────────────────────────────────── */
.auth-brand__heading {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3vw, 2.75rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}
.auth-brand__heading em {
    font-style: italic;
    color: var(--gold-lt);
}

.auth-brand__sub {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.7;
}

/* ── Perks list ───────────────────────────────────────────────────────────── */
.auth-brand__perks {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.auth-perk {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
}

.auth-perk__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: rgba(201,168,76,0.2);
    border: 1.5px solid rgba(201,168,76,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    color: var(--gold);
}
.auth-perk__icon svg { width: 11px; height: 11px; }

/* ── Brand quote ──────────────────────────────────────────────────────────── */
.auth-brand__quote {
    background: rgba(255,255,255,0.05);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1rem 1.25rem;
}
.auth-brand__quote p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}
.auth-brand__quote footer {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}

/* ── Form wrap heading ────────────────────────────────────────────────────── */
.auth-form-wrap__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.auth-form-wrap__heading {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.auth-form-wrap__sub {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1.75rem;
    line-height: 1.6;
}

/* ── Tab switcher ─────────────────────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    background: var(--cream);
    border-radius: var(--radius-md);
    padding: 0.3rem;
    gap: 0.25rem;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: calc(var(--radius-md) - 3px);
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color var(--ease), color var(--ease), box-shadow var(--ease);
    line-height: 1;
}
.auth-tab.is-active {
    background: var(--white);
    color: var(--navy);
    box-shadow: var(--shadow-sm);
}
.auth-tab:hover:not(.is-active) { color: var(--navy); }

/* ── Form groups ──────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.4rem;
}
.form-label__link {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--blue);
    transition: color var(--ease);
}
.form-label__link:hover { color: var(--navy); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

/* Stack name fields on very small screens */
@media (max-width: 380px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ── Input wrapper (allows icon inside) ───────────────────────────────────── */
.input-wrap {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.78rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--slate);
    background: var(--white);
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease);
    line-height: 1.4;
}
.form-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(30,91,168,0.1);
}
.form-input--peek {
    padding-right: 2.85rem; /* room for eye button */
}

/* Validation state — only show after interaction */
.form-input.is-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.1);
}

/* ── Password peek button ─────────────────────────────────────────────────── */
.input-peek {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--ease);
    border-radius: var(--radius-sm);
}
.input-peek:hover      { color: var(--navy); }
.input-peek .icon-eye-off { display: none; }
.input-peek.is-peeking .icon-eye     { display: none; }
.input-peek.is-peeking .icon-eye-off { display: block; }

/* ── Inline field error message ───────────────────────────────────────────── */
.field-error {
    display: none;
    font-size: 0.76rem;
    color: #dc3545;
    margin-top: 0.35rem;
    font-weight: 500;
}
.field-error.is-visible { display: block; }

/* ── Remember me row ──────────────────────────────────────────────────────── */
.auth-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--slate);
    cursor: pointer;
    user-select: none;
}
.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
    flex-shrink: 0;
    cursor: pointer;
}

/* ── Slide toggle (T&C) ───────────────────────────────────────────────────── */
.toggle-group {
    margin-bottom: 1.5rem;
}

.toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

/* Visually hidden but accessible — participates in form validation */
.toggle__input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
    margin: 0;
    padding: 0;
}

.toggle__track {
    flex-shrink: 0;
    position: relative;
    width: 46px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    margin-top: 1px;
    transition: background-color var(--ease), box-shadow var(--ease);
}
.toggle__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: transform var(--ease);
}

/* Checked state */
.toggle__input:checked + .toggle__track {
    background: var(--blue);
}
.toggle__input:checked + .toggle__track .toggle__thumb {
    transform: translateX(20px);
}

/* Focus ring on the track (since input is visually hidden) */
.toggle__input:focus-visible + .toggle__track {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Error state — toggle track turns amber border */
.toggle.is-error .toggle__track {
    box-shadow: 0 0 0 2px #dc3545;
}

.toggle__label {
    font-size: 0.84rem;
    color: var(--slate);
    line-height: 1.55;
    padding-top: 3px;
}
.toggle__label a {
    color: var(--blue);
    font-weight: 500;
    transition: color var(--ease);
}
.toggle__label a:hover { color: var(--navy); }

/* ── Submit button row ────────────────────────────────────────────────────── */
.auth-submit {
    margin-top: 0.5rem;
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}
.auth-divider span {
    position: relative;
    background: var(--white);
    padding: 0 0.85rem;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}

/* ── Switch prompt ────────────────────────────────────────────────────────── */
.auth-switch {
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}
.auth-switch a,
.auth-switch button {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--ease);
}
.auth-switch button:hover,
.auth-switch a:hover { color: var(--navy); }

/* ── Success state ────────────────────────────────────────────────────────── */
.auth-success {
    text-align: center;
    padding: 1.5rem 0.5rem 0;
}
.auth-success__icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(30,91,168,0.12), rgba(30,91,168,0.06));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--blue);
}
.auth-success__icon svg { width: 30px; height: 30px; }

.auth-success__heading {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.6rem;
}
.auth-success__text {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.7;
    max-width: 320px;
    margin: 0 auto 1.75rem;
}
.auth-success__email {
    font-weight: 600;
    color: var(--slate);
}

/* ── POC banner ───────────────────────────────────────────────────────────── */
.poc-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.78rem;
    color: var(--slate);
    line-height: 1.5;
}
.poc-banner svg {
    flex-shrink: 0;
    color: var(--gold);
    margin-top: 1px;
}

/* =============================================================================
   FYSH — Auth additions
   CR: fysh-phase1-2026-06-22
   Appended to auth.css: notice/error alert banner, role picker, MFA form.
   POC banner (.poc-banner) is intentionally superseded — leave styles in place,
   the HTML element has been removed.
============================================================================= */

/* ── Inline notice / error alert ─────────────────────────────────────────── */
.auth-alert {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.55;
}

.auth-alert p { margin: 0 0 4px; }
.auth-alert p:last-child { margin-bottom: 0; }

.auth-alert--notice {
    background: #E6F1FB;
    border: 1px solid #85B7EB;
    color: #0C447C;
}

.auth-alert--error {
    background: #FCEBEB;
    border: 1px solid #F09595;
    color: #A32D2D;
}

/* Suspension notice — warm amber, calm and informational */
.auth-alert--suspended {
    background: #FEF3E2;
    border: 1px solid #D4955A;
    color: #5C3A0D;
}
.auth-alert__title {
    font-weight: 600;
    margin: 0 0 6px;
    font-size: 14px;
}
.auth-alert__reason {
    font-size: 13px;
    opacity: 0.9;
}
.auth-alert__contact {
    margin-top: 10px;
    font-size: 13px;
    opacity: 0.85;
}
.auth-alert__link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Role picker ─────────────────────────────────────────────────────────── */
.auth-role-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}

.auth-role-option {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color var(--ease), background var(--ease);
}

.auth-role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-role-option__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--navy);
}

.auth-role-option__sub {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.3;
}

.auth-role-option.is-selected,
.auth-role-option:has(input:checked) {
    border-color: var(--blue);
    background: #F0F5FC;
}

.auth-role-option:hover:not(.is-selected) {
    border-color: var(--blue-lt);
}

/* ── MFA form ────────────────────────────────────────────────────────────── */
#mfa-code {
    font-size: 22px;
    letter-spacing: 0.18em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
