/* Client registration app. Palette and type follow landing.html so the two
   read as one site. */
:root {
  --grad: linear-gradient(135deg, #4f8dff 0%, #22d3ee 100%);
  --grad-text: linear-gradient(100deg, #6ea3ff, #33e0f5);
  --ink: #eaf1ff;
  --ink-soft: #b9c9e4;
  --ink-faint: #8fa6c8;
  --ground: #050810;
  --panel: rgba(255, 255, 255, .035);
  --field: rgba(255, 255, 255, .06);
  --line: rgba(127, 176, 255, .16);
  --line-strong: rgba(127, 176, 255, .34);
  --accent: #7fb0ff;
  --ok: #34d399;
  --error: #f87171;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 16px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding-inline: 20px; }

/* header / footer */
.site-head { position: sticky; top: 0; z-index: 10; background: rgba(5, 8, 16, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 12px; padding-block: 12px; flex-wrap: wrap; }
.lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--grad); }
.mark svg { width: 21px; height: 21px; }
.wordmark { font-size: 18px; font-weight: 600; white-space: nowrap; }
.wordmark em { font-style: normal; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.head-spacer { flex: 1; }
.who { color: var(--ink-faint); font-size: 14px; }
.site-foot { border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 14px; padding-block: 24px; margin-top: 48px; }

/* type */
.page { padding-block: 40px 20px; }
h1 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.15; font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.eyebrow { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 12px; }
.lead { color: var(--ink-soft); font-size: 17px; max-width: 70ch; margin: 0 0 24px; }
.muted { color: var(--ink-faint); font-size: 14px; }
.narrow { max-width: 620px; }

/* buttons */
.button {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink);
}
.button-primary { background: var(--grad); color: #04121f; }
.button-ghost { background: var(--panel); border: 1px solid var(--line-strong); }
.button-ghost:hover { background: rgba(255, 255, 255, .08); }
.button-danger { background: rgba(248, 113, 113, .15); border: 1px solid var(--error); color: #fecaca; }
form.inline { display: inline; margin: 0; }

/* cards and forms */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.form { display: grid; gap: 14px; align-content: start; }
.form > .button { justify-self: start; }
.form label, .filters label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.opt { font-weight: 400; color: var(--ink-faint); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 72px; }
select option { background: #0c1424; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { width: auto; margin-top: 5px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.flash { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; border: 1px solid; }
.flash-ok { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .5); }
.flash-error { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .5); }

/* questionnaire */
.progress { display: grid; gap: 10px; }
progress { width: 100%; height: 8px; accent-color: #4f8dff; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.toc a { font-size: 13px; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }
.toc a:hover { border-color: var(--line-strong); color: var(--ink); }
fieldset.card { margin-inline: 0; scroll-margin-top: 80px; }
legend { font-size: 20px; font-weight: 600; padding: 0 6px; }
.q { margin-top: 18px; }
.q label { font-weight: 600; display: block; }
.qid, .pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(127, 176, 255, .14); color: var(--accent); margin-right: 4px; }
.why { color: var(--ink-faint); font-size: 13px; margin: 2px 0 8px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.questionnaire .actions { position: sticky; bottom: 12px; background: rgba(12, 20, 36, .95); }

/* admin */
.filters { display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
.table-wrap { overflow-x: auto; padding: 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-faint); font-weight: 600; font-size: 13px; }
.pill-submitted { background: rgba(52, 211, 153, .15); color: var(--ok); }
.pill-draft { background: rgba(255, 255, 255, .08); color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; }
.facts dt { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.answers dl { margin: 0; }
.answers dt { font-weight: 600; margin-top: 14px; }
.answers dd { margin: 4px 0 0; color: var(--ink-soft); white-space: normal; }
.answers dd.empty { color: var(--ink-faint); font-style: italic; }
.lead-form { max-width: 620px; }
.danger { border-color: rgba(248, 113, 113, .4); max-width: 620px; }

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr; }
}

/* account page */
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 16px; }
.grid-2 .card { margin-bottom: 0; }
.narrow-form { max-width: 620px; }
.invite-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.invite-form h3 { margin: 0; font-size: 16px; }
.row-actions { white-space: nowrap; text-align: right; }
.link-button { appearance: none; background: none; border: 0; padding: 0 4px; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger-text { color: var(--error); }
.by { color: var(--accent); margin-left: 6px; }
.small { font-size: 13px; }
.link-card { border-color: rgba(52, 211, 153, .45); display: grid; gap: 8px; }
.link-card p { margin: 0; }
.copy-field { font-family: Consolas, "SFMono-Regular", monospace; font-size: 13px; }
code, .code { font-family: Consolas, "SFMono-Regular", monospace; font-size: 14px; }
.code { background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; }

/* guided questionnaire (wizard) */
.wizard-page .page { padding-top: 24px; }
.wz { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.wz-rail { position: sticky; top: 84px; display: grid; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.wz-meter { display: flex; gap: 14px; align-items: center; }
.wz-ring-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.wz-ring { width: 72px; height: 72px; transform: rotate(-90deg); }
.wz-ring circle { fill: none; stroke-width: 7; }
.wz-ring-bg { stroke: rgba(127, 176, 255, .15); }
.wz-ring-fg { stroke: #33c6f0; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.wz-pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.wz-saved { color: var(--ok); }
.wz-saved.pulse { animation: wz-pulse .9s ease; }
@keyframes wz-pulse { 0% { opacity: .3; } 100% { opacity: 1; } }
.wz-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wz-step button { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--ink-soft); font: inherit; font-size: 14px; padding: 7px 8px; border-radius: 10px; cursor: pointer; text-align: left; }
.wz-step button:hover { background: rgba(255, 255, 255, .05); color: var(--ink); }
.wz-step .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; border: 1px solid var(--line-strong); flex: none; }
.wz-step .label { flex: 1; }
.wz-step .count { font-size: 12px; color: var(--ink-faint); }
.wz-step.current button { background: rgba(79, 141, 255, .12); color: var(--ink); }
.wz-step.current .dot { border-color: #4f8dff; color: #9cc2ff; }
.wz-step.started .dot { border-color: #33c6f0; }
.wz-step.done .dot { background: var(--grad); border-color: transparent; color: #04121f; }
.wz-team { display: grid; gap: 8px; }
.wz-avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: rgba(127, 176, 255, .18); color: var(--ink); border: 1px solid var(--line-strong); }
.avatar.invited { opacity: .45; border-style: dashed; }
.wz-links { display: grid; gap: 6px; justify-items: start; }
.wz-links .link-button { padding: 0; }

.wz-stage { min-height: 60vh; display: flex; flex-direction: column; gap: 14px; }
.wz-thread { display: flex; flex-direction: column; gap: 12px; }
.wz-msg { display: flex; gap: 12px; align-items: flex-end; animation: wz-in .35s ease both; }
.wz-msg.me { justify-content: flex-end; }
@keyframes wz-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wz-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 20px -10px rgba(56, 132, 255, .9); }
.wz-eye { width: 16px; height: 16px; border-radius: 50%; background: #04121f; box-shadow: inset 0 0 0 4px #bfe9ff; animation: wz-blink 5s infinite; }
@keyframes wz-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.wz-bubble { max-width: 640px; background: rgba(255, 255, 255, .055); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 12px 16px; }
.wz-bubble p { margin: 0 0 6px; }
.wz-bubble p:last-child { margin-bottom: 0; }
.wz-bubble.big { font-size: 17px; padding: 16px 20px; }
.wz-bubble h2 { margin: 2px 0 6px; font-size: 20px; }
.wz-bubble .eyebrow { margin: 0; }
.wz-msg.me .wz-bubble { background: rgba(79, 141, 255, .16); border-color: rgba(79, 141, 255, .4); border-radius: 18px 18px 6px 18px; text-align: right; }
.wz-msg.quiet .wz-bubble { color: var(--ink-soft); }
.wz-msg.quiet .wz-avatar { opacity: .55; }
.wz-question { font-size: 18px; font-weight: 600; color: var(--ink); }
.wz-answer { white-space: pre-line; overflow-wrap: anywhere; }
.wz-note { color: var(--accent); font-size: 14px; }
.wz-why summary { cursor: pointer; color: var(--ink-faint); font-size: 13px; margin-top: 6px; }
.wz-why p { color: var(--ink-faint); font-size: 14px; margin-top: 4px; }
.typing .dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: wz-dot 1s infinite ease-in-out; }
.typing .dots i:nth-child(2) { animation-delay: .15s; }
.typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes wz-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.wz-composer { display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-left: 50px; }
.wz-composer:empty { display: none; }
.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { appearance: none; font: inherit; font-size: 14px; color: var(--ink); background: rgba(255, 255, 255, .05); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.chip:hover { background: rgba(255, 255, 255, .09); }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #04121f; font-weight: 600; }
.wz-input { min-height: 56px; }
.wz-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.wz-actions .head-spacer { flex: 1; }
.hint { text-align: right; }

.wz-milestone { text-align: center; padding: 24px 12px 8px; animation: wz-in .4s ease both; }
.wz-milestone h2 { margin: 12px 0 4px; font-size: 24px; }
.wz-check { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #04121f; background: var(--grad); animation: wz-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.wz-check.big { width: 88px; height: 88px; font-size: 42px; }
@keyframes wz-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wz-review-card h3 { margin: 0 0 6px; font-size: 17px; }
.wz-review { margin: 0; }
.wz-review dt { font-weight: 600; margin-top: 12px; font-size: 14px; }
.wz-review dd { margin: 4px 0 0; display: flex; gap: 10px; justify-content: space-between; align-items: baseline; color: var(--ink-soft); }
.wz-review dd.empty .wz-answer { color: var(--ink-faint); font-style: italic; }
.wz-next { margin: 6px 0 8px; padding-left: 20px; }
.wz-confetti { position: relative; height: 0; }
.wz-confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; background: hsl(var(--hue), 90%, 65%); animation: wz-fall 1.8s ease-in forwards; opacity: 0; }
@keyframes wz-fall { 0% { transform: translateY(-20px) rotate(0); opacity: 1; } 100% { transform: translateY(260px) rotate(540deg); opacity: 0; } }
.wz-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #0f1b31; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 16px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50; }
.wz-toast.show { opacity: 1; transform: translate(-50%, 0); }
.wz-toast.error { border-color: var(--error); }

@media (max-width: 860px) {
  .wz { grid-template-columns: 1fr; gap: 16px; }
  .wz-rail { position: static; padding: 14px; gap: 12px; }
  .wz-team { display: none; }
  .wz-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .wz-steps { display: flex; flex-wrap: wrap; gap: 2px; }
  .wz-step button { padding: 4px; }
  .wz-step .label, .wz-step .count { display: none; }
  .wz-composer { margin-left: 0; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wz-msg, .wz-milestone, .wz-check, .wz-eye, .typing .dots i, .wz-confetti i { animation: none !important; }
}

/* printable view: plain black on white, no chrome */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-head, .site-foot, .actions, .lead-form, .danger, .toc { display: none !important; }
  .card { border: 1px solid #bbb; background: #fff; break-inside: avoid; }
  .answers dd, .muted, .facts dt, .eyebrow { color: #333; }
  a { color: #000; }
  .qid { background: #eee; color: #000; }
}
