/* =====================================================================
   /start/ v2 — sign-in / sign-up
   ---------------------------------------------------------------------
   Mirrors /home/'s .home-v2 visual language (dark, neon-cyan, Russo One
   headlines, JetBrains Mono terminal strip) but scoped to .start-v2 so
   it can't bleed into the rest of the site's chrome.

   Inputs need to live happily on a near-black surface. The site's base
   .form-control / .input-group styles assume white forms, so this file
   doesn't lean on them — every input/button gets a fresh sv2- variant.

   Form ids/names are intentionally unchanged from the legacy markup;
   the OTP / SMS / register JS in /start/index.php still wires up by id.
   ===================================================================== */

/* JetBrains Mono is named first in every monospace stack below (terminal
   strip, OTP digits, captcha, alt-links) but was never actually loaded —
   the strip silently fell back to Consolas on Windows and to whatever
   generic monospace a phone happens to ship. Loaded here so the page gets
   the face its own CSS asks for. */
@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

.start-v2 {
    /* surface */
    --sv2-bg:        #0B1220;
    --sv2-surface:   #111A2E;
    --sv2-surface-2: #18243F;
    --sv2-line:      rgba(125, 211, 252, 0.18);

    /* accents */
    --sv2-cyan:      #7DD3FC;
    --sv2-green:     #86EFAC;
    --sv2-red:       #F87171;

    /* text */
    --sv2-fg:        #F1F5F9;
    --sv2-fg-muted:  #B8C2D9;
    /* Was #6E7A95, which measures 4.35:1 on the page and only 4.03:1 on
       the lighter card — both just under AA, and it carries the terminal
       strip and the "didn't get it? / resend" row. Nudged to the same
       value the sitewide footer landed on for this exact problem
       (includes/structure/footer.php): still clearly the muted step down
       from --sv2-fg-muted, but 5.41:1 / 5.01:1. The 600px block below
       lifts it further again for glare. */
    --sv2-fg-dim:    #7E8AA6;
}

.start-v2 {
    background: var(--sv2-bg);
    color: var(--sv2-fg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* /start/ skips structure/header.php (the sign-in page doesn't want
       the full site nav), so the island owns its top padding entirely.
       Smaller top inset than /home/ since there's no transparent chrome
       to clear — the logo lockup sits inside .sv2-inner. */
    padding: clamp(48px, 7vw, 80px) clamp(16px, 4vw, 48px) 96px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* The site theme paints .page-content with bg-white in some places, and
   .page-wraper is hard-coded #fff. Force both wrappers around our island
   to the island's own surface so the seam doesn't show as a white sliver
   (and neither does an overscroll bounce on iOS).

   The colour is a LITERAL, not var(--sv2-bg): the sv2-* tokens are
   declared on .start-v2, so a custom property referenced from an
   ANCESTOR resolves to nothing and the whole declaration is dropped.
   That is exactly what used to happen here — this rule was dead. */
.page-content:has(> .start-v2),
.page-wraper:has(.start-v2) { background: #0B1220; }

/* Subtle radial wash behind the headline — same recipe as /home/ */
.start-v2::before {
    content: '';
    position: absolute;
    top: -10vh;
    left: 50%;
    width: 90vw;
    height: 60vh;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(125,211,252,0.10) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.start-v2 ::selection {
    background: var(--sv2-cyan);
    color: var(--sv2-bg);
}

/* ========== base-stylesheet bleed guard ==========
   /css/style.css sets `b, strong, .strong { color: #000 }` at element
   specificity, which lands BLACK text on the near-black card. It bit the
   one place the page uses <strong>: the "We sent 6 digits to <email>"
   line, where the address — the single piece of text the user is there to
   verify — rendered at 1.21:1 and read as a censored bar.
   Anything bold inside the island inherits its surroundings instead. */
.start-v2 b,
.start-v2 strong {
    color: inherit;
    font-weight: 700;
}
/* ...and the address/number itself gets the accent, so it reads as the
   value being confirmed rather than just heavier body copy. */
.start-v2 #otp-code-email-label {
    color: var(--sv2-cyan);
    word-break: break-word;   /* long addresses must not widen the card */
}

.start-v2 .sv2-inner {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 0 auto;
}

/* ========== logo lockup ==========
   /start/ has no site-nav header; the logo IS the chrome. Generous size
   so it reads as the page brand, not a corner mark. Click target sends
   them to the public root (logged-out exit hatch). Subtle drop-glow on
   hover hooks into the cyan accent palette. */
.start-v2 .sv2-logo {
    display: block;
    margin: 0 auto 40px;
    width: clamp(160px, 22vw, 240px);
    line-height: 0;
    /* Keep the link inert-feeling (no underline, no border-bottom)
       since the logo is the affordance, not the text under it. */
    text-decoration: none;
    border: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}
.start-v2 .sv2-logo img {
    width: 100%;
    height: auto;
    display: block;
    /* Soft cyan halo so the logo feels lit-from-behind on the dark
       surface without recoloring the SVG itself. */
    filter: drop-shadow(0 0 18px rgba(125, 211, 252, 0.18));
}
.start-v2 .sv2-logo:hover {
    transform: translateY(-1px);
}
.start-v2 .sv2-logo:hover img {
    filter: drop-shadow(0 0 22px rgba(125, 211, 252, 0.35));
}
@media (max-width: 480px) {
    .start-v2 .sv2-logo { margin-bottom: 28px; }
}

/* ========== terminal strip ========== */
.start-v2 .sv2-term {
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, Monaco, monospace;
    font-size: 12px;
    color: var(--sv2-fg-dim);
    margin: 0 0 24px;
    letter-spacing: 0.02em;
}
.start-v2 .sv2-term-prompt { color: var(--sv2-cyan); }
.start-v2 .sv2-term-mood   { color: var(--sv2-green); }

/* ========== greeting + headline ========== */
.start-v2 .sv2-hi {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--sv2-fg-muted);
    margin: 0 0 6px;
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

.start-v2 .sv2-headline {
    font-family: 'Russo One', Impact, 'Arial Black', sans-serif;
    font-size: clamp(28px, 4.5vw, 46px);
    line-height: 1.05;
    margin: 0 0 32px;
    color: var(--sv2-fg);
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(8px);
    animation: sv2-fade-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
}
.start-v2 .sv2-headline::after {
    content: '_';
    margin-left: 0.05em;
    color: var(--sv2-cyan);
    animation: sv2-blink 1s ease-in-out infinite alternate 0.8s;
}
@keyframes sv2-fade-up {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes sv2-blink {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ========== card ========== */
.start-v2 .sv2-card {
    background: var(--sv2-surface);
    border: 1px solid var(--sv2-line);
    border-radius: 14px;
    padding: 32px 32px 28px;
    box-shadow: 0 16px 40px -12px rgba(0,0,0,0.5);
    /* Mild fade-in so the card lands a beat after the headline. */
    opacity: 0;
    transform: translateY(8px);
    animation: sv2-fade-up 0.5s cubic-bezier(0.2,0.8,0.2,1) 0.25s forwards;
}
@media (max-width: 480px) {
    .start-v2 .sv2-card { padding: 24px 20px 22px; }
}

.start-v2 .sv2-card-head { margin: 0 0 22px; }
.start-v2 .sv2-card-head h2 {
    font-family: 'Russo One', Impact, sans-serif;
    font-size: clamp(20px, 2.6vw, 26px);
    margin: 0 0 8px;
    color: var(--sv2-fg);
    letter-spacing: 0.5px;
    line-height: 1.15;
}
.start-v2 .sv2-card-sub {
    margin: 0;
    color: var(--sv2-fg-muted);
    font-size: 14px;
    line-height: 1.55;
}

/* ========== links ========== */
.start-v2 .sv2-link {
    color: var(--sv2-cyan);
    text-decoration: none;
    border-bottom: 1px dashed rgba(125, 211, 252, 0.4);
    transition: border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
}
.start-v2 .sv2-link:hover {
    color: var(--sv2-fg);
    border-bottom-color: var(--sv2-fg);
    text-decoration: none;
}

/* ========== form ========== */
.start-v2 .sv2-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* The field's border is NOT the decorative --sv2-line hairline.
   A field's fill (--sv2-bg) sits only 1.08:1 away from the card it is on,
   in BOTH themes — so the border alone has to say "box you type in", and
   at --sv2-line's alpha it measured 1.5:1 and did not. --sv2-line-field is
   the same cyan pushed to ~3.1:1, which is what WCAG 1.4.11 asks of a
   control boundary; the light theme sets its own ink value. Card edges and
   dividers keep the soft hairline — they are separators, not controls. */
.start-v2 {
    --sv2-line-field: rgba(125, 211, 252, 0.45);
}

.start-v2 .sv2-field {
    display: flex;
    align-items: stretch;
    background: var(--sv2-bg);
    border: 1px solid var(--sv2-line-field);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin: 0;
}
.start-v2 .sv2-field:focus-within {
    border-color: var(--sv2-cyan);
    box-shadow: 0 0 0 3px rgba(125,211,252,0.15);
}
.start-v2 .sv2-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: var(--sv2-fg-dim);
    font-size: 18px;
    border-right: 1px solid var(--sv2-line-field);
    background: rgba(125,211,252,0.04);
    flex-shrink: 0;
}
.start-v2 .sv2-field input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--sv2-fg);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    padding: 14px 16px;
    width: 100%;
    /* kill the white shadow Bootstrap puts on .form-control */
    box-shadow: none;
}
.start-v2 .sv2-field input::placeholder { color: var(--sv2-fg-dim); }

/* Defeat browser-specific autofill yellow → keep the dark vibe. */
.start-v2 .sv2-field input:-webkit-autofill,
.start-v2 .sv2-field input:-webkit-autofill:hover,
.start-v2 .sv2-field input:-webkit-autofill:focus,
.start-v2 .sv2-field input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--sv2-fg);
    -webkit-box-shadow: 0 0 0 1000px var(--sv2-bg) inset;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--sv2-fg);
}

/* OTP input — fat spaced digits */
.start-v2 input.sv2-input--otp {
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 1.6rem;
    letter-spacing: 0.45em;
    text-align: center;
    padding: 16px 10px;
}

/* ========== trust-this-device row ========== */
.start-v2 .sv2-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sv2-fg-muted);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: 400;
}
.start-v2 .sv2-trust input {
    accent-color: var(--sv2-cyan);
    width: 16px;
    height: 16px;
    margin: 0;
}

/* ========== captcha (human check) ==========
   Deliberately loud: solid cyan border + halo + a badge so it reads as a
   required gate, not an optional extra. The "Text me my code" button is
   kept hidden by JS until this is answered correctly; send-sms-code.php
   still re-validates the answer against $_SESSION, so this is a UX gate
   (and a cheap bot speed-bump), not the real check. */
.start-v2 .sv2-captcha {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(125,211,252,0.06);
    border: 1.5px solid var(--sv2-cyan);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 0 0 3px rgba(125,211,252,0.10);
}
.start-v2 .sv2-captcha-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Russo One', Impact, sans-serif;
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--sv2-bg);
    background: var(--sv2-cyan);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}
/* Question on its own row, centered above the answer box. */
.start-v2 .sv2-captcha-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
/* The actual question — loudest thing in the box so nobody misses that
   they have to solve it. Cyan chip on the dark surface, bigger type. */
.start-v2 .sv2-captcha-q {
    margin: 0;
    color: var(--sv2-cyan);
    background: rgba(125,211,252,0.12);
    border: 1px solid rgba(125,211,252,0.45);
    border-radius: 8px;
    padding: 10px 16px;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.start-v2 .sv2-captcha-a {
    width: 92px;
    background: var(--sv2-bg);
    border: 1px solid var(--sv2-line-field);
    border-radius: 6px;
    color: var(--sv2-fg);
    padding: 10px 12px;
    text-align: center;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 18px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.start-v2 .sv2-captcha-a:focus {
    border-color: var(--sv2-cyan);
    box-shadow: 0 0 0 3px rgba(125,211,252,0.15);
}
/* Green confirm state once the answer matches (set by JS). */
.start-v2 .sv2-captcha-a.is-correct {
    border-color: var(--sv2-green);
    box-shadow: 0 0 0 3px rgba(134,239,172,0.18);
}
.start-v2 .sv2-captcha-hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--sv2-fg-muted);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

/* ========== buttons ========== */
.start-v2 .sv2-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.start-v2 .sv2-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    font-family: 'Russo One', Impact, sans-serif;
    font-size: 15px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border: 1px solid var(--sv2-cyan);
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}
.start-v2 .sv2-btn--primary {
    background: var(--sv2-cyan);
    color: var(--sv2-bg);
}
.start-v2 .sv2-btn--primary:hover {
    transform: translateY(-2px);
    background: #B6E7FE;
    color: var(--sv2-bg);
    box-shadow: 0 14px 30px -12px rgba(125,211,252,0.6);
    text-decoration: none;
}
.start-v2 .sv2-btn[disabled],
.start-v2 .sv2-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.start-v2 .sv2-btn-arrow { font-size: 14px; }

.start-v2 .sv2-spinner {
    height: 32px;
    width: auto;
    /* The default processing.gif is dark on transparent — invert so it
       reads on the dark surface without re-shipping the asset. */
    filter: invert(1) brightness(1.3);
}

/* ========== alt-link row + inline message ========== */
.start-v2 .sv2-alt {
    margin-top: 6px;
    font-size: 13px;
    color: var(--sv2-fg-dim);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

.start-v2 .sv2-msg {
    margin-top: 4px;
    font-size: 13px;
    min-height: 1.2em;
    line-height: 1.4;
}
.start-v2 .sv2-msg:empty { display: none; }

/* Status colours are CLASSES, not inline styles. index.php used to set
   `.css({color: '#F87171'})` directly on these divs; an inline style wins
   over every stylesheet rule, so those two hard-coded neons would have
   survived the day/night flip and sat unreadable on paper (#86EFAC on
   white is ~1.4:1). The JS now toggles these classes instead. */
.start-v2 .sv2-msg--error { color: var(--sv2-red); }
.start-v2 .sv2-msg--ok    { color: var(--sv2-green); }

/* ========== identity picker ========== */
/* JS injects raw <button class="btn btn-primary"> elements into
   #smsIdentityChoices when one phone matches multiple accounts. We
   restyle them under this scope so they match the rest of the page
   without touching the JS. */
.start-v2 .sv2-picker {
    margin-top: 22px;
    padding: 18px;
    border: 1px dashed var(--sv2-line);
    border-radius: 10px;
    background: rgba(125, 211, 252, 0.03);
}
.start-v2 .sv2-picker-q {
    margin: 0 0 12px;
    color: var(--sv2-fg);
    font-family: 'Russo One', Impact, sans-serif;
    font-size: 16px;
    letter-spacing: 0.4px;
}
.start-v2 .sv2-picker-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}
.start-v2 .sv2-picker-choices .btn,
.start-v2 .sv2-picker-choices button {
    background: var(--sv2-surface-2);
    color: var(--sv2-fg);
    border: 1px solid var(--sv2-line);
    border-radius: 999px;
    padding: 10px 18px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    margin: 0 !important;     /* JS sets inline margin: 0.25rem */
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.start-v2 .sv2-picker-choices .btn:hover,
.start-v2 .sv2-picker-choices button:hover {
    background: var(--sv2-bg);
    border-color: var(--sv2-cyan);
    transform: translateY(-1px);
}
.start-v2 .sv2-picker-choices .btn[disabled],
.start-v2 .sv2-picker-choices button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========== mobile legibility ==========
   In daylight on a phone the muted greys wash out and the 13-15px
   terminal/body text is a squint. Below 600px: brighten the muted/dim
   text ramp (higher contrast against the near-black surface) and bump
   every interactive/label font size. Inputs go to >=17px so iOS Safari
   stops auto-zooming the viewport when a field is focused. */
@media (max-width: 600px) {
    .start-v2 {
        --sv2-fg-muted: #D7E0F0;   /* was #B8C2D9 */
        --sv2-fg-dim:   #9AA7C2;   /* was #6E7A95 */
    }

    .start-v2 .sv2-hi          { font-size: 15px; }
    .start-v2 .sv2-term        { font-size: 13px; }
    .start-v2 .sv2-card-sub    { font-size: 16px; line-height: 1.6; }
    .start-v2 .sv2-field input { font-size: 17px; padding: 15px 16px; }
    .start-v2 .sv2-btn         { font-size: 16px; padding: 14px 24px; }
    .start-v2 .sv2-trust       { font-size: 15px; }
    .start-v2 .sv2-alt,
    .start-v2 .sv2-msg         { font-size: 15px; }
    .start-v2 .sv2-captcha-q   { font-size: 21px; }
    .start-v2 .sv2-captcha-a   { font-size: 19px; }
    .start-v2 .sv2-captcha-hint { font-size: 14px; }
}

/* =====================================================================
   DAY / NIGHT
   ---------------------------------------------------------------------
   /start/ is the one page on the site every visitor sees before they are
   anybody, and it is routinely opened one-handed outdoors — a phone in
   sunlight is exactly where an ink-dark page stops being a mood and
   starts being a locked door. So it ships both themes, same as every
   module (see the day/night rule in CLAUDE.md).

   The preference is SITEWIDE: one `dmTheme` key in localStorage and an
   explicit `dm-light` / `dm-dark` class stamped on <html> pre-paint by
   renderThemeBoot() in the head. Someone who flips to light here is still
   in light when they land in /vault/ thirty seconds later. Because /start/
   has no module nav to hang the control on, the button is its own fixed
   pill in the top-right rather than a bar item.
   ===================================================================== */

.sv2-theme {
    position: fixed;
    top: clamp(12px, 2.5vw, 22px);
    right: clamp(12px, 2.5vw, 22px);
    z-index: 20;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;      /* 44px, not 42 — the minimum comfortable tap target,
                         and this is a one-handed-outdoors control */
    height: 44px;
    padding: 0;

    background: rgba(17, 26, 46, 0.72);
    /* Same 3:1 control-boundary target as the form fields — this pill is
       the one control on the page a squinting user is hunting for. */
    border: 1px solid var(--sv2-theme-line, rgba(125, 211, 252, 0.45));
    border-radius: 999px;
    color: var(--sv2-theme-fg, #7DD3FC);
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, transform 0.15s ease;
}
.sv2-theme:hover,
.sv2-theme:focus-visible {
    transform: translateY(-1px);
    border-color: var(--sv2-theme-fg, #7DD3FC);
    outline: none;
}
.sv2-theme svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Icon shows the theme you would GET, not the one you are in: a sun while
   dark, a moon while light. A control picturing the CURRENT state reads
   as a status light and people stop pressing it.

   Both rules carry `.sv2-theme` so they score (0,2,0) and outrank the
   (0,1,1) `.sv2-theme svg { display: block }` above. Drop that class and
   the generic rule wins and BOTH icons render — the exact bug the module
   nav shipped with. */
.sv2-theme .sv2-theme-moon { display: none; }
.sv2-theme .sv2-theme-sun  { display: block; }
html.dm-light .sv2-theme .sv2-theme-moon { display: block; }
html.dm-light .sv2-theme .sv2-theme-sun  { display: none; }

/* =====================================================================
   LIGHT THEME
   ---------------------------------------------------------------------
   A light theme is a DESIGN, not an inversion. The cyan that glows on ink
   (#7DD3FC) measures ~1.35:1 on white — as a link colour it is not dim,
   it is invisible. So the accent gets a separate paper value (#0369A1,
   5.9:1 on the card, and still 5.5:1 as white-on-fill for the button),
   which re-themes every link, prompt, border and badge in one line
   because they all read --sv2-cyan.

   What could NOT be retokenised is listed after: a handful of literal
   rgba(125,211,252,.0x) washes that are near-invisible on white, plus the
   pale hover fill and the inverted spinner, which only make sense on ink.
   ===================================================================== */
html.dm-light .start-v2 {
    /* surface */
    --sv2-bg:        #F4F6FB;   /* paper */
    --sv2-surface:   #FFFFFF;   /* the card */
    --sv2-surface-2: #EDF1F9;
    --sv2-line:      rgba(23, 27, 51, 0.14);
    /* Paper edition of the field boundary — see --sv2-line-field above for
       why the controls do not share the decorative hairline. 3.3:1 on white. */
    --sv2-line-field: rgba(23, 27, 51, 0.50);

    /* accents — ink-on-paper values, not the neon ones */
    --sv2-cyan:      #0369A1;   /* 5.93:1 on #FFF, 5.49:1 on #F4F6FB */
    --sv2-green:     #15803D;   /* 5.02:1 on #FFF */
    --sv2-red:       #B91C1C;   /* 6.47:1 on #FFF */

    /* text */
    --sv2-fg:        #0F1729;   /* 17.9:1 */
    --sv2-fg-muted:  #4A5270;   /* 7.69:1 */
    --sv2-fg-dim:    #5A6280;   /* 6.01:1 */

    /* toggle chrome — .48 puts the pill's own outline at 3.1:1, so the
       control is findable in sun even before you read the icon inside it */
    --sv2-theme-fg:   #0369A1;
    --sv2-theme-line: rgba(23, 27, 51, 0.48);
}

html.dm-light .page-content:has(> .start-v2),
html.dm-light .page-wraper:has(.start-v2) { background: #F4F6FB; }

html.dm-light .sv2-theme { background: rgba(255, 255, 255, 0.82); }

/* The wash behind the headline: a cyan bloom on paper looks like a dirty
   screen. Same gesture, ink-tinted and fainter. */
html.dm-light .start-v2::before {
    background: radial-gradient(ellipse at center, rgba(3, 105, 161, 0.09) 0%, transparent 65%);
}

/* The card no longer floats in a void, so it stops casting a void's
   shadow — a hairline and a soft lift instead of a 50%-black drop. */
html.dm-light .start-v2 .sv2-card {
    box-shadow: 0 10px 28px -14px rgba(15, 23, 41, 0.25);
}

/* The logo is #FF586E in both files, so it needs no swap — only its
   backlight does, which on paper reads as a printing misregistration. */
html.dm-light .start-v2 .sv2-logo img { filter: none; }
html.dm-light .start-v2 .sv2-logo:hover img {
    filter: drop-shadow(0 4px 10px rgba(255, 88, 110, 0.32));
}

/* Field chrome. The .04 cyan tint on the icon gutter is invisible on
   white; the focus halo needs the paper accent to be seen at all. */
html.dm-light .start-v2 .sv2-field-icon { background: rgba(3, 105, 161, 0.05); }
html.dm-light .start-v2 .sv2-field:focus-within {
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.16);
}
html.dm-light .start-v2 .sv2-captcha-a:focus {
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.16);
}
html.dm-light .start-v2 .sv2-captcha-a.is-correct {
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.20);
}

/* Captcha box — still the loudest thing in the form, in ink terms. */
html.dm-light .start-v2 .sv2-captcha {
    background: rgba(3, 105, 161, 0.05);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.09);
}
html.dm-light .start-v2 .sv2-captcha-q {
    background: rgba(3, 105, 161, 0.08);
    border-color: rgba(3, 105, 161, 0.35);
}

/* Link underline picks up the paper accent (the literal cyan rgba would
   be a ghost) — and stays visible after the :hover colour change. */
html.dm-light .start-v2 .sv2-link { border-bottom-color: rgba(3, 105, 161, 0.45); }

/* The primary button's hover fill is a PALE cyan, which on paper would
   turn white-ish text on a white-ish pill. It has to go the other way in
   light: darker on hover, not lighter. */
html.dm-light .start-v2 .sv2-btn--primary:hover {
    background: #075985;                                   /* 7.56:1 vs white */
    box-shadow: 0 14px 30px -12px rgba(3, 105, 161, 0.45);
}

/* processing.gif is dark artwork on transparent — it was inverted to be
   seen on ink. On paper the original is correct. */
html.dm-light .start-v2 .sv2-spinner { filter: none; }

html.dm-light .start-v2 .sv2-picker { background: rgba(3, 105, 161, 0.035); }

/* Mobile legibility, paper edition. The dark theme's 600px block
   BRIGHTENS the muted ramp to fight glare; on paper the same problem
   needs the opposite move, so the light values go darker rather than
   inheriting a fix aimed at the other background. These carry
   html.dm-light and so score (0,2,0) — they beat that media block
   regardless of source order. */
@media (max-width: 600px) {
    html.dm-light .start-v2 {
        --sv2-fg-muted: #3E4664;
        --sv2-fg-dim:   #4A5270;
    }
}
