/* VANTAGE auth screens — premium two-column command-platform shell
   (docs/06 §3.1). Reads tokens.css; loaded only on guest pages. The left brand
   panel is pure token-driven CSS + inline SVG (no external image): layered mesh
   gradients, a faint grid, and two soft glows over a deep campaign-green field.
   The right column is a focused, elevated sign-in card. Responsive: the split
   stacks to one column, then to a slim branded header, on narrow screens. */

.auth-body {
    margin: 0;
    background: var(--ink);
    font-feature-settings: "ss01", "cv05";
}

.auth-split {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    min-height: 100vh;
}

/* ============================================================ brand panel */
.auth-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--sp-6);
    padding: clamp(var(--sp-6), 4vw, var(--sp-8)) clamp(var(--sp-6), 4vw, 72px);
    color: #EAF3EE;
    background:
        radial-gradient(130% 100% at 10% 4%, rgba(31, 196, 118, .30), transparent 55%),
        radial-gradient(90% 80% at 96% 100%, rgba(200, 155, 60, .16), transparent 55%),
        linear-gradient(155deg, #0C3222 0%, #0B2318 46%, #071510 100%);
}

/* faint blueprint grid, masked to fade toward the edges */
.auth-brand-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(120% 120% at 50% 20%, #000 40%, transparent 78%);
    mask-image: radial-gradient(120% 120% at 50% 20%, #000 40%, transparent 78%);
}
.auth-brand-glow {
    position: absolute;
    z-index: -1;
    right: -140px; bottom: -160px;
    width: 480px; height: 480px; border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 155, 60, .20), transparent 62%);
    pointer-events: none;
    filter: blur(4px);
}
.auth-brand-glow--2 {
    right: auto; bottom: auto;
    left: -160px; top: -120px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(31, 196, 118, .22), transparent 60%);
}

/* ---- top: logo + live status */
.auth-brand-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.auth-logo { display: inline-flex; align-items: center; gap: var(--sp-3); }
.auth-logo .brand-mark {
    width: 44px; height: 44px; font-size: var(--fs-xl); border-radius: 12px;
    background: linear-gradient(135deg, var(--green-bright) 0%, var(--green-deep) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .18),
        0 8px 20px rgba(11, 91, 55, .5);
}
.auth-logo-text { font-weight: var(--fw-bold); letter-spacing: var(--tracking-wide); color: #fff; line-height: 1.1; font-size: var(--fs-lg); }
.auth-logo-text small { display: block; font-size: 10px; font-weight: var(--fw-medium); letter-spacing: .16em; text-transform: uppercase; color: var(--side-text-dim); margin-top: 2px; }

.auth-status {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    padding: 6px 12px; border-radius: var(--radius-pill);
    font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .02em;
    color: #BFEAD3;
    background: rgba(31, 196, 118, .10);
    border: 1px solid rgba(31, 196, 118, .28);
}
.auth-status-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #34D98A;
    box-shadow: 0 0 0 0 rgba(52, 217, 138, .55);
    animation: auth-pulse 2.4s var(--ease) infinite;
}
@keyframes auth-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(52, 217, 138, .55); }
    70%  { box-shadow: 0 0 0 7px rgba(52, 217, 138, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 217, 138, 0); }
}

/* ---- middle: pitch + features + stats */
.auth-brand-mid { max-width: 34rem; }
.auth-eyebrow {
    display: inline-block; margin-bottom: var(--sp-3);
    font-size: var(--fs-xs); font-weight: var(--fw-semibold);
    letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
}
.auth-brand-mid h2 {
    color: #fff; font-size: clamp(var(--fs-xl), 3vw, 40px); line-height: 1.12;
    letter-spacing: -.01em; margin: 0 0 var(--sp-3);
}
.auth-brand-mid > p { color: #B9D0C4; font-size: var(--fs-base); line-height: 1.55; margin: 0; }

.auth-features { list-style: none; padding: 0; margin: var(--sp-6) 0 0; display: grid; gap: var(--sp-4); }
.auth-features li { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-sm); color: #C7DBCF; line-height: 1.45; }
.auth-features strong { color: #EAF3EE; font-weight: var(--fw-semibold); }
.auth-feature-ico {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px; color: #7FE3AE;
    background: rgba(31, 196, 118, .12);
    border: 1px solid rgba(31, 196, 118, .22);
}

.auth-brand-stats {
    list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-6) var(--sp-7);
    padding: var(--sp-5) 0 0; margin: var(--sp-6) 0 0;
    border-top: 1px solid rgba(255, 255, 255, .09);
}
.auth-brand-stats li { display: flex; flex-direction: column; gap: 2px; }
.auth-brand-stats strong { font-family: var(--font-num); font-size: var(--fs-xl); color: var(--gold); font-weight: var(--fw-bold); letter-spacing: -.01em; }
.auth-brand-stats span { font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--side-text-dim); }

/* ---- foot: security signal */
.auth-brand-foot { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--side-text-dim); }

/* ============================================================ form panel */
.auth-form-col {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--sp-5);
    padding: var(--sp-7) clamp(var(--sp-4), 5vw, var(--sp-8));
    background:
        radial-gradient(100% 60% at 50% 0%, var(--surface-2), transparent 70%),
        var(--surface);
}
.auth-form-card {
    width: 100%; max-width: 400px;
    animation: auth-rise var(--dur) var(--ease) both;
}
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.auth-form-brand { display: none; margin-bottom: var(--sp-5); }
.auth-form-brand .brand-name { color: var(--ink); }

/* ---- heading */
.auth-head { margin-bottom: var(--sp-5); }
.auth-eyebrow--dark { color: var(--gold-deep); margin-bottom: var(--sp-2); }
.auth-head h1 { font-size: var(--fs-2xl); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 var(--sp-2); color: var(--ink); }
.auth-head .muted { margin: 0; font-size: var(--fs-sm); }

/* ---- form fields */
.auth-form .field { margin-bottom: var(--sp-4); }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }

/* premium inputs: taller, softer border, clear focus lift */
.auth-form .field input {
    min-height: 50px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.auth-form .field input::placeholder { color: var(--muted); opacity: .7; }
.auth-form .field input:hover { border-color: var(--green-mid); }
.auth-form .field input:focus {
    outline: none; background: var(--surface);
    border-color: var(--green-mid);
    box-shadow: var(--focus), var(--shadow-xs);
}
.auth-form .input-icon .input-icon-glyph { transition: color var(--dur-fast) var(--ease); }
.auth-form .field input:focus ~ .input-icon-glyph,
.auth-form .input-icon:focus-within .input-icon-glyph { color: var(--green); }

/* password reveal button lives inside the field on the right */
.input-icon--action input { padding-right: 46px; }
.input-action {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--muted); cursor: pointer;
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.input-action:hover { color: var(--text); background: var(--surface-3); }
.input-action:focus-visible { outline: none; box-shadow: var(--focus); }

/* inline field note (caps-lock warning) */
.field-note { display: flex; align-items: center; gap: 6px; margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--muted); }
.field-note--warn { color: var(--warn); }

/* ---- submit */
.auth-submit {
    margin-top: var(--sp-2);
    background: linear-gradient(135deg, var(--green-bright) 0%, var(--green-deep) 100%);
    box-shadow: 0 10px 24px rgba(11, 91, 55, .28);
}
.auth-submit:hover { box-shadow: 0 12px 28px rgba(11, 91, 55, .36); filter: brightness(1.04); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit svg { transition: transform var(--dur-fast) var(--ease); }
.auth-submit:hover svg { transform: translateX(3px); }

/* ---- alert with icon */
.auth-form-card .alert-error { align-items: center; }
.auth-form-card .alert-error svg { flex-shrink: 0; }

/* ---- security notice + help */
.auth-notice {
    display: flex; align-items: flex-start; gap: var(--sp-3);
    margin-top: var(--sp-5); padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius);
    background: var(--surface-2); border: 1px solid var(--line-2);
    font-size: var(--fs-xs); line-height: 1.5; color: var(--text-2);
}
.auth-notice svg { flex-shrink: 0; margin-top: 1px; color: var(--green); }
.auth-notice strong { color: var(--text); font-weight: var(--fw-semibold); }

.auth-help { margin-top: var(--sp-4); line-height: 1.55; }
.auth-legal { font-size: var(--fs-xs); color: var(--muted); margin: 0; text-align: center; }

/* 2FA / small forms rendered inside the form panel keep tidy spacing */
.auth-form-card .field + .btn, .auth-form-card form .btn { margin-top: var(--sp-2); }

/* ============================================================ responsive */
@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-brand {
        padding: var(--sp-6) var(--sp-5);
        gap: var(--sp-5);
        min-height: auto;
    }
    .auth-brand-mid h2 { font-size: var(--fs-xl); }
    .auth-brand-mid > p { font-size: var(--fs-sm); }
    .auth-features { margin-top: var(--sp-5); }
    .auth-brand-stats { gap: var(--sp-4) var(--sp-6); }
    .auth-form-col { padding: var(--sp-7) var(--sp-5); }
}
@media (max-width: 560px) {
    /* Slim branded header: keep logo + status + headline, drop the deep pitch. */
    .auth-features, .auth-brand-stats, .auth-brand-foot, .auth-brand-mid > p { display: none; }
    .auth-brand { padding: var(--sp-5) var(--sp-4); gap: var(--sp-4); }
    .auth-eyebrow { margin-bottom: var(--sp-1); }
    .auth-brand-mid h2 { font-size: var(--fs-lg); margin: 0; }
    .auth-status { display: none; }
    .auth-form-col { padding: var(--sp-6) var(--sp-4) var(--sp-7); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-status-dot, .auth-form-card { animation: none; }
    .auth-submit:hover svg { transform: none; }
}

/* ==================================================== overlay / 2FA modal
   A frosted-glass challenge modal floating over a DECORATIVE, blurred
   situation-room backdrop. The backdrop is a pure CSS/SVG motif — never real
   data — because at /2fa the user has not cleared the second factor and holds
   no access. It exists only to make the gate feel like a modal over the app. */
.overlay-body { margin: 0; min-height: 100vh; background: var(--ink); overflow: hidden; }

.overlay-backdrop {
    position: fixed; inset: 0; z-index: 0;
    padding: var(--sp-5);
    display: flex; flex-direction: column; gap: var(--sp-4);
    filter: blur(9px) saturate(1.05);
    transform: scale(1.06);           /* hide the blur's soft edges */
    transform-origin: center;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 10% 0%, rgba(31, 196, 118, .18), transparent 55%),
        linear-gradient(155deg, #0C3222 0%, #0B2318 55%, #071510 100%);
}
/* backdrop: topbar */
.obd-topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 var(--sp-4);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
}
.obd-brand { display: inline-flex; align-items: center; gap: var(--sp-2); color: #EAF3EE; font-weight: var(--fw-bold); letter-spacing: var(--tracking-wide); }
.obd-brand .brand-mark { width: 28px; height: 28px; font-size: var(--fs-sm); border-radius: 7px; }
.obd-pills { display: inline-flex; gap: var(--sp-2); }
.obd-pill { width: 44px; height: 12px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .10); }
.obd-pill--wide { width: 80px; background: rgba(200, 155, 60, .22); }
/* backdrop: body = sidebar + main */
.obd-body { flex: 1; display: flex; gap: var(--sp-4); min-height: 0; }
.obd-side {
    width: 190px; flex-shrink: 0; padding: var(--sp-4);
    display: flex; flex-direction: column; gap: var(--sp-3);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07);
}
.obd-navline { height: 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .09); }
.obd-navline.is-on { background: rgba(31, 196, 118, .34); }
.obd-main { flex: 1; display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.obd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.obd-kpi { height: 92px; border-radius: var(--radius); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); }
.obd-panels { flex: 1; display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--sp-4); min-height: 0; }
.obd-panel { border-radius: var(--radius); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); padding: var(--sp-4); }
.obd-panel--chart svg { width: 100%; height: 100%; }
.obd-panel--chart polyline { fill: none; stroke: rgba(52, 217, 138, .7); stroke-width: 2.4; }
.obd-panel--chart .obd-line-2 { stroke: rgba(200, 155, 60, .55); }
.obd-panel--map { display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 1fr; gap: 8px; }
.obd-cell { border-radius: var(--radius-sm); background: rgba(31, 196, 118, .16); }
.obd-cell:nth-child(3n) { background: rgba(200, 155, 60, .18); }
.obd-cell:nth-child(4n) { background: rgba(255, 255, 255, .06); }

/* dim + tint scrim between the backdrop and the modal */
.overlay-scrim {
    position: fixed; inset: 0; z-index: 1;
    background: radial-gradient(120% 100% at 50% 40%, rgba(6, 18, 13, .55), rgba(6, 18, 13, .78));
    pointer-events: none;
}

/* the challenge modal */
.overlay-main {
    position: relative; z-index: 2;
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: var(--sp-5);
}
.overlay-card {
    position: relative;
    width: 100%; max-width: 400px;
    padding: var(--sp-7) var(--sp-6) var(--sp-6);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .90);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
    box-shadow: 0 32px 80px rgba(3, 12, 8, .55), inset 0 1px 0 rgba(255, 255, 255, .5);
    text-align: center;
    animation: overlay-pop var(--dur) var(--ease) both;
}
:root[data-theme="dark"] .overlay-card { background: rgba(18, 33, 27, .80); border-color: rgba(255, 255, 255, .10); }
@keyframes overlay-pop {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
/* lock badge crowning the modal */
.overlay-lock {
    display: inline-flex; align-items: center; justify-content: center;
    width: 58px; height: 58px; margin: 0 auto var(--sp-4);
    border-radius: 16px; color: #fff;
    background: linear-gradient(135deg, var(--green-bright) 0%, var(--green-deep) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 12px 26px rgba(11, 91, 55, .4);
}
.overlay-card h1 { font-size: var(--fs-xl); letter-spacing: -.01em; margin: 0 0 var(--sp-2); }
.overlay-card > .muted { margin: 0 0 var(--sp-5); }
.overlay-card .alert { text-align: left; }
/* the 6-digit code input: large, centred, spaced like an OTP field */
.overlay-card .field { text-align: left; margin-bottom: var(--sp-4); }
.overlay-card #code {
    text-align: center;
    font-family: var(--font-num);
    font-size: var(--fs-2xl);
    letter-spacing: .5em;
    text-indent: .5em;                /* balance the trailing letter-spacing */
    min-height: 60px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
}
.overlay-card #code:focus { outline: none; background: var(--surface); border-color: var(--green-mid); box-shadow: var(--focus); }
.overlay-card .btn { width: 100%; margin-top: var(--sp-2); }

@media (max-width: 560px) {
    .obd-side { display: none; }
    .obd-kpis { grid-template-columns: repeat(2, 1fr); }
    .obd-panels { grid-template-columns: 1fr; }
    .overlay-card { padding: var(--sp-6) var(--sp-5); }
    .overlay-card #code { font-size: var(--fs-xl); letter-spacing: .35em; text-indent: .35em; }
}
@media (prefers-reduced-motion: reduce) {
    .overlay-card { animation: none; }
}
