/* ============================================================================
   InterSpace Distribution · web sign-up flow  (css/onboarding-flow.css)

   The two-step sign-up (signup.php) and the email code page (verify-email.php)
   drawn like the iPhone app's onboarding: the ACCOUNT · VERIFY · STUDIO rail,
   a mono eyebrow with a red dot, a big headline with one marked word, choice
   cards, mono field labels and ink pill buttons. Loaded after
   interspace-brand.css and uses its tokens, so dark mode follows them.
   Everything is scoped to .ob-* classes; no other page is affected.
   ============================================================================ */

/* ---- Rail ---------------------------------------------------------------- */
body .ob-top { display: flex; align-items: center; gap: 14px; margin: 0 0 34px; }
body .ob-back {
    flex: none; width: 38px; height: 38px; border-radius: var(--r-pill);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2);
    transition: background-color var(--t-quick) var(--ease), transform var(--t-quick) var(--ease);
}
body .ob-back:hover { background: var(--white); }
body .ob-back:active { transform: scale(0.94); }
body .ob-rail {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
    margin: 0; padding: 0; list-style: none;
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
body .ob-rail li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
body .ob-rail li + li { flex: 1; }
body .ob-rail li + li::before {
    content: ""; flex: 1; min-width: 12px; height: 1px; margin-right: 1px;
    background: var(--line-2); transition: background-color var(--t-std) var(--ease);
}
body .ob-rail li.is-done + li::before { background: var(--ink); }
body .ob-rail .is-current, body .ob-rail .is-done { color: var(--ink); }
body .ob-dot {
    flex: none; width: 13px; height: 13px; border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px var(--muted-2);
    transition: box-shadow var(--t-std) var(--ease), background-color var(--t-std) var(--ease);
}
body .ob-rail .is-current .ob-dot { box-shadow: inset 0 0 0 1.5px var(--ink), inset 0 0 0 4px var(--paper); background: var(--ink); }
body .ob-rail .is-done .ob-dot { background: var(--ink); box-shadow: none; }
@media (max-width: 380px) {
    body .ob-rail { letter-spacing: 0.08em; font-size: 10px; gap: 6px; }
}

/* ---- Type ---------------------------------------------------------------- */
body .ob-eyebrow {
    display: flex; align-items: center; gap: 9px; margin: 0 0 14px;
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
body .ob-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
body h1.ob-title, body .ob-title {
    margin: 0 0 14px; outline: none;
    font-size: clamp(34px, 8.6vw, 44px); font-weight: 600; line-height: 1.02;
    letter-spacing: -0.04em; color: var(--ink);
}
body .ob-title mark {
    color: inherit; padding: 0 0.04em; margin: 0 -0.04em;
    background: linear-gradient(transparent 60%, rgba(222, 10, 38, 0.17) 60%, rgba(222, 10, 38, 0.17) 92%, transparent 92%);
}
html[data-theme="dark"] body .ob-title mark {
    background: linear-gradient(transparent 60%, rgba(222, 10, 38, 0.38) 60%, rgba(222, 10, 38, 0.38) 92%, transparent 92%);
}
body .ob-sub { margin: 0 0 26px; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }

/* ---- Steps ---------------------------------------------------------------- */
body .ob-step[hidden] { display: none; }
body .ob-step.is-entering { animation: obIn 0.46s var(--ease-out) both; }
body .ob-step.is-entering.is-back { animation-name: obInBack; }
@keyframes obIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes obInBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* ---- Choice cards ("Who is releasing?") ---------------------------------- */
body .ob-choices { display: grid; gap: 12px; margin: 0 0 28px; border: 0; padding: 0; }
body .ob-choice {
    position: relative; display: grid; grid-template-columns: 46px 1fr 22px; align-items: center; gap: 14px;
    padding: 16px 18px 16px 16px; border-radius: 20px; cursor: pointer;
    background: var(--white); box-shadow: var(--shadow-card);
    transition: box-shadow var(--t-quick) var(--ease), transform var(--t-quick) var(--ease);
}
body .ob-choice:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
body .ob-choice:active { transform: scale(0.985); }
body .ob-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
body .ob-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
body .ob-choice-icon {
    width: 46px; height: 46px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--paper-2); color: var(--ink);
    transition: background-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease);
}
body .ob-choice-title { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.25; }
body .ob-choice-desc { display: block; margin-top: 3px; font-size: 14px; line-height: 1.42; color: var(--ink-2); }
body .ob-radio {
    width: 22px; height: 22px; border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px var(--line-2);
    transition: box-shadow var(--t-quick) var(--ease), background-color var(--t-quick) var(--ease);
}
body .ob-choice:has(input:checked) { box-shadow: 0 0 0 1.5px var(--ink), var(--shadow-md); }
body .ob-choice:has(input:checked) .ob-choice-icon { background: var(--ink); color: var(--paper); }
body .ob-choice:has(input:checked) .ob-radio { background: var(--ink); box-shadow: inset 0 0 0 6px var(--ink), inset 0 0 0 11px var(--paper); }
body .ob-choices.is-error .ob-choice { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-card); }

/* ---- Fields --------------------------------------------------------------- */
body .ob-group { margin: 0 0 22px; }
body .ob-field { margin: 0 0 16px; }
body .ob-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body .ob-label {
    display: block; margin: 0 0 8px;
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
body .ob-label .ob-opt { letter-spacing: 0.06em; text-transform: none; color: var(--muted-2); }
body .ob-input-wrap { position: relative; }
body .ob-input-wrap .form-input { padding-left: 44px; }
body .ob-input-wrap.has-toggle .form-input { padding-right: 48px; }
body .ob-input-icon {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--muted); display: inline-flex; pointer-events: none;
}
body .ob-pw .form-input { padding-left: 16px; }
body .ob-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; border-radius: var(--r-pill); background: transparent;
    display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer;
}
body .ob-toggle:hover { color: var(--ink); background: var(--paper-2); }
body .ob-hint { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
body .ob-err { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--accent); }
body .ob-err:empty { display: none; }
body select.form-input { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; }
body select.form-input:invalid, body select.form-input.is-placeholder { color: var(--muted-2); }
body select.form-input option { color: var(--ink); }

/* Password strength: four segments and a mono note, like the app */
body .ob-meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: center; gap: 6px; margin-top: 10px; }
body .ob-meter i { display: block; height: 3px; border-radius: 3px; background: var(--line-2); transition: background-color var(--t-std) var(--ease); }
body .ob-meter span {
    margin-left: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--muted);
}
body .ob-meter[data-level="1"] i:nth-child(-n+1) { background: var(--accent); }
body .ob-meter[data-level="2"] i:nth-child(-n+2) { background: var(--wait); }
body .ob-meter[data-level="3"] i:nth-child(-n+3) { background: var(--live); }
body .ob-meter[data-level="4"] i { background: var(--live); }

/* Terms checkbox */
body .ob-check { display: flex; align-items: flex-start; gap: 12px; margin: 6px 0 22px; font-size: 14px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
body .ob-check input {
    flex: none; appearance: none; -webkit-appearance: none; margin: 1px 0 0;
    width: 20px; height: 20px; border-radius: 6px; cursor: pointer;
    background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line-2);
    display: inline-grid; place-content: center;
    transition: background-color var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease);
}
body .ob-check input::after {
    content: ""; width: 10px; height: 6px; margin-top: -2px;
    border-left: 2px solid var(--paper); border-bottom: 2px solid var(--paper);
    transform: rotate(-45deg) scale(0); transition: transform var(--t-quick) var(--ease);
}
body .ob-check input:checked { background: var(--ink); box-shadow: none; }
body .ob-check input:checked::after { transform: rotate(-45deg) scale(1); }
body .ob-check input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
body .ob-check a { color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line-2); text-decoration: none; }
body .ob-check a:hover { border-color: var(--ink); }

/* ---- Buttons -------------------------------------------------------------- */
body .ob-btn {
    width: 100%; height: 54px; border: 0; border-radius: var(--r-pill);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-display); font-size: 15.5px; font-weight: 500; letter-spacing: -0.008em;
    text-decoration: none; cursor: pointer;
    transition: transform var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease), background-color var(--t-quick) var(--ease), opacity var(--t-quick) var(--ease);
}
body .ob-btn:active { transform: scale(0.97); }
body .ob-btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-btn); }
body .ob-btn-primary:hover { background: #000; }
html[data-theme="dark"] body .ob-btn-primary:hover { background: #fff; }
body .ob-btn-primary[disabled] { opacity: 0.7; cursor: progress; transform: none; }
body .ob-btn-ghost { background: var(--glass); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
body .ob-btn-ghost:hover { background: var(--white); box-shadow: inset 0 0 0 1px rgba(42, 42, 39, 0.2); }
body .ob-btn svg { flex: none; }
body .ob-btn .ob-arrow { transition: transform var(--t-quick) var(--ease); }
body .ob-btn:hover .ob-arrow { transform: translateX(3px); }
body .ob-spin { animation: obSpin 0.8s linear infinite; }
@keyframes obSpin { to { transform: rotate(360deg); } }
body .ob-caption {
    margin: 12px 0 0; text-align: center;
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
body .ob-or {
    display: flex; align-items: center; gap: 14px; margin: 22px 0;
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
body .ob-or::before, body .ob-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
body .ob-step-1 .ob-btn-ghost { margin-top: 12px; }

/* Server-side problems that are not tied to one field */
body .ob-alert { margin: 0 0 22px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 14px; line-height: 1.5; }
body .ob-alert a { color: inherit; font-weight: 600; }

/* ---- Verify page (rail + headline above the existing code form) ---------- */
body .ob-verify .ob-title, body .ob-verify .ob-sub { text-align: left; }

@media (prefers-reduced-motion: reduce) {
    body .ob-step.is-entering { animation: none; }
    body .ob-choice, body .ob-btn, body .ob-back { transition: none; }
}

/* ---- Small pieces --------------------------------------------------------- */
body .ob-count { margin-left: auto; color: var(--muted); letter-spacing: 0.1em; }
body .ob-wrap .auth-mobile-logo, body .ob-verify .auth-mobile-logo { margin-bottom: 28px; }
/* The terms message sits under the sentence, clear of the button */
body .ob-check + .ob-err { margin: -14px 0 20px 32px; }

/* ---- Footer: the agreement line under both steps */
body .ob-footer { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; }
body .ob-legal-note { margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
body .ob-legal-note a { color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line-2); }
body .ob-legal-note a:hover { border-color: var(--ink); }
body .ob-copy { margin: 0; font-size: 12.5px; color: var(--muted); }
