/* Auth pages (login) — scoped styles. Class prefix: auth-
 * Ported from the fatureal sibling app and recolored to the xchange
 * deep-teal + gold brand. Self-contained: does not depend on custom.css.
 */

:root {
    --auth-bg: #F6F8F9;
    --auth-surface: #FFFFFF;
    --auth-line: #DFE3E8;
    --auth-text: #0B1220;
    --auth-muted: #475467;
    --auth-brand: #0E7C7B;
    --auth-brand-deep: #0A5F5E;
    --auth-brand-soft: #E0F2F1;
    --auth-accent: #CCC430;
    --auth-danger: #B91C1C;
    --auth-danger-bg: #FEF2F2;
    --auth-danger-line: #FECACA;
    --auth-ok-bg: #F0FDF4;
    --auth-ok-line: #BBF7D0;
    --auth-ok-text: #166534;

    --auth-fs-h1: 28px;
    --auth-lh-tight: 1.15;
    --auth-lh-body: 1.5;

    --auth-space-2: 8px;
    --auth-space-3: 12px;
    --auth-space-4: 16px;
    --auth-space-5: 24px;
    --auth-space-6: 32px;

    --auth-radius: 10px;
    --auth-radius-sm: 8px;
}

/* ─────────────────────────────────────────────
 * Shell: split-screen on ≥lg, stacked on mobile
 * ────────────────────────────────────────── */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--auth-bg);
    color: var(--auth-text);
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: minmax(360px, 5fr) minmax(0, 7fr);
    }
}

/* ─────────────────────────────────────────────
 * Brand pane (left on desktop)
 * ────────────────────────────────────────── */

.auth-pane {
    position: relative;
    background: linear-gradient(160deg, var(--auth-brand-deep) 0%, #073F3E 100%);
    color: #fff;
    padding: 28px 28px 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--auth-space-6);
}

.auth-pane::before {
    /* Soft teal glow, top-right */
    content: "";
    position: absolute;
    top: -180px;
    right: -120px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(20, 140, 138, 0.55), transparent 70%);
    pointer-events: none;
}

.auth-pane::after {
    /* Faint gold depth, bottom-left */
    content: "";
    position: absolute;
    bottom: -160px;
    left: -100px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(204, 196, 48, 0.10), transparent 70%);
    pointer-events: none;
}

.auth-pane > * {
    position: relative;
    z-index: 1;
}

.auth-pane__logo {
    display: inline-block;
    text-decoration: none;
}

.auth-pane__logo img {
    opacity: 0.98;
}

.auth-pane__body {
    margin: auto 0;
    max-width: 420px;
}

.auth-pane__statement {
    font-size: 34px;
    line-height: var(--auth-lh-tight);
    font-weight: 700;
    margin: 0 0 var(--auth-space-3);
    letter-spacing: -0.01em;
    color: #fff;
}

.auth-pane__sub {
    font-size: 15px;
    line-height: var(--auth-lh-body);
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 var(--auth-space-5);
    max-width: 40ch;
}

.auth-pane__bullets {
    list-style: none;
    padding: 0;
    margin: var(--auth-space-5) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--auth-space-3);
}

.auth-pane__bullets li {
    display: flex;
    align-items: center;
    gap: var(--auth-space-3);
    font-size: 14.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
}

.auth-pane__check {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
}

.auth-pane__cert {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
}

.auth-pane__cert-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
}

/* On mobile, the brand pane becomes a slim top strip; bullets hidden. */
@media (max-width: 991.98px) {
    .auth-pane {
        padding: 20px 20px 18px;
        gap: var(--auth-space-3);
    }
    .auth-pane__body { max-width: none; }
    .auth-pane__statement { font-size: 22px; }
    .auth-pane__sub,
    .auth-pane__bullets { display: none; }
    .auth-pane__cert { font-size: 11px; }
}

@media (min-width: 992px) {
    .auth-pane {
        padding: 40px 48px 32px;
    }
    .auth-pane__statement { font-size: 36px; }
}

/* ─────────────────────────────────────────────
 * Content pane (form side)
 * ────────────────────────────────────────── */

.auth-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 20px 56px;
}

@media (min-width: 992px) {
    .auth-content { padding: 56px 48px; }
}

.auth-content__inner {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-content__header {
    margin-bottom: var(--auth-space-5);
}

.auth-heading {
    font-size: var(--auth-fs-h1);
    font-weight: 700;
    line-height: var(--auth-lh-tight);
    color: var(--auth-text);
    margin: 0 0 var(--auth-space-2);
    letter-spacing: -0.01em;
}

.auth-subhead {
    color: var(--auth-muted);
    font-size: 14px;
    line-height: var(--auth-lh-body);
    margin: 0;
}

@media (min-width: 992px) {
    .auth-heading { font-size: 32px; }
}

.auth-demo-pill {
    display: inline-block;
    margin-top: var(--auth-space-3);
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--auth-brand-soft);
    color: var(--auth-brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* ─────────────────────────────────────────────
 * Field
 * ────────────────────────────────────────── */

.auth-field {
    display: block;
    margin-bottom: var(--auth-space-4);
}

.auth-field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
}

.auth-field .form-control {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
    height: 46px;
    background: var(--auth-surface);
    border-radius: var(--auth-radius-sm);
    border: 1px solid var(--auth-line);
    color: var(--auth-text);
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.auth-field .form-control::placeholder {
    color: #A0A6B5;
}

.auth-field .form-control:focus {
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.18);
}

.auth-field .form-control.is-invalid {
    border-color: var(--auth-danger);
    background-image: none;
    padding-right: 0.75rem;
}

/* Password input + visibility toggle */
.auth-pw {
    position: relative;
}

.auth-pw .form-control {
    padding-right: 44px;
}

.auth-pw__toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--auth-muted);
    cursor: pointer;
    padding: 0;
    transition: color 150ms ease-out, background 150ms ease-out;
}

.auth-pw__toggle:hover,
.auth-pw__toggle:focus {
    color: var(--auth-text);
    background: #F0F1F5;
    outline: none;
}

.auth-pw__toggle i {
    font-size: 16px;
    line-height: 1;
}

/* Remember me */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 var(--auth-space-4);
    font-size: 13.5px;
    color: var(--auth-text);
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--auth-brand);
    cursor: pointer;
}

.auth-remember label {
    margin: 0;
    cursor: pointer;
}

/* Primary CTA — !important beats the legacy black/gold .btn-primary
   override that front_layout.css injects on auth pages. */
.auth-primary {
    height: 48px;
    width: 100%;
    border-radius: var(--auth-radius-sm);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.1px;
    color: #fff !important;
    background: var(--auth-brand) !important;
    border: 1px solid var(--auth-brand) !important;
    box-shadow: 0 1px 3px rgba(14, 124, 123, 0.25);
    transition: background 150ms ease-out, transform 80ms ease-out, box-shadow 150ms ease-out;
}

.auth-primary:hover,
.auth-primary:focus {
    color: #fff !important;
    background: var(--auth-brand-deep) !important;
    border-color: var(--auth-brand-deep) !important;
    box-shadow: 0 6px 20px -8px rgba(10, 95, 94, 0.5);
}

.auth-primary:active {
    transform: translateY(1px);
}

/* Secondary links row */
.auth-secondary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--auth-space-3);
    margin-top: var(--auth-space-4);
    padding-top: var(--auth-space-4);
    border-top: 1px solid #EEF0F3;
    font-size: 13.5px;
}

.auth-secondary a {
    color: var(--auth-brand) !important;
    font-weight: 500;
    text-decoration: none;
}

.auth-secondary a:hover {
    color: var(--auth-brand-deep) !important;
    text-decoration: underline;
}

.auth-secondary__muted {
    color: var(--auth-muted);
    margin-right: 4px;
}

/* Top-of-page banners */
.auth-banner {
    border-radius: var(--auth-radius-sm);
    padding: 10px 14px;
    margin-bottom: var(--auth-space-4);
    font-size: 13.5px;
}

.auth-banner--error {
    background: var(--auth-danger-bg);
    border: 1px solid var(--auth-danger-line);
    color: #991B1B;
}

.auth-banner--success {
    background: var(--auth-ok-bg);
    border: 1px solid var(--auth-ok-line);
    color: var(--auth-ok-text);
}

.auth-banner p { margin: 0; }
.auth-banner p + p { margin-top: 4px; }

/* ─────────────────────────────────────────────
 * Loading state on primary CTA
 * ────────────────────────────────────────── */

.auth-primary[disabled],
.auth-primary.is-loading {
    cursor: not-allowed;
    opacity: 0.9;
}

.auth-primary.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.auth-primary.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    animation: auth-spin 600ms linear infinite;
}

.auth-primary__loading-label {
    display: none;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--auth-muted);
    text-align: center;
}

.auth-primary__loading-label.is-visible {
    display: block;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-primary.is-loading::after {
        animation: none;
    }
}
