/* =====================================================================
   /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.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Inter:wght@400;500;600;700;800&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;
    --sv2-fg-dim:    #6E7A95;
}

.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.
   Force the page-content wrapper around our island to be the same dark
   so the seam doesn't show as a 1px white sliver. */
.page-content:has(> .start-v2) { background: var(--sv2-bg); }

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

.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;
}

.start-v2 .sv2-field {
    display: flex;
    align-items: stretch;
    background: var(--sv2-bg);
    border: 1px solid var(--sv2-line);
    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);
    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 ========== */
.start-v2 .sv2-captcha {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--sv2-bg);
    border: 1px dashed var(--sv2-line);
    border-radius: 10px;
    padding: 14px 16px;
}
.start-v2 .sv2-captcha-q {
    margin: 0;
    color: var(--sv2-fg-muted);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
}
.start-v2 .sv2-captcha-a {
    width: 90px;
    background: transparent;
    border: 1px solid var(--sv2-line);
    border-radius: 6px;
    color: var(--sv2-fg);
    padding: 8px 10px;
    text-align: center;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 16px;
    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);
}

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

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