/* ====== Signup — TOS app chrome (light, dark-aware), two-panel auth ======
 * Migrated off home_2026. Everything scopes under body.tos-app and reads the
 * OS --tos-* tokens (tos-app.css). Shares the login two-panel shell (lg-*):
 * left brand/messaging panel + right form card. Accent is flavor-aware:
 * Timer orange (default) -> Socia teal under html[data-platform="socia"].
 * Class names are unchanged so signup.js is untouched.
 */

:root {
    --su-accent:        #fb923c;
    --su-accent-strong: #f97316;
    --su-accent-bg:     rgba(251, 146, 60, 0.10);
    --su-accent-border: rgba(251, 146, 60, 0.30);
    --su-glow:          rgba(251, 146, 60, 0.22);
}
html[data-platform="socia"] {
    --su-accent:        #00b8d6;
    --su-accent-strong: #0095ad;
    --su-accent-bg:     rgba(0, 184, 214, 0.10);
    --su-accent-border: rgba(0, 184, 214, 0.30);
    --su-glow:          rgba(0, 184, 214, 0.22);
}

body.tos-app.tos-page-signup { min-height: 100vh; }

/* ---- Two-panel shell (shared with login) ---- */
.lg-split { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.lg-main { display: flex; flex-direction: column; min-width: 0; }

.lg-aside { display: none; position: relative; overflow: hidden; flex-direction: column; justify-content: space-between; padding: 48px 44px; background: #0a0612; color: #ffffff; }
.lg-aside::before { content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(58% 55% at 18% 12%, var(--su-glow) 0%, transparent 60%),
                radial-gradient(50% 50% at 92% 92%, rgba(124, 58, 237, 0.16) 0%, transparent 60%); }
.lg-aside-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 11px; }
.lg-aside-brand img { width: 32px; height: 32px; }
.lg-aside-brand-name { font-family: var(--tos-font-body); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.lg-aside-brand-tag { font-family: var(--tos-font-mono); font-size: 0.58rem; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); }
.lg-aside-inner { position: relative; z-index: 1; margin: auto 0; }
.lg-aside-headline { font-family: var(--tos-font-body); font-size: 2.1rem; font-weight: 800; line-height: 1.14; letter-spacing: -0.03em; color: #fff; margin: 0 0 16px; }
.lg-aside-sub { font-size: 0.98rem; line-height: 1.6; color: rgba(255, 255, 255, 0.72); margin: 0 0 30px; max-width: 340px; }
.lg-pills { display: flex; flex-wrap: wrap; gap: 10px; max-width: 360px; }
.lg-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 100px; font-size: 0.8rem; font-weight: 500; color: rgba(255, 255, 255, 0.88); }
.lg-pill i { font-size: 0.82rem; color: var(--su-accent); }
.lg-aside-foot { position: relative; z-index: 1; font-family: var(--tos-font-mono); font-size: 0.66rem; letter-spacing: 0.5px; color: rgba(255, 255, 255, 0.42); }

/* The aside is ALWAYS dark (#0a0612), so its text must stay light in BOTH themes.
   tos-app.css `body.tos-app h1 { color: var(--tos-text) }` (0,1,2) out-specifies
   the bare `.lg-aside-headline` (0,1,0) and turns the headline dark-on-dark in the
   LIGHT theme. Pin every aside text token light at a higher specificity. */
body.tos-app .lg-aside-headline,
body.tos-app .lg-aside-brand-name { color: #ffffff; }
body.tos-app .lg-aside-sub { color: rgba(255, 255, 255, 0.74); }
body.tos-app .lg-aside-brand-tag { color: rgba(255, 255, 255, 0.5); }
body.tos-app .lg-aside-foot { color: rgba(255, 255, 255, 0.44); }
body.tos-app .lg-pill { color: rgba(255, 255, 255, 0.88); }

/* Top bar */
.lg-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; background: transparent; }
.lg-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.lg-brand-mark { width: 26px; height: 26px; }
.lg-brand-name { font-family: var(--tos-font-body); font-weight: 800; font-size: 1.05rem; color: var(--tos-text); letter-spacing: -0.02em; }
body.tos-app .lg-top-link { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; text-decoration: none; font-size: 0.8rem; color: var(--tos-text-muted); line-height: 1.3; }
body.tos-app .lg-top-cta { color: var(--su-accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
body.tos-app .lg-top-cta i { font-size: 0.7rem; }

/* Stage + card */
.lg-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 20px 48px; }
.lg-card { width: 100%; max-width: 440px; background: transparent; border: none; box-shadow: none; padding: 0; }
.lg-strip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--tos-font-mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--tos-text-muted); margin-bottom: 16px; }
.lg-strip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--su-accent); }
.lg-legal { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.76rem; }
body.tos-app .lg-legal a { color: var(--tos-text-muted); text-decoration: none; }
body.tos-app .lg-legal a:hover { color: var(--su-accent); }
.lg-legal-sep { color: var(--tos-border-strong); }

@media (min-width: 900px) {
    .lg-split { grid-template-columns: 460px 1fr; }
    .lg-aside { display: flex; }
    .lg-top .lg-brand { display: none; }
    .lg-top { justify-content: flex-end; }
}

/* ---- Shared form kit ---- */
body.tos-app .social-login { margin-bottom: 4px; }
body.tos-app .btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 44px; background: var(--tos-surface); border: 1px solid var(--tos-border-strong); border-radius: var(--tos-radius-md); color: var(--tos-text); font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background var(--tos-duration) var(--tos-ease), border-color var(--tos-duration) var(--tos-ease); }
body.tos-app .btn-google:hover { background: var(--tos-surface-hover); border-color: var(--su-accent-border); }
body.tos-app .btn-google:disabled { opacity: 0.6; cursor: not-allowed; }

body.tos-app .divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--tos-text-dim); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1px; font-family: var(--tos-font-mono); }
body.tos-app .divider::before, body.tos-app .divider::after { content: ''; flex: 1; height: 1px; background: var(--tos-border); }

body.tos-app .form-fields { display: flex; flex-direction: column; }
body.tos-app .form-group { margin-bottom: 16px; }
body.tos-app .form-group > label { display: block; margin-bottom: 6px; font-size: 0.8rem; font-weight: 600; color: var(--tos-text-secondary); }
body.tos-app .input-wrapper { position: relative; }
body.tos-app .form-input { width: 100%; height: 44px; padding: 0 14px; background: var(--tos-surface); border: 1px solid var(--tos-control-border); border-radius: var(--tos-radius-md); color: var(--tos-text); font-family: inherit; font-size: 0.9rem; box-sizing: border-box; transition: border-color var(--tos-duration) var(--tos-ease), box-shadow var(--tos-duration) var(--tos-ease); }
body.tos-app .form-input::placeholder { color: var(--tos-text-dim); }
body.tos-app .form-input:focus { outline: none; border-color: var(--su-accent); box-shadow: 0 0 0 3px var(--su-accent-bg); }
body.tos-app .form-input.error { border-color: var(--tos-error); }
body.tos-app .password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--tos-text-dim); cursor: pointer; }
body.tos-app .password-toggle:hover { color: var(--su-accent); }
body.tos-app .field-error { margin-top: 5px; font-size: 0.74rem; color: var(--tos-error); }

/* ---- Per-step header ---- */
body.tos-app .card-header { margin-bottom: 20px; }
body.tos-app .card-header h2 { margin: 0 0 6px; font-family: var(--tos-font-body); font-size: 1.4rem; font-weight: 700; line-height: 1.18; letter-spacing: -0.02em; color: var(--tos-text); }
body.tos-app .card-header p { margin: 0; font-family: var(--tos-font-body); font-size: 0.88rem; line-height: 1.5; color: var(--tos-text-muted); }
body.tos-app .card-header strong { color: var(--su-accent); font-weight: 600; }

/* ---- Progress steps ---- */
body.tos-app .progress-steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--tos-border); }
body.tos-app .progress-step { display: inline-flex; align-items: center; gap: 8px; }
body.tos-app .step-number { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--tos-surface-sunken); border: 1px solid var(--tos-border-strong); color: var(--tos-text-muted); font-family: var(--tos-font-mono); font-size: 0.72rem; font-weight: 600; transition: all 0.2s ease; }
body.tos-app .step-label { font-family: var(--tos-font-mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--tos-text-dim); transition: color 0.2s ease; }
body.tos-app .progress-step.active .step-number { background: var(--su-accent); border-color: var(--su-accent); color: #ffffff; }
body.tos-app .progress-step.active .step-label { color: var(--tos-text); }
body.tos-app .progress-step.completed .step-number { background: var(--su-accent-bg); border-color: var(--su-accent-border); color: var(--su-accent); }
body.tos-app .progress-step.completed .step-label { color: var(--tos-text-muted); }
body.tos-app .progress-connector { width: 22px; height: 1px; background: var(--tos-border-strong); }
body.tos-app .progress-step.completed + .progress-connector { background: var(--su-accent-border); }

/* Step visibility */
body.tos-app .signup-step { display: none; }
body.tos-app .signup-step.active { display: block; animation: su-fadein 0.3s ease; }

/* ---- Buttons ---- */
body.tos-app .btn-primary { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; height: 46px; padding: 0 20px; background: var(--su-accent); color: #ffffff; border: 1px solid var(--su-accent); border-radius: var(--tos-radius-md); font-family: var(--tos-font-body); font-size: 0.92rem; font-weight: 700; cursor: pointer; transition: background var(--tos-duration) var(--tos-ease); }
body.tos-app .btn-primary:hover { background: var(--su-accent-strong); border-color: var(--su-accent-strong); }
body.tos-app .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
body.tos-app .btn-primary.loading { pointer-events: none; opacity: 0.8; }
body.tos-app .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; background: var(--tos-surface); border: 1px solid var(--tos-border-strong); border-radius: var(--tos-radius-md); color: var(--tos-text); font-family: var(--tos-font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background var(--tos-duration) var(--tos-ease), border-color var(--tos-duration) var(--tos-ease); }
body.tos-app .btn-secondary:hover { background: var(--tos-surface-hover); border-color: var(--su-accent-border); }
body.tos-app .step-actions { display: flex; gap: 10px; margin-top: 8px; }
body.tos-app .step-actions .btn-primary { flex: 1; margin-top: 0; }

/* ---- Username workspace URL prefix ---- */
body.tos-app .input-with-prefix { display: flex; align-items: stretch; }
body.tos-app .input-prefix { display: inline-flex; align-items: center; padding: 0 8px 0 12px; background: var(--tos-surface-sunken); border: 1px solid var(--tos-control-border); border-right: none; border-radius: var(--tos-radius-md) 0 0 var(--tos-radius-md); color: var(--tos-text-muted); font-family: var(--tos-font-mono); font-size: 0.8rem; white-space: nowrap; }
body.tos-app .input-with-prefix .form-input { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: none; }

/* ---- Name row + select + textarea ---- */
body.tos-app .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
body.tos-app .form-select, body.tos-app .form-textarea { width: 100%; padding: 11px 14px; background: var(--tos-surface); border: 1px solid var(--tos-control-border); border-radius: var(--tos-radius-md); color: var(--tos-text); font-family: var(--tos-font-body); font-size: 0.9rem; outline: none; box-sizing: border-box; transition: border-color var(--tos-duration) var(--tos-ease), box-shadow var(--tos-duration) var(--tos-ease); }
body.tos-app .form-select { -webkit-appearance: none; appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
body.tos-app .form-textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
body.tos-app .form-select:focus, body.tos-app .form-textarea:focus { border-color: var(--su-accent); box-shadow: 0 0 0 3px var(--su-accent-bg); }

/* ---- Optional tag + hints ---- */
body.tos-app .optional { font-family: var(--tos-font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1px; color: var(--tos-text-dim); font-weight: 500; }
body.tos-app .field-hint { margin-top: 5px; font-family: var(--tos-font-mono); font-size: 0.64rem; letter-spacing: 0.4px; color: var(--tos-text-dim); }

/* ---- Password strength (semantic, not brand) ---- */
body.tos-app .password-strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
body.tos-app .strength-bar { flex: 1; height: 3px; background: var(--tos-surface-sunken); border-radius: 2px; overflow: hidden; }
body.tos-app .strength-fill { height: 100%; width: 0%; border-radius: 2px; transition: all 0.3s ease; }
body.tos-app .strength-fill.weak { width: 25%; background: var(--tos-error); }
body.tos-app .strength-fill.fair { width: 50%; background: var(--tos-pending); }
body.tos-app .strength-fill.good { width: 75%; background: var(--tos-info); }
body.tos-app .strength-fill.strong { width: 100%; background: var(--tos-ok); }
body.tos-app .strength-text { font-family: var(--tos-font-mono); font-size: 0.62rem; letter-spacing: 0.4px; color: var(--tos-text-dim); white-space: nowrap; }

/* ---- Password match check ---- */
body.tos-app .password-match { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--tos-ok); opacity: 0; transition: opacity 0.2s ease; }
body.tos-app .password-match.show { opacity: 1; }

/* ---- Verification code input ---- */
body.tos-app .form-input-code { text-align: center; font-family: var(--tos-font-mono); font-size: 1.4rem; letter-spacing: 10px; padding: 14px; height: auto; }

/* ---- Resend + link button ---- */
body.tos-app .resend-section { text-align: center; margin: 6px 0 2px; }
body.tos-app .resend-section p { margin: 0; font-size: 0.85rem; color: var(--tos-text-muted); }
body.tos-app .link-button { background: none; border: none; padding: 0; cursor: pointer; font-family: var(--tos-font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--su-accent); font-weight: 600; }
body.tos-app .link-button:hover { color: var(--su-accent-strong); text-decoration: underline; }
body.tos-app .resend-timer { color: var(--tos-text-dim); font-size: 0.8rem; }

/* ---- Referrer badge ---- */
body.tos-app .referrer-badge { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 20px; background: var(--su-accent-bg); border: 1px solid var(--su-accent-border); border-radius: var(--tos-radius-md); }
body.tos-app .referrer-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 1px solid var(--tos-border-strong); }
body.tos-app .referrer-avatar img { width: 100%; height: 100%; object-fit: cover; }
body.tos-app .referrer-info { font-size: 0.82rem; color: var(--tos-text-muted); line-height: 1.4; }
body.tos-app .referrer-name { color: var(--tos-text); font-weight: 600; }
body.tos-app .referrer-bonus { color: var(--su-accent); font-weight: 600; }

/* ---- Toasts (signup.js builds .toast.toast-{type}) ---- */
body.tos-app .toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
body.tos-app .toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; max-width: 340px; background: var(--tos-surface); border: 1px solid var(--tos-border); border-left: 3px solid var(--su-accent); border-radius: var(--tos-radius-md); color: var(--tos-text); font-size: 0.86rem; box-shadow: var(--tos-shadow-raised); opacity: 0; transform: translateX(20px); transition: opacity 0.25s ease, transform 0.25s ease; }
body.tos-app .toast.show { opacity: 1; transform: translateX(0); }
body.tos-app .toast-error { border-left-color: var(--tos-error); }
body.tos-app .toast-success { border-left-color: var(--tos-ok); }
body.tos-app .toast-warning { border-left-color: var(--tos-pending); }
body.tos-app .toast-info { border-left-color: var(--tos-info); }
body.tos-app .toast i { font-size: 1rem; }
body.tos-app .toast-error i { color: var(--tos-error); }
body.tos-app .toast-success i { color: var(--tos-ok); }
body.tos-app .toast-warning i { color: var(--tos-pending); }
body.tos-app .toast-info i { color: var(--tos-info); }

/* ---- Responsive ---- */
@media (max-width: 520px) {
    body.tos-app .form-row { grid-template-columns: 1fr; }
    body.tos-app .step-label { display: none; }
    body.tos-app .step-actions { flex-direction: column-reverse; }
    body.tos-app .step-actions .btn-secondary { width: 100%; }
}

@keyframes su-fadein { from { opacity: 0; } to { opacity: 1; } }

/* The invited address, filled in and locked (11 Nov 2026): it must read as fixed, not as a field to edit. */
.form-input[readonly] { background: var(--tos-surface-sunken); color: var(--tos-text-muted); cursor: default; }
