/* THE SIGN-IN DOOR IN THE WEBSITE'S LOOK (2026-11-17, "the login page is
   outdated"; bright since 2026-11-25, "we also want the per dsp page to be
   the lighter theme, same with the sign in page"). /login, /forgot-password,
   /reset-password, /login/pick and the first-sign-in password screen wear
   the bright website's look (marketing/_v2_bright_tokens.html, the front page
   and Features & pricing): the stone ground with a soft light from the top
   left, a white card with a graphite hairline, graphite type, Instrument Serif
   headings, Source Sans 3 body, IBM Plex Mono labels. Electric blue is the one
   filled button and the focus ring, as the website's "Start your free month";
   orange is only the brand accent (a short rule over the greeting).

   ONLY THE LOOK. Every form, field, name and message is the template's own;
   nothing here changes what the page posts or says.

   A FIXED PALETTE (scripts/boardui_audit.py OWN_PALETTE): the door looks the
   same whatever theme the browser last had, so its colours are named once as
   tokens on .sv2 (the same values as _v2_bright_tokens.html) and every rule
   reads them. A DSP's own sign-in page (/login?dsp=) keeps its own frame,
   logo and colour, and reads the same palette through .lg-branded below.
   Text pairs are held to 4.5:1 by tests/test_the_sign_in_door_is_bright.py. */

.sv2, .lg-wrap.lg-branded {
    --sv2-ground: #F1EFEA;
    --sv2-paper: #FFFFFF;
    --sv2-sunk: #E8E5DE;
    --sv2-field: #F1EFEA;
    --sv2-text: #1F2124;
    --sv2-muted: #5E5B55;
    --sv2-hair: rgba(31, 33, 36, 0.12);
    --sv2-hair-mid: rgba(31, 33, 36, 0.24);
    --sv2-edge: rgba(31, 33, 36, 0.5);
    --sv2-on-blue: #FFFFFF;
    --sv2-blue: #2E68FA;
    --sv2-blue-deep: #1E55E6;
    --sv2-link: #2459E0;
    --sv2-halo: rgba(36, 89, 224, 0.22);
    --sv2-orange: #E8901B;
    --sv2-red: #A3261B;
    --sv2-red-bg: #FBE9E7;
    --sv2-red-line: rgba(163, 38, 27, 0.28);
    --sv2-go: #1D6B43;
    --sv2-go-bg: #E2F0E7;
    --sv2-light: radial-gradient(120% 70% at 20% -10%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 60%);
    --sv2-lift: 0 24px 60px rgba(31, 33, 36, 0.12);
    --sv2-serif: "Instrument Serif", Georgia, serif;
    --sv2-sans: "Source Sans 3", system-ui, sans-serif;
    --sv2-mono: "IBM Plex Mono", ui-monospace, monospace;
    --sv2-ease: cubic-bezier(0.19, 1, 0.22, 1);
    --sv2-ring: 0 0 0 2px var(--sv2-paper), 0 0 0 4px var(--sv2-link);

    /* login.html's own names, read by its rules: pointed at this palette. */
    --lg-ink: var(--sv2-text);
    --lg-ink-2: var(--sv2-muted);
    --lg-ink-3: var(--sv2-muted);
    --lg-hint: var(--sv2-muted);
    --lg-line: var(--sv2-hair);
    --lg-field-edge: var(--sv2-edge);
    --lg-amber: var(--sv2-blue);
    --lg-amber-hover: var(--sv2-blue-deep);
    --lg-amber-ink: var(--sv2-text);
    --lg-amber-on: var(--sv2-on-blue);
    --lg-amber-deep: var(--sv2-blue-deep);
    --lg-red: var(--sv2-red);
    --lg-red-bg: var(--sv2-red-bg);
    --lg-paper: var(--sv2-sunk);
    --lg-paper-2: var(--sv2-paper);
    --lg-ground: transparent;
    --lg-fill: var(--sv2-field);
    --lg-ring: var(--sv2-ring);
    --lg-card-edge: var(--sv2-hair);
    --ring: var(--sv2-ring);

    color-scheme: light;
}
.sv2 {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
    background: var(--sv2-ground) var(--sv2-light) no-repeat;
    color: var(--sv2-text);
    font-family: var(--sv2-sans);
    -webkit-font-smoothing: antialiased;
}

/* A DSP'S OWN SIGN-IN PAGE (/login?dsp=): its logo, name and colour stay
   (login.html's .lg-branded rules); the ground, card, type and fields are the
   door's. Tint is the stone; Solid and Photo keep their own ground. */
.lg-wrap.lg-branded { --lg-ground: var(--sv2-ground); color: var(--sv2-text); font-family: var(--sv2-sans);
    --ring: 0 0 0 2px var(--sv2-paper), 0 0 0 4px var(--b); --lg-ring: var(--ring);
    -webkit-font-smoothing: antialiased; }
.lg-wrap.lg-branded .lg-card { box-shadow: var(--sv2-lift); }
.lg-wrap.lg-branded .lg-form h1 { font-family: var(--sv2-serif); font-weight: 400; font-size: 40px; line-height: 1.02; letter-spacing: -0.005em; }
.lg-wrap.lg-branded .lg-dsp strong { font-weight: 600; }

/* Full bleed, out of main's padded column; the page under it is the same graphite. */
body:has(.sv2), body:has(.lg-branded) { --sv2-page: #F1EFEA; background: var(--sv2-page); color-scheme: light; }
body:has(.sv2) main { max-width: none; padding: 0; margin: 0; }
body:has(.sv2) main > footer.signed-out-foot { display: none; }
/* The first-sign-in password screen (a gate screen) has the app shell around it:
   its bar would sit over the door, which carries its own lockup. */
html.gate-screen body:has(.sv2) .topbar { display: none; }

/* --- the frame: lockup row, then greeting | card, then the foot ---------- */
.sv2 .lg-form-side {
    flex: 1; width: 100%; max-width: 78rem; margin: 0 auto;
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "card" "foot";
    align-content: start; row-gap: 20px;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
             max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: transparent; color: var(--sv2-text); overflow: visible;
}
.sv2 .lg-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin: 0; min-height: 44px; }
.sv2 .lg-logo { display: block; width: 150px; height: auto; }
.sv2-brand { display: block; line-height: 0; border-radius: 6px; }
.sv2 .sv2-logo { display: block; }
.sv2-home { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px;
    color: var(--sv2-muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
    border-radius: 8px; transition: color 150ms ease-out; }
.sv2-home:hover { color: var(--sv2-text); }
.sv2-home:focus-visible { outline: none; box-shadow: var(--sv2-ring); }

.sv2 .sv2-hello { display: none; grid-area: hello; }
.sv2 .lg-card { grid-area: card; justify-self: center; margin: 0; }
.sv2 .lg-foot { grid-area: foot; justify-self: center; }

@media (min-width: 40rem) {
    .sv2 .lg-form-side { padding: 28px 40px 32px; row-gap: 28px; }
    .sv2 .lg-logo { width: 176px; }
}

/* A COMPUTER: the greeting on the left, the card on the right. */
@media (min-width: 60rem) {
    .sv2 .lg-form-side {
        grid-template-columns: minmax(0, 1fr) minmax(0, 27.5rem);
        grid-template-areas: "top top" "hello card" "foot foot";
        grid-template-rows: auto 1fr auto; align-content: stretch;
        column-gap: clamp(48px, 7vw, 112px); row-gap: 24px;
    }
    .sv2 .sv2-hello { display: flex; flex-direction: column; align-self: center; min-width: 0; position: relative; }
    .sv2 .lg-card { align-self: center; justify-self: stretch; }
    .sv2 .lg-foot { justify-self: stretch; max-width: none; }
}

/* --- the greeting --------------------------------------------------------- */
.sv2 .sv2-hello::before { content: ""; display: block; width: 36px; height: 2px; margin: 0 0 28px; background: var(--sv2-orange); }
.sv2-line { margin: 0; font-family: var(--sv2-serif); font-weight: 400; font-size: clamp(52px, 5.2vw, 80px);
    line-height: 0.98; letter-spacing: -0.01em; color: var(--sv2-text); text-wrap: balance; }
.sv2-line em { display: block; font-style: italic; color: var(--sv2-muted); }
.sv2-sub { margin: 22px 0 0; max-width: 34ch; font-size: 18px; line-height: 1.5; color: var(--sv2-muted); }
.sv2-still { position: relative; z-index: -1; display: block; width: 118%; max-width: none; height: auto;
    margin: -12% 0 -8% -20%; opacity: 0.5; pointer-events: none; user-select: none;
    -webkit-mask-image: radial-gradient(closest-side, black 55%, transparent); mask-image: radial-gradient(closest-side, black 55%, transparent); }
.sv2 .sv2-hello { isolation: isolate; }

/* --- the card ------------------------------------------------------------- */
.sv2 .lg-card { width: 100%; max-width: 27.5rem; padding: 28px 22px 22px;
    background: var(--sv2-paper); color: var(--sv2-text);
    border: 1px solid var(--sv2-hair); border-radius: 20px; box-shadow: var(--sv2-lift); }
@media (min-width: 40rem) { .sv2 .lg-card { padding: 36px 34px 28px; } }

.sv2 .lg-form h1, .sv2 .lg-card h1 { font-family: var(--sv2-serif); font-weight: 400; font-size: 40px; line-height: 1.02;
    letter-spacing: -0.005em; margin: 0 0 20px; color: var(--sv2-text); text-wrap: balance; }
.sv2 .lg-card h1:has(+ .lg-sub) { margin-bottom: 8px; }
.sv2 .lg-form .lg-sub, .sv2 .lg-sub { color: var(--sv2-muted); font-size: 15px; line-height: 1.5; margin: 0 0 24px; }
.sv2 .lg-form h1.lg-h-solo { margin-bottom: 24px; }
.sv2 .lg-form h1:only-child, .sv2 .lg-card > h1:first-child + form { margin-top: 0; }

/* Labels: the website's mono capitals. */
.sv2 .lg-card label:not(.lg-trust) {
    display: block; margin: 0 0 8px; font-family: var(--sv2-mono); font-weight: 500; font-size: 12px;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--sv2-muted); }
.sv2 .lg-field { margin-bottom: 18px; }

/* Fields: 16px always (no zoom on a phone), 48px tall, a blue ring on focus. */
.sv2 .lg-card input[type="email"], .sv2 .lg-card input[type="password"], .sv2 .lg-card input[type="text"] {
    width: 100%; min-height: 48px; margin: 0; padding: 12px 14px;
    font-family: var(--sv2-sans); font-size: 16px; line-height: 1.3;
    background: var(--sv2-field); color: var(--sv2-text);
    border: 1px solid var(--sv2-edge); border-radius: 12px; box-shadow: none;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out; }
.sv2 .lg-card .pw-field input { padding-right: 4rem; }
.sv2 .lg-card input::placeholder { color: var(--sv2-muted); }
.sv2 .lg-card input[type="email"]:focus, .sv2 .lg-card input[type="password"]:focus, .sv2 .lg-card input[type="text"]:focus {
    outline: none; border-color: var(--sv2-link); box-shadow: 0 0 0 3px var(--sv2-halo); }
.sv2 .lg-card input[readonly] { background: transparent; border-style: dashed; color: var(--sv2-muted); }
.sv2 .lg-card input[readonly]:focus { border-color: var(--sv2-edge); box-shadow: none; }
.sv2 .lg-card input:-webkit-autofill, .sv2 .lg-card input:-webkit-autofill:hover, .sv2 .lg-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--sv2-text); caret-color: var(--sv2-text);
    -webkit-box-shadow: 0 0 0 100px var(--sv2-field) inset; box-shadow: 0 0 0 100px var(--sv2-field) inset; }
.sv2 .lg-card input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px var(--sv2-field) inset, 0 0 0 3px var(--sv2-halo);
    box-shadow: 0 0 0 100px var(--sv2-field) inset, 0 0 0 3px var(--sv2-halo); border-color: var(--sv2-link); }
.sv2 .pw-field { position: relative; }
.sv2 .pw-field::after { display: none; }
.sv2 .lg-card .pw-toggle { min-height: 44px; min-width: 44px; color: var(--sv2-muted); font-size: 13px; font-weight: 600;
    background: none; border: 0; box-shadow: none; border-radius: 8px; }
.sv2 .lg-card .pw-toggle:hover { color: var(--sv2-text); background: none; }
.sv2 .lg-card .pw-toggle:focus-visible { outline: none; box-shadow: var(--sv2-ring); }
.sv2 .field-hint { margin: -6px 0 18px; font-size: 14px; line-height: 1.45; color: var(--sv2-muted); }

/* --- the one filled button: electric blue, as the website's "Start your
   free month". A pill with the white chip and its arrow; press darkens. --- */
.sv2 .lg-submit, .sv2 .lg-card .btn-primary {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; min-height: 52px; margin: 0; padding: 7px 56px 7px 22px;
    font-family: var(--sv2-sans); font-size: 14px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--sv2-on-blue); background: var(--sv2-blue); border: 1px solid var(--sv2-blue); border-radius: 999px;
    box-shadow: none; filter: none; transform: none; cursor: pointer;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    transition: background-color 200ms ease-out, border-color 200ms ease-out, filter 150ms ease-out; }
.sv2 .lg-submit::after, .sv2 .lg-card .btn-primary::after {
    content: "\2192"; position: absolute; right: 9px; top: 50%; width: 34px; height: 34px; margin-top: -17px;
    display: grid; place-items: center; border-radius: 9px; background: var(--sv2-on-blue); color: var(--sv2-blue);
    font-size: 16px; letter-spacing: 0; transition: transform 240ms var(--sv2-ease); }
.sv2 .lg-submit:hover, .sv2 .lg-card .btn-primary:hover { background: var(--sv2-blue-deep); border-color: var(--sv2-blue-deep);
    box-shadow: none; transform: none; color: var(--sv2-on-blue); }
.sv2 .lg-submit:hover::after, .sv2 .lg-card .btn-primary:hover::after { transform: translateX(2px); }
.sv2 .lg-submit:active, .sv2 .lg-card .btn-primary:active { background: var(--sv2-blue-deep); filter: brightness(0.9); transform: none; scale: none; }
.sv2 .lg-submit:focus-visible, .sv2 .lg-card .btn-primary:focus-visible { outline: none; box-shadow: var(--sv2-ring); border-radius: 999px; }
.sv2 .lg-submit[aria-busy="true"] { cursor: progress; opacity: 0.8; }
/* Face ID leads: the password's Sign in steps back to an outline, no chip. */
.sv2 .lg-submit.lg-quiet { background: transparent; color: var(--sv2-text); border-color: var(--sv2-edge); padding-right: 22px; }
.sv2 .lg-submit.lg-quiet::after, .sv2 .lg-faceid .lg-submit::after { content: none; }
.sv2 .lg-faceid .lg-submit { padding-right: 22px; }
.sv2 .lg-submit.lg-quiet:hover { background: var(--sv2-sunk); border-color: var(--sv2-text); }

/* --- quiet links ---------------------------------------------------------- */
.sv2 .lg-links { margin: -4px 0 14px; display: flex; justify-content: flex-end; }
.sv2 .lg-links a, .sv2 .lg-back, .sv2 .lg-linkbtn, .sv2 .sv2-link {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0;
    color: var(--sv2-muted); font-size: 14px; font-weight: 600; text-decoration: underline;
    text-decoration-color: var(--sv2-hair-mid); text-underline-offset: 4px; background: none; border: 0; box-shadow: none;
    cursor: pointer; transition: color 150ms ease-out, text-decoration-color 150ms ease-out; }
.sv2 .lg-links a:hover, .sv2 .lg-back:hover, .sv2 .lg-linkbtn:hover, .sv2 .sv2-link:hover {
    color: var(--sv2-text); text-decoration-color: var(--sv2-text); background: none; box-shadow: none; transform: none; }
.sv2 a:focus-visible, .sv2 .lg-linkbtn:focus-visible, .sv2 .sv2-link:focus-visible { outline: none; box-shadow: var(--sv2-ring); border-radius: 6px; }
.sv2 .sv2-after { margin: 14px 0 0; display: flex; justify-content: center; }
.sv2 .sv2-after form { margin: 0; }

/* --- notes, the failure, success ----------------------------------------- */
.sv2 .lg-note, .sv2 .sv2-note { margin: 0 0 20px; padding: 12px 14px; border-radius: 12px;
    background: var(--sv2-sunk); border: 1px solid var(--sv2-hair); color: var(--sv2-text); font-size: 15px; line-height: 1.5; }
.sv2 .lg-error, .sv2 .lg-card .error {
    display: flex; gap: 10px; align-items: flex-start; margin: 0 0 20px; padding: 12px 14px; border-radius: 12px;
    background: var(--sv2-red-bg); border: 1px solid var(--sv2-red-line); color: var(--sv2-red);
    font-size: 15px; font-weight: 600; line-height: 1.45; }
.sv2 .lg-error svg { flex: none; margin-top: 3px; }
.sv2 .sv2-note b, .sv2 .sv2-note strong { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-weight: 600; }
.sv2 .sv2-note p { margin: 0; color: var(--sv2-muted); }
.sv2 .sv2-note p + p { margin-top: 8px; }
.sv2 .sv2-note.is-good b { color: var(--sv2-go); }
.sv2 .sv2-note.is-bad b { color: var(--sv2-red); }

/* --- the accounts on this browser ---------------------------------------- */
.sv2 .lg-acct { background: var(--sv2-sunk); color: var(--sv2-text); border: 1px solid var(--sv2-hair); border-radius: 14px; }
.sv2 .lg-acct:hover, .sv2 .lg-acct:active { background: var(--sv2-sunk); color: var(--sv2-text); border-color: var(--sv2-link); }
.sv2 .lg-acct-av { background: var(--sv2-field); color: var(--sv2-text); border: 1px solid var(--sv2-hair-mid); }
.sv2 .lg-acct-sub, .sv2 .lg-acct-go, .sv2 .lg-who-sub { color: var(--sv2-muted); }
.sv2 .lg-form .lg-or { color: var(--sv2-muted); font-family: var(--sv2-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.16em; }
.sv2 .lg-trust { color: var(--sv2-text); }
.sv2 .lg-trust input { accent-color: var(--sv2-blue); }
.sv2 .lg-faceid-status { color: var(--sv2-red); }
/* A company to pick (/login/pick): a row each, the same as an account. */
.sv2 .sv2-pick { margin: 0 0 10px; }
.sv2 .sv2-pick button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px;
    padding: 12px 16px; border-radius: 14px; background: var(--sv2-sunk); color: var(--sv2-text);
    border: 1px solid var(--sv2-hair); box-shadow: none; font-family: var(--sv2-sans); font-size: 16px; font-weight: 600;
    text-align: left; cursor: pointer; transition: border-color 150ms ease-out; }
.sv2 .sv2-pick button::after { content: "\2192"; color: var(--sv2-muted); font-weight: 400; }
.sv2 .sv2-pick button:hover { border-color: var(--sv2-link); background: var(--sv2-sunk); transform: none; box-shadow: none; }
.sv2 .sv2-pick button:active { filter: brightness(0.92); transform: none; scale: none; }
.sv2 .sv2-pick button:focus-visible { outline: none; box-shadow: var(--sv2-ring); }

/* --- the foot ------------------------------------------------------------- */
.sv2 .lg-foot { width: 100%; max-width: 27.5rem; margin: 0; padding-top: 8px; border-top: 1px solid var(--sv2-hair);
    font-size: 13px; line-height: 1.7; color: var(--sv2-muted); text-align: center; }
.sv2 .lg-foot a { color: var(--sv2-muted); text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; }
.sv2 .lg-foot a:hover { color: var(--sv2-text); }
.sv2 .lg-foot-i { white-space: nowrap; }
.sv2 .lg-foot-i + .lg-foot-i::before { content: "\00B7\00A0"; }
@media (min-width: 60rem) { .sv2 .lg-foot { max-width: none; } }

/* --- motion: the card and the greeting settle in, a failure arrives.
   Opacity, a 6px rise and a 2px blur, 220 to 300 ms; none when reduced. --- */
@media (prefers-reduced-motion: no-preference) {
    .sv2 .lg-card { animation: sv2-in 280ms var(--sv2-ease) both; }
    .sv2 .sv2-hello { animation: sv2-in 300ms var(--sv2-ease) 60ms both; }
    .sv2 .lg-error, .sv2 .lg-card .error { animation: sv2-in 220ms var(--sv2-ease) both; }
}
@keyframes sv2-in {
    from { opacity: 0; transform: translateY(6px); filter: blur(2px); }
    to { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    .sv2 *, .sv2 *::before, .sv2 *::after { transition: none !important; animation: none !important; }
}
