/* Auth pages (login, signup) — scoped styles. Class prefix: auth-
 * Neutrals derived from OKLCH targets, hue ~250 (toward brand blue):
 *   page  oklch(0.985 0.005 250) ≈ #F6F7FB
 *   form  oklch(0.995 0.003 250) ≈ #FCFCFE
 *   line  oklch(0.93  0.010 250) ≈ #E0E3EB
 *   text  oklch(0.28  0.020 250) ≈ #2A2E37
 *   muted oklch(0.55  0.020 250) ≈ #6E7384
 *   brand oklch(0.55  0.16  250) ≈ #1A73E8
 *   deep  oklch(0.32  0.12  250) ≈ #0D47A1
 */

:root {
    --auth-bg: #F6F7FB;
    --auth-surface: #FCFCFE;
    --auth-line: #E0E3EB;
    --auth-text: #2A2E37;
    --auth-muted: #6E7384;
    --auth-brand: #1A73E8;
    --auth-brand-deep: #0D47A1;
    --auth-danger: #B91C1C;
    --auth-danger-bg: #FEF2F2;
    --auth-danger-line: #FECACA;
    --auth-ok-bg: #F0FDF4;
    --auth-ok-line: #BBF7D0;
    --auth-ok-text: #166534;
    --auth-info-bg: #EFF6FF;
    --auth-info-line: #BFDBFE;
    --auth-info-text: #1E40AF;
    --auth-amber-bg: #FFF7ED;
    --auth-amber-text: #B45309;

    /* Type scale */
    --auth-fs-display: 34px;
    --auth-fs-h1: 28px;
    --auth-fs-body: 15px;
    --auth-fs-small: 13px;
    --auth-fs-caption: 12px;
    --auth-lh-tight: 1.15;
    --auth-lh-body: 1.5;

    /* Spacing rhythm */
    --auth-space-1: 4px;
    --auth-space-2: 8px;
    --auth-space-3: 12px;
    --auth-space-4: 16px;
    --auth-space-5: 24px;
    --auth-space-6: 32px;
    --auth-space-7: 48px;

    --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: var(--auth-brand-deep);
    color: #fff;
    padding: 28px 28px 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--auth-space-6);
}

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

.auth-pane::after {
    /* Subtle bottom-left depth */
    content: "";
    position: absolute;
    bottom: -160px;
    left: -100px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.05), 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 {
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

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

.auth-pane__statement {
    font-size: var(--auth-fs-display);
    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: 38ch;
}

.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: 420px;
    margin: 0 auto;
}

.auth-content__inner--wide {
    max-width: 480px;
}

.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-trial-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--auth-space-3);
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--auth-amber-bg);
    color: var(--auth-amber-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.auth-demo-pill {
    display: inline-block;
    margin-top: var(--auth-space-2);
    padding: 3px 10px;
    border-radius: 999px;
    background: #EEF2FF;
    color: #3730A3;
    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: var(--auth-fs-small);
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
}

.auth-field__label--sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-field__hint {
    display: block;
    font-size: var(--auth-fs-caption);
    color: var(--auth-muted);
    margin-top: 6px;
}

.auth-field__error {
    display: block;
    font-size: 12.5px;
    color: var(--auth-danger);
    margin-top: 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(26, 115, 232, 0.18);
}

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

.auth-field textarea.form-control {
    height: auto;
    min-height: 84px;
    padding-top: 10px;
}

/* 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 */
.auth-primary {
    height: 48px;
    border-radius: var(--auth-radius-sm);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.1px;
    background: var(--auth-brand);
    border-color: var(--auth-brand);
    transition: background 150ms ease-out, transform 80ms ease-out, box-shadow 150ms ease-out;
}

.auth-primary:hover,
.auth-primary:focus {
    background: var(--auth-brand-deep);
    border-color: var(--auth-brand-deep);
    box-shadow: 0 6px 20px -8px rgba(13, 71, 161, 0.45);
}

.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);
    font-weight: 500;
    text-decoration: none;
}

.auth-secondary a:hover {
    color: var(--auth-brand-deep);
    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--info {
    background: var(--auth-info-bg);
    border: 1px solid var(--auth-info-line);
    color: var(--auth-info-text);
}

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

/* Mobile-redirect banner override (slimmer, branded) */
.auth-content .mobile-login-banner {
    border-radius: var(--auth-radius-sm);
    background: var(--auth-info-bg);
    border: 1px solid var(--auth-info-line);
    color: var(--auth-info-text);
    padding: 8px 12px;
    margin: var(--auth-space-3) 0 0;
    font-size: 13px;
}

.auth-content .mobile-login-banner i {
    margin-right: 6px;
}

/* Inline help link */
.auth-help {
    margin-top: var(--auth-space-4);
    text-align: center;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-help a {
    color: var(--auth-text);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.auth-help a i { margin-right: 4px; }

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

/* ─────────────────────────────────────────────
 * Password strength meter
 * ────────────────────────────────────────── */

.auth-pw-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--auth-muted);
}

.auth-pw-strength__bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}

.auth-pw-strength__bar span {
    height: 4px;
    border-radius: 2px;
    background: #ECEEF3;
    transition: background 200ms ease-out;
}

.auth-pw-strength[data-strength="1"] .auth-pw-strength__bar span:nth-child(-n+1),
.auth-pw-strength[data-strength="2"] .auth-pw-strength__bar span:nth-child(-n+2),
.auth-pw-strength[data-strength="3"] .auth-pw-strength__bar span:nth-child(-n+3),
.auth-pw-strength[data-strength="4"] .auth-pw-strength__bar span:nth-child(-n+4) {
    background: var(--auth-strength, var(--auth-muted));
}

.auth-pw-strength[data-strength="1"] { --auth-strength: #DC2626; }
.auth-pw-strength[data-strength="2"] { --auth-strength: #D97706; }
.auth-pw-strength[data-strength="3"] { --auth-strength: #2563EB; }
.auth-pw-strength[data-strength="4"] { --auth-strength: #16A34A; }

.auth-pw-strength__label strong {
    font-weight: 600;
    color: var(--auth-text);
}

.auth-pw-strength[data-strength="1"] .auth-pw-strength__label strong { color: #DC2626; }
.auth-pw-strength[data-strength="2"] .auth-pw-strength__label strong { color: #D97706; }
.auth-pw-strength[data-strength="3"] .auth-pw-strength__label strong { color: #2563EB; }
.auth-pw-strength[data-strength="4"] .auth-pw-strength__label strong { color: #16A34A; }

/* ─────────────────────────────────────────────
 * 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;
    }
}

/* ─────────────────────────────────────────────
 * Lockout (rate-limit) banner + locked CTA
 * ────────────────────────────────────────── */

.auth-banner--warn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
    border-radius: var(--auth-radius-sm);
    padding: 10px 14px;
    margin-bottom: var(--auth-space-4);
    font-size: 13.5px;
    line-height: 1.45;
}

.auth-banner--warn i {
    margin-top: 2px;
    color: #B45309;
}

.auth-banner--warn strong {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.auth-primary--locked,
.auth-primary--locked:hover,
.auth-primary--locked:focus {
    background: #C7CBD3;
    border-color: #C7CBD3;
    box-shadow: none;
    cursor: not-allowed;
}
