/* Posiverse onboarding. Same maroon and warm neutrals as the app and
   posiverse.in. System fonts only, so the strict CSP in vercel.json holds. */
:root {
  --screen: #F7F6F4; --surface: #FFFFFF; --chip: #F0EEEC;
  --ink: #1B1A1F; --text-2: #6B6870; --border: #E6E3E0; --border-strong: #DAD7D3;
  --accent: #7A2B35; --accent-hover: #5E1F27; --accent-soft: #F6ECEE;
  --success: #1A7548; --success-bg: #EAF8EF; --success-border: #B9E3C6;
  --danger: #C21F33; --danger-bg: #FCEEF0; --danger-border: #F3C1CA;
  --r: 12px; --r-lg: 20px; --pill: 999px;
  --shadow: 0 1px 2px rgba(27,26,31,.04), 0 8px 24px rgba(27,26,31,.06);
  --shadow-lg: 0 30px 60px -20px rgba(27,26,31,.25);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--screen); color: var(--ink);
  font: 15.5px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -.025em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }

/* ── Layout ─────────────────────────────────────────────────── */
.layout { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 440px) 1fr; }

.aside {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(60% 50% at 85% 10%, rgba(255,255,255,.14), transparent 70%),
    radial-gradient(70% 60% at 0% 100%, rgba(0,0,0,.25), transparent 70%),
    linear-gradient(160deg, #8E3440 0%, var(--accent) 45%, #3E141B 100%);
}
.aside::before {
  content: ""; position: absolute; inset: 0; opacity: .12; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, #000, transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
}
.aside-inner { position: sticky; top: 0; min-height: 100vh; padding: 40px; display: flex; flex-direction: column; gap: 40px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.mark { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.18); }
.brand-tag { font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--pill); background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); }

.aside-copy h1 { font-size: clamp(28px, 3.2vw, 38px); margin-bottom: 14px; }
.aside-copy p { color: rgba(255,255,255,.8); font-size: 16px; max-width: 30em; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(4px); }
.checklist strong { display: block; font-size: 15px; }
.checklist span:not(.tick) { color: rgba(255,255,255,.72); font-size: 13.5px; }
.tick { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: #fff; position: relative; margin-top: 1px; }
.tick::after { content: ""; position: absolute; left: 8px; top: 5px; width: 6px; height: 11px; border: solid var(--accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

.aside-foot { margin-top: auto; font-size: 13px; color: rgba(255,255,255,.65); }
.aside-foot a { color: #fff; text-underline-offset: 3px; }

.main { padding: 40px clamp(20px, 5vw, 64px) 64px; display: flex; justify-content: center; }
.view { width: 100%; max-width: 760px; animation: rise .35s ease both; }
.view-login { display: grid; place-items: center; min-height: calc(100vh - 104px); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

/* ── Cards ──────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-login { width: 100%; max-width: 400px; padding: 36px; display: grid; gap: 16px; box-shadow: var(--shadow-lg); }
.card-login h2 { font-size: 26px; }
.card-login .muted { margin-top: -10px; }
.lock {
  width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); position: relative;
}
.lock::before { content: ""; position: absolute; left: 15px; top: 9px; width: 18px; height: 16px; border: 3px solid var(--accent); border-bottom: 0; border-radius: 10px 10px 0 0; }
.lock::after { content: ""; position: absolute; left: 12px; top: 22px; width: 24px; height: 17px; border-radius: 5px; background: var(--accent); }

.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.topbar h2 { font-size: 30px; margin-bottom: 4px; }
.topbar-actions { display: flex; gap: 8px; }

.card-form { padding: 8px 32px 28px; }
.step { border: 0; margin: 0; padding: 26px 0 22px; border-bottom: 1px solid var(--border); display: grid; gap: 16px; min-width: 0; }
.step legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; padding: 0; }
.step legend + * { clear: both; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 700; }
.step-hint { color: var(--text-2); font-size: 14px; margin-top: -6px; }
.opt { font-size: 12px; font-weight: 500; color: var(--text-2); }

/* ── Fields ─────────────────────────────────────────────────── */
.field { display: grid; gap: 7px; min-width: 0; }
.field label, .field .label { font-size: 13.5px; font-weight: 600; }
.hint { font-size: 12.5px; color: var(--text-2); }
input[type=text], input[type=email], input[type=tel], input[type=password], input:not([type]) {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--screen);
  font-size: 16px; /* 16px stops iOS zooming on focus */
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input:hover { border-color: #C9C5C0; }
input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px rgba(122,43,53,.12); }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(194,31,51,.1); }
input::placeholder { color: #A9A5AC; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { grid-template-columns: 1.3fr 1.3fr 1fr; }

.pw { position: relative; }
.pw input { padding-right: 76px; }
.pw-toggle {
  position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 12px; border-radius: 9px;
  border: 0; background: var(--chip); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); }

.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--chip); border-radius: var(--pill); width: fit-content; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: block; padding: 9px 22px; border-radius: var(--pill); font-weight: 600; font-size: 14.5px; color: var(--text-2); transition: background-color .15s, color .15s, box-shadow .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(27,26,31,.12); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: var(--pill); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s, opacity .15s;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -10px rgba(122,43,53,.7); }
.btn-primary:not(:disabled):hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); height: 40px; padding: 0 16px; font-size: 14px; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; height: 50px; }
.btn:not(:disabled):active { transform: scale(.98); }

.alert { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); padding: 11px 14px; border-radius: var(--r); font-size: 14px; }
.card-form .alert { margin-top: 20px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; flex-wrap: wrap; }

/* ── Done ───────────────────────────────────────────────────── */
.card-done { padding: 40px; text-align: center; }
.done-badge {
  width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; position: relative;
  background: var(--success-bg); border: 1px solid var(--success-border);
  animation: pop .45s cubic-bezier(.2,1.4,.4,1) both;
}
.done-badge::after { content: ""; position: absolute; left: 27px; top: 17px; width: 14px; height: 28px; border: solid var(--success); border-width: 0 4px 4px 0; transform: rotate(45deg); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .done-badge { animation: none; } }
.card-done h2 { font-size: 28px; margin-bottom: 8px; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 28px 0; text-align: left; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.summary div { background: var(--surface); padding: 14px 16px; min-width: 0; }
.summary dt { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 3px; }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.next { text-align: left; background: var(--screen); border-radius: 14px; padding: 18px 22px; }
.next h3 { font-size: 15px; margin-bottom: 8px; }
.next ol { margin: 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 4px; }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.done-actions .btn-ghost { height: 46px; }

/* ── Small screens ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .aside-inner { position: static; min-height: 0; padding: 24px 20px 28px; gap: 18px; }
  .aside-copy h1 { font-size: 24px; margin-bottom: 8px; }
  .aside-copy p { font-size: 14.5px; }
  .checklist { grid-template-columns: 1fr 1fr; gap: 8px; }
  .checklist li { padding: 10px 12px; gap: 10px; }
  .checklist span:not(.tick) { display: none; }
  .aside-foot { display: none; }
  .main { padding: 24px 16px 48px; }
  .view-login { min-height: 0; padding-top: 8px; }
}
@media (max-width: 600px) {
  .row, .row-3, .summary { grid-template-columns: 1fr; }
  .card-form { padding: 4px 18px 22px; }
  .card-login, .card-done { padding: 26px 20px; }
  .topbar h2 { font-size: 24px; }
  .form-foot .btn { width: 100%; }
  .checklist strong { font-size: 13.5px; }
}
