/* Public registration and member account. Tokens and shared components
   live in base.css; this file only lays out these two pages. */

body.public { background: var(--surface); }
body.member { background: var(--bg); }

/* ---------- Shared chrome ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--sp-4) 0;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-meta { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.progress { height: 3px; background: var(--line); }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent-line); transition: width .4s var(--ease); }

/* ---------- Registration layout ---------- */

.shell { display: grid; grid-template-columns: 360px 1fr; min-height: 100vh; }
.aside {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: var(--sp-8);
  background: var(--navy); color: var(--on-navy);
}
.aside .brand-sub { color: var(--on-navy-2); }
.aside-body { margin: auto 0; }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 var(--sp-3); border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--on-navy-accent); font-size: 13px; font-weight: 600; }
.aside h1 { font-size: 30px; line-height: 1.12; margin: var(--sp-4) 0 var(--sp-3); }
.aside h1 em { font-style: normal; color: var(--on-navy-accent); }
.aside-lede { color: var(--on-navy-2); font-size: 15px; max-width: 30ch; }
.aside-foot { display: flex; gap: var(--sp-2); align-items: center; font-size: 13px; color: var(--on-navy-2); }

.stepper { list-style: none; margin: var(--sp-6) 0 0; padding: 0; display: grid; gap: var(--sp-1); }
.stepper li { display: flex; align-items: center; gap: var(--sp-3); height: 36px; font-size: 14px; color: var(--on-navy-2); }
.stepper .dot { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .3); font-family: var(--mono); font-size: 12px; }
.stepper li.current { color: var(--on-navy); font-weight: 600; }
.stepper li.current .dot { background: var(--on-navy-accent); border-color: var(--on-navy-accent); color: var(--navy); }
.stepper li.done .dot { background: rgba(127, 217, 244, .18); border-color: transparent; color: var(--on-navy-accent); }

.main { display: flex; flex-direction: column; min-width: 0; }
.main .topbar { display: none; }
.stage { flex: 1; display: flex; justify-content: center; align-items: center; padding: var(--sp-8) var(--sp-6); }
.panel { width: 100%; max-width: 480px; }

.step { animation: rise .3s var(--ease) both; }
.step-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.step h2 { font-size: 26px; }
.step .hint { margin: 6px 0 var(--sp-5); font-size: 15px; }

.actions { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-6); }
.save-hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: var(--sp-3); font-size: 12.5px; color: var(--text-3); }
.form-alert { margin-top: var(--sp-4); }

/* Welcome */
.welcome h1 { font-size: 34px; line-height: 1.1; margin: var(--sp-2) 0 var(--sp-3); }
.welcome h1 em { font-style: normal; color: var(--accent); }
.welcome .intro { color: var(--text-2); font-size: 16px; margin-bottom: var(--sp-5); }
.facts { list-style: none; margin: 0 0 var(--sp-6); padding: 0; border-top: 1px solid var(--line); }
.fact { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.fact-icon { width: 36px; height: 36px; flex: none; border-radius: var(--r); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.fact-text b { display: block; font-size: 14.5px; font-weight: 600; }
.fact-text span { display: block; font-size: 13.5px; color: var(--text-3); }
.welcome .actions { margin-top: 0; }
.fine-print { font-size: 12.5px; color: var(--text-3); margin-top: var(--sp-3); }
.aside-note { margin-top: var(--sp-4); font-size: 14px; color: var(--text-2); }

.more-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

/* Success + member card */
.success { text-align: center; }
.tick { width: 64px; height: 64px; margin: 0 auto var(--sp-4); }
.tick circle { fill: var(--ok-soft); }
.tick path { fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .15s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success h2 { font-size: 28px; }
.success .hint { max-width: 38ch; margin: var(--sp-2) auto 0; }
.member-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-6);
  max-width: 360px; aspect-ratio: 1.586; margin: var(--sp-6) auto var(--sp-4); padding: var(--sp-5); text-align: left;
  border-radius: var(--r-lg); background: var(--navy); color: var(--on-navy);
  border-top: 4px solid var(--accent-line);
}
.member-card .brand-name { font-size: 13px; }
.card-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-navy-2); }
.card-number { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: .04em; margin-top: 2px; }
.card-name { font-family: var(--display); font-size: 17px; font-weight: 600; margin-top: var(--sp-2); }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.success .btn { width: 100%; max-width: 360px; }

/* ---------- Upload, location, voice (used in the account) ---------- */

.dropzone {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: var(--sp-5) var(--sp-4); text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: var(--surface); cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.dz-title { font-weight: 600; font-size: 14.5px; }
.dz-sub { font-size: 13px; color: var(--text-3); }
.field.invalid .dropzone { border-color: var(--danger); }

.preview { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.preview img { width: 80px; height: 56px; flex: none; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); }
.preview-body { flex: 1; min-width: 0; }
.preview-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-status { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-3); }
.preview-status.ok { color: var(--ok); }
.bar { height: 3px; margin-top: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent-line); transition: width .2s; }

.locate {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: var(--sp-2) var(--sp-3); text-align: left;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer;
}
.locate:hover { border-color: var(--accent); }
.locate-icon { width: 36px; height: 36px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.locate b { display: block; font-size: 14.5px; font-weight: 600; }
.locate small { display: block; font-size: 12.5px; color: var(--text-3); }
.locate.set .locate-icon { background: var(--accent); color: #fff; }
.locate.busy .locate-icon svg { animation: spin 1s linear infinite; }
.map { height: 180px; margin-top: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; z-index: 0; }

.voice-q { display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.voice-q + .voice-q { margin-top: var(--sp-3); }
.voice-q h3 { font-size: 16px; line-height: 1.3; letter-spacing: -.01em; }
.field.invalid.voice-q { border-color: #E3A3A3; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; justify-self: start; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.tabs button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 20, 35, .1); }
.tabs .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-line); }
.counter { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); text-align: right; margin-top: 4px; }

.recorder { display: flex; align-items: center; gap: var(--sp-3); min-height: 64px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r); background: var(--surface-2); }
.rec-btn { position: relative; width: 48px; height: 48px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; }
.rec-btn.live { background: var(--danger); }
.rec-btn.live::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--danger); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { from { opacity: .7; transform: scale(.9); } to { opacity: 0; transform: scale(1.3); } }
.rec-body { flex: 1; min-width: 0; }
.rec-title { font-size: 14.5px; font-weight: 600; }
.rec-sub { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.wave { display: flex; align-items: center; gap: 2px; height: 24px; margin-top: 2px; }
.wave i { width: 3px; height: 4px; border-radius: 2px; background: var(--accent-line); }
.rec-actions { display: flex; gap: 6px; }

/* ---------- Member account ---------- */

.acct { max-width: 560px; margin: 0 auto; padding: var(--sp-4) var(--sp-4) calc(var(--sp-8) + env(safe-area-inset-bottom)); }
.acct-view { animation: rise .3s var(--ease) both; }

.signin { max-width: 400px; margin: 0 auto; padding: var(--sp-6) 0; }
.signin h1 { font-size: 28px; margin: var(--sp-2) 0 6px; }
.signin .hint { margin-bottom: var(--sp-5); }
.signin-foot { display: grid; gap: var(--sp-2); margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }

.hello { margin: var(--sp-2) 0 var(--sp-4); }
.hello h1 { font-size: 26px; margin-top: 2px; }

.mini-card { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4); margin-bottom: var(--sp-3); border-radius: var(--r-lg); background: var(--navy); color: var(--on-navy); border-top: 3px solid var(--accent-line); }
.mini-card .card-number { font-size: 17px; }

.completion { margin-bottom: var(--sp-3); }
.completion-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-2); font-size: 14px; }
.completion-h b { font-weight: 600; }
.completion-h span { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.completion .progress { border-radius: 3px; overflow: hidden; height: 6px; }

.cta { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-4); margin-bottom: var(--sp-5); border: 0; border-radius: var(--r-lg); background: var(--accent); color: #fff; text-align: left; cursor: pointer; }
.cta:hover { background: var(--accent-hover); }
.cta-icon { width: 40px; height: 40px; flex: none; border-radius: var(--r); display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.cta b { display: block; font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.cta small { display: block; font-size: 13.5px; color: #E3F2F8; }
.cta > svg { margin-left: auto; flex: none; }

.sec-title { margin: var(--sp-5) 0 var(--sp-2); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 60px; padding: 10px var(--sp-4); border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item.static { cursor: default; }
.item.static:hover { background: none; }
.item-icon { width: 36px; height: 36px; flex: none; border-radius: var(--r); display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.item.done .item-icon { background: var(--accent-soft); }
.item-body { flex: 1; min-width: 0; }
.item-body b { display: block; font-size: 14.5px; font-weight: 600; }
.item-body small { display: block; font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item > svg { flex: none; color: var(--text-3); }
.item.static .item-body small { white-space: normal; }

.timeline { display: grid; gap: var(--sp-2); }
.insight { display: grid; gap: var(--sp-2); }
.insight-date { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.insight h4 { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }
.insight p { font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.voice-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--accent); }
.empty-state { padding: var(--sp-5); text-align: center; font-size: 14px; color: var(--text-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }

/* ---------- Small screens: mobile is the primary audience ---------- */

@media (max-width: 959px) {
  .shell { grid-template-columns: 1fr; }
  .aside { display: none; }
  .main .topbar { display: flex; }
  .main .progress { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 19; }
  .stage { align-items: flex-start; padding: var(--sp-5) var(--sp-4) 0; }
  .step h2 { font-size: 23px; }
  .welcome h1 { font-size: 30px; }
  /* Primary action pinned within thumb reach */
  .actions {
    position: sticky; bottom: 0; z-index: 15; margin: var(--sp-5) calc(-1 * var(--sp-4)) 0;
    padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .actions .btn-primary { flex: 1; }
  .save-hint { margin-bottom: var(--sp-4); }
  .welcome { padding-bottom: var(--sp-4); }
  .success { padding: var(--sp-4) 0 var(--sp-8); }
}
/* Long option lists (education) become one full-width row each on phones */
@media (max-width: 560px) {
  .choices:not(.center) { grid-template-columns: 1fr; gap: 6px; }
}
