/* KYC widget. White-label: brands override --accent (and optionally --ink) via ?accent=HEX. */
:root {
  --canvas: #eef1f4;
  --surface: #ffffff;
  --ink: #18212b;
  --ink-soft: #55616e;
  --line: #d5dbe2;
  --accent: #0e7c66;
  --accent-ink: #ffffff;
  --warn: #a8510f;
  --error: #b42318;
  --ok: #0e7c66;
  --radius-sheet: 22px;
  --radius-control: 12px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0f151b;
    --surface: #18212b;
    --ink: #e8edf2;
    --ink-soft: #9aa7b4;
    --line: #2b3742;
    --accent: #2fb495;
    --accent-ink: #06231c;
    --warn: #e09653;
    --error: #f0786b;
    --ok: #2fb495;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0f151b; --surface: #18212b; --ink: #e8edf2; --ink-soft: #9aa7b4; --line: #2b3742;
  --accent: #2fb495; --accent-ink: #06231c; --warn: #e09653; --error: #f0786b; --ok: #2fb495; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

.sheet {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
@media (min-width: 600px) {
  body { padding: 40px 16px; }
  .sheet { min-height: 680px; border-radius: var(--radius-sheet); border: 1px solid var(--line); overflow: hidden; }
}

/* progress: the flow really is a sequence, so a segmented bar with the step name */
.progress { padding: 18px 20px 0; }
.progress-bar { display: flex; gap: 4px; }
.progress-bar span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .3s; }
.progress-bar span.done { background: var(--accent); }
.progress-bar span.now { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.progress-label { margin-top: 10px; font-size: 13px; color: var(--ink-soft); }

.body { flex: 1; padding: 22px 20px 20px; display: flex; flex-direction: column; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 650; margin: 0 0 10px; }
h2 { font-size: 19px; line-height: 1.3; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 14px; color: var(--ink-soft); max-width: 62ch; }
.spacer { flex: 1; }

.btn {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  min-height: 52px; padding: 0 18px; border-radius: var(--radius-control);
  background: var(--accent); color: var(--accent-ink);
  font: 600 16px/1 var(--font);
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn + .btn { margin-top: 10px; }
.link { background: none; border: 0; color: var(--accent); font: 500 15px var(--font); cursor: pointer; padding: 12px 0; text-align: center; width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

.choice { display: grid; gap: 10px; margin: 6px 0 18px; }
.choice button {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 16px; border-radius: var(--radius-control); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 16px var(--font); cursor: pointer;
}
.choice button:hover { border-color: var(--accent); }
.choice svg { flex: none; width: 34px; height: 34px; color: var(--accent); }
.choice small { display: block; color: var(--ink-soft); font-size: 13px; font-weight: 400; margin-top: 2px; }

.steps-list { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; gap: 12px; }
.steps-list li { display: flex; gap: 12px; align-items: baseline; }
.steps-list b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 13px; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); margin: 4px 0 18px; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.notice { border-radius: var(--radius-control); padding: 12px 14px; font-size: 14px; margin: 0 0 14px; }
.notice.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.notice.error { background: color-mix(in srgb, var(--error) 12%, transparent); color: var(--error); }
.notice ul { margin: 0; padding-left: 18px; }

/* ---------------------------------------------------------------- camera stage
   The one bold element: a full-bleed viewfinder whose frame reacts to the player. */
.stage {
  position: relative; margin: 0 -20px 16px; background: #0b1016; overflow: hidden;
  aspect-ratio: 3 / 4; max-height: 62dvh;
}
.stage video, .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage.selfie video { transform: scaleX(-1); } /* mirror preview only; frames sent raw */
.stage .mask { position: absolute; inset: 0; pointer-events: none; }
.frame {
  position: absolute; left: 7%; right: 7%; top: 50%; transform: translateY(-50%);
  aspect-ratio: 1.586; border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(8, 12, 17, .55);
}
.frame.passport { aspect-ratio: 1.42; }
.frame i { position: absolute; width: 28px; height: 28px; border: 4px solid #fff; transition: border-color .2s, inset .25s; }
.frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.frame.steady i { border-color: var(--accent); }

.oval {
  position: absolute; left: 50%; top: 46%; width: 62%; aspect-ratio: 0.78; transform: translate(-50%, -50%);
  border-radius: 50%; box-shadow: 0 0 0 100vmax rgba(8, 12, 17, .6);
}
.oval svg { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); overflow: visible; }
.oval .track { fill: none; stroke: rgba(255, 255, 255, .25); stroke-width: 5; }
.oval .arc { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .15s linear; }
.cue {
  position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #fff;
  font: 600 20px/1.3 var(--font); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); padding: 0 16px;
}
.cue small { display: block; font: 400 14px var(--font); opacity: .85; }
.arrow { position: absolute; top: 46%; width: 44px; height: 44px; transform: translateY(-50%); color: #fff; opacity: 0; transition: opacity .2s; }
.arrow.on { opacity: 1; }
.arrow.left { left: 6%; } .arrow.right { right: 6%; }

.shutter {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: 70px; height: 70px; border-radius: 50%; border: 4px solid #fff; background: rgba(255, 255, 255, .25); cursor: pointer;
}
.shutter::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.hint { position: absolute; top: 14px; left: 16px; right: 16px; color: #fff; text-align: center; font-size: 15px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }

.result-mark { width: 64px; height: 64px; margin: 18px 0 16px; color: var(--accent); }
.result-mark.warn { color: var(--warn); }
.result-mark.error { color: var(--error); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .progress-bar span, .frame i, .oval .arc { transition: none; }
}
.center { text-align: center; }
.file-pick { display: block; border: 1.5px dashed var(--line); border-radius: var(--radius-control); padding: 26px 16px; text-align: center; cursor: pointer; color: var(--ink-soft); margin-bottom: 14px; }
.file-pick:hover { border-color: var(--accent); color: var(--ink); }
.file-pick input { display: none; }
.thumb { width: 100%; border-radius: var(--radius-control); border: 1px solid var(--line); margin-bottom: 14px; display: block; }
.foot { font-size: 12px; color: var(--ink-soft); text-align: center; padding: 0 20px 16px; }

/* continue on phone */
.qr { width: 220px; max-width: 70%; margin: 6px auto 8px; padding: 10px; background: #fff; border-radius: 16px; border: 1px solid var(--line); }
.qr svg { display: block; width: 100%; height: auto; }
.small { font-size: 13px; }
.progress-list { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 10px; }
.progress-list li { display: flex; gap: 10px; align-items: center; color: var(--ink-soft); }
.progress-list i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.progress-list li.done { color: var(--ink); }
.progress-list li.done i { background: var(--accent); border-color: var(--accent); }
.progress-list li.done i::after { content: ""; width: 6px; height: 10px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: translate(0, -1px) rotate(45deg); }

/* brand header and language switch */
.brandbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px 0; min-height: 48px; }
.brandbar .logo { height: 28px; max-width: 160px; object-fit: contain; object-position: left center; display: block; }
.grow-x { flex: 1; }
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.langs button { border: 0; background: transparent; color: var(--ink-soft); font: 600 12px var(--font); padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.btn, .choice button, .notice, .thumb, .file-pick { border-radius: var(--radius-control); }
