/* ═══════════════════════════════════════════════
   Stadium patch — Misc: forms, auth screens, onboarding
   (loaded after app.css)
   Ink-framed auth card on crème, mono labels, quiet focus
   ring, giant outline step numbers, progress dots.
   ═══════════════════════════════════════════════ */

/* ── Forms: mono uppercase 11px labels, radius 10 inputs ── */
.form-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text2);
}
.form-select {
    border-radius: var(--radius-input);
}

/* Quiet focus ring (replaces the loud lime outline on fields) */
.form-input:focus-visible,
.form-select:focus-visible {
    outline: none;
    border-color: rgba(var(--ink-rgb), 0.5);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.form-input:focus,
.form-select:focus {
    border-color: rgba(var(--ink-rgb), 0.5);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ═══════════════════════════════════════════════
   AUTH (login / register / verify / forgot / reset)
   ═══════════════════════════════════════════════ */

.auth-screen {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 220px);
    min-height: calc(100dvh - 220px);
    padding: 18px 16px 56px;
}

/* Ink-framed card on crème */
.auth-screen .auth-card {
    width: 100%;
    max-width: 432px;
    margin: 0 auto;
    padding: 32px 30px 28px;
    background: var(--input-bg);
    border: 2px solid var(--text);
    border-radius: 24px;
    box-shadow: 8px 8px 0 rgba(var(--shadow-rgb), 0.07);
}

/* Mono eyebrow with ball dot */
.auth-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text3);
}
.auth-eyebrow-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--ball);
    box-shadow: inset 0 0 0 1px var(--ball-border);
}

/* Two-tone left-aligned title */
.auth-screen .auth-title {
    text-align: left;
    margin: 0 0 6px;
    font-size: clamp(1.7rem, 5vw, 2.05rem);
    font-weight: 680;
    line-height: 1.04;
    letter-spacing: -0.01em;
}
.auth-title-accent {
    color: var(--text3);
}
.auth-screen .auth-subtitle {
    text-align: left;
    margin-bottom: 24px;
    font-size: 11px;
    letter-spacing: 0.09em;
}
.auth-screen .text-center .auth-title,
.auth-screen .auth-card.text-center .auth-title {
    text-align: center;
}
.auth-screen .auth-card.text-center .auth-eyebrow {
    justify-content: center;
}

/* Register proof strip: hairline columns, mono ink values */
.auth-screen .auth-proof {
    gap: 0;
    padding: 13px 0;
    margin: 0 0 22px;
}
.auth-screen .auth-proof-item {
    padding: 0 14px;
    border-left: 1px solid var(--line);
}
.auth-screen .auth-proof-item:first-child {
    padding-left: 0;
    border-left: 0;
}
.auth-screen .auth-proof-item strong {
    font-size: 11px;
    color: var(--text);
    letter-spacing: 0.05em;
}
.auth-screen .auth-proof-item span {
    font-size: 11px;
    color: var(--text3);
}
@media (max-width: 420px) {
    .auth-screen .auth-proof-item {
        padding: 8px 0;
        border-left: 0;
        border-top: 1px solid var(--line);
    }
    .auth-screen .auth-proof-item:first-child {
        padding-top: 0;
        border-top: 0;
    }
}

/* Forgot link row, switch line */
.auth-forgot-row {
    text-align: right;
    margin: -4px 0 16px;
}
.auth-link {
    color: var(--text2);
    font-size: 12.5px;
    text-decoration: underline;
    text-decoration-color: var(--ball-border);
    text-underline-offset: 3px;
}
.auth-link:hover {
    color: var(--text);
    text-decoration-color: var(--text);
}
.auth-switch {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--text3);
}

/* Google button as quiet pill */
.google-custom-btn {
    min-height: var(--control-h);
    padding: 0 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--control-border);
    background: var(--input-bg);
    color: var(--text);
    font-weight: 600;
}
.google-custom-btn:hover {
    background: var(--control-bg);
    border-color: rgba(var(--ink-rgb), 0.4);
    color: var(--text);
}

.auth-divider span {
    font-size: 10px;
}

/* hCaptcha widget centred in the card */
#captcha-widget {
    display: flex;
    justify-content: center;
}

@media (max-width: 480px) {
    .auth-screen {
        padding: 6px 14px 40px;
        min-height: calc(100vh - 180px);
        min-height: calc(100dvh - 180px);
    }
    .auth-screen .auth-card {
        margin: 0 auto;
        padding: 26px 18px 24px;
        border-radius: 20px;
        box-shadow: 6px 6px 0 rgba(var(--shadow-rgb), 0.07);
    }
}

/* ═══════════════════════════════════════════════
   ONBOARDING (welcome overlay, nudge, coachmarks)
   ═══════════════════════════════════════════════ */

/* Welcome card: ink frame, theme-driven (tokens only, light + dark) */
.ob-welcome-backdrop {
    background: rgba(var(--shadow-rgb), 0.45);
}
.ob-welcome-card {
    background: var(--input-bg);
    border: 2px solid var(--text);
    border-radius: 24px;
    padding: 26px 26px 20px;
    box-shadow: 10px 10px 0 rgba(var(--shadow-rgb), 0.10);
}
.ob-welcome-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.ob-welcome-logo {
    margin-bottom: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--ball-border);
}

/* Mono eyebrow above the title (Stadium grammar) */
.ob-welcome-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text3);
}
.ob-welcome-eyebrow-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--ball);
    box-shadow: inset 0 0 0 1px var(--ball-border);
}
.ob-welcome-title {
    color: var(--text);
}
.ob-welcome-subtitle {
    color: var(--text2);
}

/* Progress dots (decorative, mirror the 3 steps) */
.ob-welcome-dots {
    display: flex;
    gap: 6px;
}
.ob-welcome-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--ink-rgb), 0.4);
    background: transparent;
}
.ob-welcome-dot--active {
    background: var(--ball);
    border-color: var(--ball-border);
}

/* Steps: capsule cards with mono 01/02/03 chips */
.ob-steps {
    gap: 10px;
    margin-bottom: 22px;
    border-top: 0;
}
.ob-step {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 18px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--control-bg);
}
.ob-step-num {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--control-border);
    border-radius: 50%;
    background: var(--input-bg);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text2);
    user-select: none;
}
.ob-step-label {
    font-size: 0.95rem;
    color: var(--text);
}
.ob-step-desc {
    color: var(--text2);
}

/* CTA pill: ink on ball, both themes */
.ob-welcome-cta {
    min-height: 46px;
    border: 1px solid var(--ball-border);
    border-radius: var(--radius-pill);
    background: var(--ball);
    color: var(--text-on-ball);
    font-size: 0.62rem;
    letter-spacing: 0.8px;
}
.ob-welcome-cta:hover {
    box-shadow: 0 2px 10px rgba(var(--shadow-rgb), 0.12);
}
.ob-welcome-skip {
    color: var(--text2);
}

/* Bankroll nudge icon inherits grass tint */
.ob-nudge-icon {
    color: var(--grass);
}

/* Coachmark tooltip: small ink frame + ink/ball dots */
.ob-tooltip {
    border: 2px solid var(--text);
    border-radius: 16px;
    box-shadow: 6px 6px 0 rgba(var(--shadow-rgb), 0.08);
}
.ob-tooltip-btn {
    border: 1px solid var(--ball-border);
    border-radius: var(--radius-pill);
}
.ob-tooltip-dot {
    width: 6px;
    height: 6px;
    box-sizing: border-box;
    background: transparent;
    border: 1.5px solid rgba(var(--ink-rgb), 0.4);
}
.ob-tooltip-dot--active {
    background: var(--ball);
    border-color: var(--ball-border);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .ob-welcome-backdrop,
    .ob-welcome-card,
    .ob-step,
    .ob-nudge,
    .auth-screen,
    .fade-in {
        animation: none !important;
    }
}

/* ════════════════════════════════════════════
   Onboarding welcome → non-blocking corner nudge (retour user #18)
   Modern toast pattern: slides in bottom-right, a 12s time bar depletes
   (paused on hover), then the card minimizes to a pill instead of
   squatting the middle of the screen. Loaded after the block above:
   these override the centered-modal rules.
   ════════════════════════════════════════════ */
.ob-welcome-backdrop {
    position: fixed;
    inset: auto 24px 24px auto;
    width: auto;
    height: auto;
    display: block;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    pointer-events: none;
    z-index: 1200;
}

.ob-welcome-card {
    pointer-events: auto;
    width: 372px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    position: relative;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 24px 60px -24px rgba(var(--shadow-rgb, 26, 29, 24), 0.45);
    animation: ob-nudge-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ob-welcome-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    background: var(--control-bg);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}
.ob-welcome-close:hover {
    color: var(--text);
    background: var(--control-bg-hover);
}

.ob-welcome-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--ball);
    transform: scaleX(1);
    transform-origin: 0 50%;
}
.ob-welcome-card.is-live .ob-welcome-progress {
    animation: ob-deplete 12s linear forwards;
}
.ob-welcome-card.is-live:hover .ob-welcome-progress {
    animation-play-state: paused;
}

/* Minimized pill (after the bar runs out, or never if reduced-motion) */
.ob-welcome-pill {
    pointer-events: auto;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg2);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 12px 30px -16px rgba(var(--shadow-rgb, 26, 29, 24), 0.4);
}
.ob-welcome-pill .ob-welcome-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: var(--ball);
    flex-shrink: 0;
}

.ob-welcome-backdrop.ob-minimized .ob-welcome-card {
    display: none;
}
.ob-welcome-backdrop.ob-minimized .ob-welcome-pill {
    display: inline-flex;
}

@keyframes ob-nudge-in {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes ob-deplete {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 640px) {
    .ob-welcome-backdrop {
        inset: auto 12px 12px 12px;
    }
    .ob-welcome-card {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ob-welcome-card {
        animation: none;
    }
    .ob-welcome-card.is-live .ob-welcome-progress {
        animation: none;
    }
}

/* ════════════════════════════════════════════
   Interactive guided tour (retour user #19) : spotlight on real
   elements + step card + completion toast. Tokens only, both themes.
   ════════════════════════════════════════════ */
.ob-tour-spot {
    position: fixed;
    z-index: 1300;
    border-radius: 18px;
    box-shadow: 0 0 0 9999px rgba(var(--shadow-rgb, 26, 29, 24), 0.52);
    border: 2px solid var(--ball);
    pointer-events: none;
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1), top 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ob-tour-card {
    position: fixed;
    z-index: 1301;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 24px 60px -24px rgba(var(--shadow-rgb, 26, 29, 24), 0.5);
    transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1), left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ob-tour-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text3);
}

.ob-tour-title {
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 650;
    color: var(--text);
}

.ob-tour-desc {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text2);
}

.ob-tour-foot {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ob-tour-dots {
    display: inline-flex;
    gap: 5px;
}
.ob-tour-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: var(--control-border);
}
.ob-tour-dot--on {
    background: var(--ball);
}

.ob-tour-btns {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ob-tour-skip {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    background: none;
    cursor: pointer;
}
.ob-tour-skip:hover { color: var(--text); }

.ob-tour-next {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--ball);
    color: var(--text-on-ball);
    cursor: pointer;
}

/* Action step: the card pulses gently toward the real click */
.ob-tour-card--action {
    border-color: var(--ball-border);
}
.ob-tour-card--action .ob-tour-eyebrow {
    color: var(--ball);
}

/* Completion toast (bottom center, depleting bar, auto-dismiss 5s) */
.ob-tour-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 1302;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--bg2);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    box-shadow: 0 16px 40px -18px rgba(var(--shadow-rgb, 26, 29, 24), 0.5);
    overflow: hidden;
    animation: ob-nudge-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.ob-tour-toast-dot {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--ball);
    flex-shrink: 0;
}
.ob-tour-toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--ball);
    transform-origin: 0 50%;
    animation: ob-deplete 5s linear forwards;
}

/* Welcome nudge: tour CTA primary, dashboard CTA becomes ghost */
.ob-welcome-cta--ghost {
    background: none;
    border: 1px solid var(--control-border);
    color: var(--text2);
}
.ob-welcome-cta--ghost:hover {
    color: var(--text);
    border-color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
    .ob-tour-spot,
    .ob-tour-card {
        transition: none;
    }
    .ob-tour-toast {
        animation: none;
    }
    .ob-tour-toast-bar {
        animation: none;
        display: none;
    }
}

/* ════════════════════════════════════════════
   Contextual tour offer (bottom-right pill, first visit of a screen).
   Reuses the .ob-welcome-pill grammar; 15s depleting bar (pattern #18),
   pause on hover, ✕ to dismiss. Tokens only, both themes.
   ════════════════════════════════════════════ */
.ob-offer {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1190;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: ob-nudge-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.ob-offer .ob-offer-pill {
    display: inline-flex;
    position: relative;
    overflow: hidden;
}
.ob-offer-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--ball);
    transform-origin: 0 50%;
}
.ob-offer.is-live .ob-offer-bar {
    animation: ob-deplete 15s linear forwards;
}
.ob-offer.is-live:hover .ob-offer-bar {
    animation-play-state: paused;
}
.ob-offer.is-leaving {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.ob-offer-x {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 99px;
    border: 1px solid var(--line);
    background: var(--bg2);
    color: var(--text3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 30px -16px rgba(var(--shadow-rgb, 26, 29, 24), 0.4);
}
.ob-offer-x:hover {
    color: var(--text);
    background: var(--control-bg-hover);
}

@media (max-width: 640px) {
    .ob-offer {
        right: 12px;
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ob-offer {
        animation: none;
    }
    .ob-offer.is-live .ob-offer-bar {
        animation: none;
        display: none;
    }
    .ob-offer.is-leaving {
        transition: none;
    }
}

/* Topbar « ? » tour entry: inherits the .theme-toggle 32px pill frame */
.tour-help {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}
