/* NeuroSign MVP v2 prototype. Mockup for demos, not product code. */
:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #EDF1F7;
  --text: #0F1B2D;
  --muted: #475569;
  --border: #CBD5E1;
  --primary: #0B5BD3;
  --primary-ink: #FFFFFF;
  --primary-soft: #E3EEFF;
  --ok: #0A7A47;
  --ok-soft: #DDF4E8;
  --bad: #B3261E;
  --bad-soft: #FDE8E6;
  --warn: #7A4F00;
  --warn-soft: #FFF1D6;
  --stub: #5B3FB3;
  --stub-soft: #EEE8FB;
  --focus: #0B5BD3;
  --shadow: 0 1px 2px rgba(15,27,45,.06), 0 6px 20px rgba(15,27,45,.06);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220; --surface: #131C2E; --surface-2: #1B2740; --text: #E8EEF8; --muted: #A9B6CA;
    --border: #2C3B57; --primary: #7AB0FF; --primary-ink: #07111F; --primary-soft: #16294A;
    --ok: #4ADE9A; --ok-soft: #0F2C21; --bad: #FF8F86; --bad-soft: #35161A;
    --warn: #F5C26B; --warn-soft: #34290F; --stub: #B9A4FF; --stub-soft: #251D44; --focus: #7AB0FF;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0B1220; --surface: #131C2E; --surface-2: #1B2740; --text: #E8EEF8; --muted: #A9B6CA;
  --border: #2C3B57; --primary: #7AB0FF; --primary-ink: #07111F; --primary-soft: #16294A;
  --ok: #4ADE9A; --ok-soft: #0F2C21; --bad: #FF8F86; --bad-soft: #35161A;
  --warn: #F5C26B; --warn-soft: #34290F; --stub: #B9A4FF; --stub-soft: #251D44; --focus: #7AB0FF;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); }
code, .mono { font-family: var(--mono); font-size: .85em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--text); }
.brand svg { width: 26px; height: 26px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.tag.stub { background: var(--stub-soft); color: var(--stub); border-color: transparent; }
.tag.real { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.pilot { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.crumbs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.crumbs a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 500; min-height: 36px; display: inline-flex; align-items: center; }
.crumbs a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.icon-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; min-width: 44px; min-height: 44px; cursor: pointer; font: inherit; }

.banner { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--border); font-size: .875rem; }
.banner div { max-width: 1100px; margin: 0 auto; padding: 8px 16px; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.screen { display: none; }
.screen.active { display: block; }

/* generic components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } h1 { font-size: 1.5rem; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label.field { display: block; font-weight: 600; margin-bottom: 12px; }
label.field span.hint { font-weight: 400; color: var(--muted); display: block; font-size: .875rem; }
input[type=text], input[type=email], select, textarea { width: 100%; min-height: 44px; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.opt { flex-wrap: nowrap; align-items: flex-start; }
.row.opt input { flex: none; margin-top: 3px; }
.stack > * + * { margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.hash { font-family: var(--mono); font-size: .8rem; word-break: break-all; color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
@media (max-width: 600px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv dt { margin-top: 6px; font-size: .8rem; } }
.hr { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; font-size: .9rem; }

/* stepper */
.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.stepper li { flex: 1 1 120px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .875rem; color: var(--muted); }
.stepper li b { display: block; color: var(--text); }
.stepper li.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.stepper li.on b { color: var(--primary); }
.stepper li.done { border-color: var(--ok); }
.stepcount { font-weight: 700; color: var(--primary); }

/* upload dropzone */
.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; background: var(--surface); cursor: pointer; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop strong { display: block; margin-bottom: 4px; }

/* method tiles */
.tile { position: relative; display: flex; gap: 12px; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; align-items: flex-start; }
.tile:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.tile.locked { cursor: not-allowed; opacity: .75; }
.tile h3 { margin: 0 0 2px; font-size: 1rem; }
.tile p { margin: 0; font-size: .85rem; color: var(--muted); }
.tile .tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.policy { background: var(--primary-soft); border: 1px solid var(--primary); color: var(--text); border-radius: 10px; padding: 10px 14px; font-size: .9rem; }

/* document preview */
.doc { background: #fff; color: #1b1b1b; border: 1px solid var(--border); border-radius: 6px; padding: 28px 30px; position: relative; font-family: Georgia, "Times New Roman", serif; font-size: .88rem; line-height: 1.55; box-shadow: var(--shadow); }
.doc h4 { font-family: var(--font); margin: 0 0 8px; font-size: 1rem; text-align: center; letter-spacing: .02em; }
.doc p { margin: 0 0 8px; }
.doc .sigline { margin-top: 20px; height: 56px; border-bottom: 1px solid #555; position: relative; }
.sigfield { position: absolute; width: 190px; height: 54px; border: 2px dashed #0B5BD3; background: rgba(11,91,211,.10); color: #0B5BD3; font-family: var(--font); font-weight: 700; font-size: .78rem; display: flex; align-items: center; justify-content: center; border-radius: 6px; transform: translate(-50%, -50%); pointer-events: none; text-align: center; }
.sigfield.signed { border-style: solid; background: rgba(10,122,71,.10); color: #0A7A47; border-color: #0A7A47; font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.15rem; }
.doc-click { cursor: crosshair; }

/* phone frame */
.stage { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .stage { grid-template-columns: minmax(0, 1fr); } }
.phone { width: 390px; max-width: 100%; margin: 0 auto; background: var(--surface); border: 10px solid #1d2535; border-radius: 40px; overflow: hidden; min-height: 780px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
:root[data-theme="dark"] .phone { border-color: #3a4766; }
@media (max-width: 430px) { .phone { border: 0; border-radius: 0; box-shadow: none; min-height: 0; } }
.phone-top { padding: 14px 18px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.phone-top .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: var(--primary-ink); font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
.phone-body { padding: 16px 18px 22px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.phone-body .doc { padding: 16px 16px; font-size: .78rem; max-height: 250px; overflow: auto; }
.progress3 { display: flex; gap: 6px; }
.progress3 i { flex: 1; height: 6px; border-radius: 4px; background: var(--border); }
.progress3 i.on { background: var(--primary); }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: .9rem; min-height: 56px; cursor: pointer; }

/* camera simulation */
.camera { position: relative; aspect-ratio: 3 / 4; background: radial-gradient(circle at 50% 40%, #2b3550, #0b1020 70%); border-radius: 16px; overflow: hidden; display: grid; place-items: center; }
.camera .oval { width: 62%; aspect-ratio: 3 / 4; border: 4px solid rgba(255,255,255,.85); border-radius: 50%; position: relative; }
.camera .oval::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 4px solid transparent; border-top-color: #4ADE9A; animation: spin 1.4s linear infinite; }
.camera.done .oval { border-color: #4ADE9A; } .camera.done .oval::after { display: none; }
.camera.bad .oval { border-color: #FF8F86; } .camera.bad .oval::after { display: none; }
.camera .face { position: absolute; width: 36%; height: 40%; top: 28%; left: 32%; border-radius: 45% 45% 50% 50%; background: rgba(255,255,255,.14); transition: transform .8s ease; }
.camera.turn .face { transform: translateX(10%) rotate(6deg); }
.camera .badge { position: absolute; top: 10px; left: 10px; }
.camera .prompt { position: absolute; bottom: 14px; left: 14px; right: 14px; text-align: center; color: #fff; background: rgba(0,0,0,.55); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .camera .oval::after { animation: none; } .camera .face { transition: none; } * { scroll-behavior: auto !important; } }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.checks li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.checks li.ok { color: var(--ok); font-weight: 600; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.checks li.ok .dot { background: var(--ok); border-color: var(--ok); }

.result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 8px auto; }
.result-icon.ok { background: var(--ok-soft); color: var(--ok); }
.result-icon.bad { background: var(--bad-soft); color: var(--bad); }
.result-icon.warn { background: var(--warn-soft); color: var(--warn); }
.result-icon svg { width: 34px; height: 34px; }
.center { text-align: center; }
.metrics { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; font-size: .78rem; color: var(--muted); }
.metrics b { display: block; font-size: 1.15rem; color: var(--text); }

/* verification checks */
.vcheck { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.vcheck .st { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 800; }
.vcheck.pass { border-color: var(--ok); } .vcheck.pass .st { background: var(--ok-soft); color: var(--ok); }
.vcheck.fail { border-color: var(--bad); } .vcheck.fail .st { background: var(--bad-soft); color: var(--bad); }
.vcheck h3 { margin: 0; font-size: 1rem; } .vcheck p { margin: 2px 0 0; font-size: .875rem; color: var(--muted); }
.verdict { padding: 16px; border-radius: var(--radius); border: 2px solid var(--border); font-weight: 700; font-size: 1.1rem; background: var(--surface); }
.verdict.pass { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.verdict.fail { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }

/* comparison table */
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
tr.us td { background: var(--ok-soft); font-weight: 700; }
.tablewrap { overflow-x: auto; }

/* certificate */
.cert { max-width: 820px; margin: 0 auto; }
.cert h2 { border-bottom: 2px solid var(--primary); padding-bottom: 8px; }
.cert section { margin-top: 18px; }
.cert section h3 { color: var(--primary); text-transform: uppercase; font-size: .78rem; letter-spacing: .08em; margin-bottom: 8px; }
.stamp { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 6px; font-size: .78rem; font-weight: 700; }
.stamp.ok { background: var(--ok-soft); color: var(--ok); }
.stamp.stub { background: var(--stub-soft); color: var(--stub); }
.foot { border-top: 1px solid var(--border); margin-top: 32px; color: var(--muted); font-size: .8rem; }
.foot div { max-width: 1100px; margin: 0 auto; padding: 14px 16px; }
.stamp.warn { background: var(--warn-soft); color: var(--warn); }
@media print { .topbar, .noprint, .crumbs { display: none !important; } .banner { display: block !important; background: #fff; color: #000; border: 1px solid #000; } body { background: #fff; } .card { box-shadow: none; } }

/* optional live widget (NV KYC widget) */
.engine-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .875rem; font-weight: 600; }
.live-mount { position: relative; height: 560px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.live-log { margin: 0; padding: 8px 10px; max-height: 120px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: .72rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); }
