/* BlinkVerify — Scandinavian, mobile-first, zero-scroll */

:root {
  --bg: #ffffff;          /* white */
  --surface: #fdfcfa;
  --sunk: #eeebe5;        /* oat */
  --line: #e2ded6;
  --text: #1e211f;
  --muted: #767b76;
  --accent: #2f4a40;      /* pine */
  --accent-ink: #f6f4f0;
  --accent-soft: #dfe6e1;
  --ok: #4d7a63;
  --error: #a8473a;       /* muted brick */
  --r: 14px;
  --gutter: 20px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151715;
    --surface: #1c1f1c;
    --sunk: #232723;
    --line: #2e332f;
    --text: #ebe8e2;
    --muted: #8f958f;
    --accent: #a9c2b4;
    --accent-ink: #151715;
    --accent-soft: #26322c;
    --ok: #8fb7a0;
    --error: #d48a7d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font: 400 16px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
b { font-weight: 600; }

/* ---------- Shell: always exactly one viewport ---------- */
.app {
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
}
@media (min-width: 600px) and (min-height: 760px) {
  body { display: grid; place-items: center; }
  .app { width: 400px; height: min(820px, calc(100dvh - 64px)); background: #ffffff;
    border: 1px solid var(--line); border-radius: 36px; padding: 6px 0 4px; }
  body { background: #c2c7cd; }
}
/* In dark mode the frame stays dark: the text there is light and would vanish on white */
@media (min-width: 600px) and (min-height: 760px) and (prefers-color-scheme: dark) {
  .app { background: var(--bg); }
  body { background: var(--sunk); }   /* dark surround for the dark frame */
}

/* ---------- Top bar + progress ---------- */
.topbar { flex: none; height: 52px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 0 8px; }
.brand { grid-column: 2; grid-row: 1; text-align: center; font-weight: 200; font-size: 15px; letter-spacing: .02em;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the registered-trademark sign: small and raised, without pushing the line taller */
.brand .reg { font-size: .6em; font-weight: 400; vertical-align: .55em; line-height: 0; margin-left: 1px; }
/* held back for a moment on arrival, so the name does not visibly change when another website sent the visitor */
.brand.pending { visibility: hidden; }
.topbar.stepping .brand { display: none; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.icon-btn:active { background: var(--sunk); }
.icon-btn.light { color: #fff; background: rgba(0, 0, 0, .3); }
/* Back chevron: standard iOS navigation-bar size (12 × 21 pt glyph, 44 pt touch target) */
#backBtn { grid-column: 1; grid-row: 1; color: var(--accent); justify-items: start; padding: 0 0 0 12px; border-radius: 10px; }
#backBtn svg { width: 12px; height: 21px; stroke-width: 2.4; }

/* Progress: one thin line beside the chevron */
.progress { grid-column: 2; grid-row: 1; height: 2px; margin: 0 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 2px; background: var(--accent); transition: width .45s cubic-bezier(.2, .7, .2, 1); }
.progress.hidden { display: none; }

/* ---------- Screens ---------- */
main { flex: 1; min-height: 0; position: relative; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; padding: clamp(16px, 4dvh, 36px) var(--gutter) 0; }
.screen.active { display: flex; animation: in .35s cubic-bezier(.2, .7, .2, 1); }
.screen.back { animation-name: inBack; }
@keyframes in { from { opacity: 0; transform: translateX(10px); } }
@keyframes inBack { from { opacity: 0; transform: translateX(-10px); } }

.body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.body.center { justify-content: center; text-align: center; align-items: center; }
.group { display: flex; flex-direction: column; }
.fill { flex: 1; min-height: 0; display: grid; place-items: center; }

h1 { font-size: clamp(26px, 4dvh, 32px); font-weight: 500; line-height: 1.15; letter-spacing: -.025em; margin: 0 0 10px; }
h2 { font-size: clamp(22px, 3.4dvh, 28px); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0 0 clamp(14px, 3dvh, 28px); max-width: 34ch; }
.body.center .lede { margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; margin: 4px 0 0; }
.note { color: var(--muted); font-size: 13px; margin: auto 0 0; padding-top: 12px; }

.mark { width: 106px; height: 106px; border-radius: 50%; display: grid; place-items: center; margin-bottom: clamp(16px, 3dvh, 28px);
  background: #ff0000; color: #ffffff; }
.mark svg { width: 49px; height: 49px; }
.mark.done { animation: settle .6s cubic-bezier(.2, 1.4, .4, 1); }

/* Opening screen: the mark plays a 10-second loop of the four steps, then "verified":
   1 the mobile buzzes and its six-digit code arrives, 2 a face is framed, rolls and is scanned, 3 the ID flips over
   and is written in, 4 the payment card slides in, 5 the shield draws itself, fills and is ticked.
   A ring of four parts fills in as each step passes.
   Without animation (reduced-motion setting) only the finished shield and tick are shown. */
.mark.identity { position: relative; animation: mkBeat 10s ease-in-out infinite; }
.mark.identity .mk-stage { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.mark.identity .mk { position: absolute; inset: 0; margin: auto; }
.mark.identity .mk * { transform-box: fill-box; transform-origin: center; }
.mark.identity .mk-phone, .mark.identity .mk-face, .mark.identity .mk-id, .mark.identity .mk-card, .mark.identity .mk-sparks { opacity: 0; }
/* each step makes the whole mark pulse a little; the shield makes it jump */
@keyframes mkBeat { 0%, 14.5% { transform: none; } 16% { transform: scale(1.045); } 18%, 31.500% { transform: none; } 33% { transform: scale(1.045); }
  35%, 48.500% { transform: none; } 50% { transform: scale(1.045); } 52%, 65.500% { transform: none; } 67% { transform: scale(1.045); }
  69%, 71% { transform: none; } 74.500% { transform: scale(1.11); } 77% { transform: scale(.98); } 79.500%, 100% { transform: none; } }

/* the ring */
.mark.identity .mk-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.mark.identity .mk-ring circle { stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 21 79; }
.mark.identity .mk-ring .s1 { stroke-dashoffset: -2; animation: mkSeg1 10s ease-out infinite; }
.mark.identity .mk-ring .s2 { stroke-dashoffset: -27; animation: mkSeg2 10s ease-out infinite; }
.mark.identity .mk-ring .s3 { stroke-dashoffset: -52; animation: mkSeg3 10s ease-out infinite; }
.mark.identity .mk-ring .s4 { stroke-dashoffset: -77; animation: mkSeg4 10s ease-out infinite; }
@keyframes mkSeg1 { 0%, 12% { stroke-dasharray: 0 100; opacity: 0; } 12.5% { stroke-dasharray: 0 100; opacity: 1; } 16%, 72% { stroke-dasharray: 21 79; opacity: 1; } 75% { stroke-dasharray: 21 79; opacity: 1; stroke-width: 5; } 79%, 96% { stroke-dasharray: 21 79; opacity: 1; stroke-width: 2.6; } 100% { stroke-dasharray: 21 79; opacity: 0; } }
@keyframes mkSeg2 { 0%, 29% { stroke-dasharray: 0 100; opacity: 0; } 29.5% { stroke-dasharray: 0 100; opacity: 1; } 33%, 72% { stroke-dasharray: 21 79; opacity: 1; } 75% { stroke-dasharray: 21 79; opacity: 1; stroke-width: 5; } 79%, 96% { stroke-dasharray: 21 79; opacity: 1; stroke-width: 2.6; } 100% { stroke-dasharray: 21 79; opacity: 0; } }
@keyframes mkSeg3 { 0%, 46% { stroke-dasharray: 0 100; opacity: 0; } 46.5% { stroke-dasharray: 0 100; opacity: 1; } 50%, 72% { stroke-dasharray: 21 79; opacity: 1; } 75% { stroke-dasharray: 21 79; opacity: 1; stroke-width: 5; } 79%, 96% { stroke-dasharray: 21 79; opacity: 1; stroke-width: 2.6; } 100% { stroke-dasharray: 21 79; opacity: 0; } }
@keyframes mkSeg4 { 0%, 63% { stroke-dasharray: 0 100; opacity: 0; } 63.5% { stroke-dasharray: 0 100; opacity: 1; } 67%, 72% { stroke-dasharray: 21 79; opacity: 1; } 75% { stroke-dasharray: 21 79; opacity: 1; stroke-width: 5; } 79%, 96% { stroke-dasharray: 21 79; opacity: 1; stroke-width: 2.6; } 100% { stroke-dasharray: 21 79; opacity: 0; } }

/* 1. the mobile rises, buzzes, and the code's six digits pop in */
.mark.identity .mk-phone { animation: mkPhone 10s ease-in-out infinite; }
@keyframes mkPhone { 0% { opacity: 0; transform: translateY(70%) rotate(-14deg); animation-timing-function: cubic-bezier(.2, 1.5, .4, 1); }
  4.500% { opacity: 1; transform: none; } 5.500% { opacity: 1; transform: rotate(9deg); } 6.500% { transform: rotate(-8deg); } 7.500% { transform: rotate(6deg); }
  8.500% { transform: rotate(-4deg); } 9.500%, 15.500% { opacity: 1; transform: none; } 19%, 100% { opacity: 0; transform: translateY(-70%) scale(.7); } }
.mark.identity .mk-digits circle { fill: currentColor; stroke: none; }
.mark.identity .mk-digits circle:nth-child(1) { animation: mkDigit1 10s ease-out infinite; }
@keyframes mkDigit1 { 0%, 9.5% { transform: scale(0); } 11% { transform: scale(1.7); } 12.5%, 19% { transform: none; } 19.1%, 100% { transform: scale(0); } }
.mark.identity .mk-digits circle:nth-child(2) { animation: mkDigit2 10s ease-out infinite; }
@keyframes mkDigit2 { 0%, 10.4% { transform: scale(0); } 11.9% { transform: scale(1.7); } 13.4%, 19% { transform: none; } 19.1%, 100% { transform: scale(0); } }
.mark.identity .mk-digits circle:nth-child(3) { animation: mkDigit3 10s ease-out infinite; }
@keyframes mkDigit3 { 0%, 11.3% { transform: scale(0); } 12.8% { transform: scale(1.7); } 14.3%, 19% { transform: none; } 19.1%, 100% { transform: scale(0); } }
.mark.identity .mk-digits circle:nth-child(4) { animation: mkDigit4 10s ease-out infinite; }
@keyframes mkDigit4 { 0%, 12.2% { transform: scale(0); } 13.7% { transform: scale(1.7); } 15.2%, 19% { transform: none; } 19.1%, 100% { transform: scale(0); } }
.mark.identity .mk-digits circle:nth-child(5) { animation: mkDigit5 10s ease-out infinite; }
@keyframes mkDigit5 { 0%, 13.1% { transform: scale(0); } 14.6% { transform: scale(1.7); } 16.1%, 19% { transform: none; } 19.1%, 100% { transform: scale(0); } }
.mark.identity .mk-digits circle:nth-child(6) { animation: mkDigit6 10s ease-out infinite; }
@keyframes mkDigit6 { 0%, 14% { transform: scale(0); } 15.5% { transform: scale(1.7); } 17%, 19% { transform: none; } 19.1%, 100% { transform: scale(0); } }

/* 2. the face: the frame snaps on from outside, the head rolls side to side, a line scans down it */
.mark.identity .mk-face { animation: mkFace 10s ease-in-out infinite; }
@keyframes mkFace { 0%, 17% { opacity: 0; transform: scale(1.9); animation-timing-function: cubic-bezier(.2, 1.5, .4, 1); } 22%, 32% { opacity: 1; transform: none; }
  36%, 100% { opacity: 0; transform: scale(.4) rotate(-30deg); } }
.mark.identity .mk-head { transform-origin: 50% 100%; animation: mkRoll 10s ease-in-out infinite; }
@keyframes mkRoll { 0%, 22% { transform: none; } 24% { transform: rotate(-17deg); } 26.3% { transform: rotate(17deg); } 28%, 100% { transform: none; } }
.mark.identity .mk-scan { opacity: 0; animation: mkScan 10s linear infinite; }
@keyframes mkScan { 0%, 27.5% { opacity: 0; transform: translateY(-6px); } 28.3% { opacity: .9; transform: translateY(-6px); } 31.8% { opacity: .9; transform: translateY(6.5px); }
  32.8%, 100% { opacity: 0; transform: translateY(6.5px); } }

/* 3. the ID flips over into view, the portrait pops, the details are written in; it tips away backwards */
.mark.identity .mk-id { animation: mkId 10s ease-in-out infinite; }
@keyframes mkId { 0%, 34% { opacity: 0; transform: perspective(160px) rotateY(-100deg); animation-timing-function: cubic-bezier(.2, 1.5, .4, 1); } 35% { opacity: 1; }
  40.500%, 49% { opacity: 1; transform: perspective(160px) rotateY(0); } 52% { opacity: 1; } 53%, 100% { opacity: 0; transform: perspective(160px) rotateX(95deg); } }
.mark.identity .mk-portrait { animation: mkPortrait 10s ease-out infinite; }
@keyframes mkPortrait { 0%, 39.500% { transform: scale(0); } 42% { transform: scale(1.3); } 43.500%, 100% { transform: none; } }
.mark.identity .mk-line { stroke-dasharray: 1; stroke-dashoffset: 0; }
.mark.identity .mk-id .mk-line { animation: mkWrite 10s ease-out infinite; }
@keyframes mkWrite { 0%, 41.500% { stroke-dashoffset: 1; } 45%, 100% { stroke-dashoffset: 0; } }

/* 4. the payment card swoops in from the right, the chip lands, the number is read; it is swiped away to the left */
.mark.identity .mk-card { animation: mkCard 10s ease-in-out infinite; }
@keyframes mkCard { 0%, 51.500% { opacity: 0; transform: translateX(95%) rotate(18deg); animation-timing-function: cubic-bezier(.2, 1.5, .4, 1); }
  57%, 65.500% { opacity: 1; transform: none; } 66.500% { opacity: 1; transform: translateX(6%) rotate(3deg); } 70%, 100% { opacity: 0; transform: translateX(-100%) rotate(-18deg); } }
.mark.identity .mk-chip { animation: mkChip 10s ease-out infinite; }
@keyframes mkChip { 0%, 56.500% { transform: scale(0) rotate(-45deg); } 59% { transform: scale(1.3); } 60.500%, 100% { transform: none; } }
.mark.identity .mk-card .mk-line { animation: mkRead 10s ease-out infinite; }
@keyframes mkRead { 0%, 58.500% { stroke-dashoffset: 1; } 61.500%, 100% { stroke-dashoffset: 0; } }
.mark.identity .mk-line.l2 { animation-delay: .13s; }
.mark.identity .mk-line.l3 { animation-delay: .26s; }
.mark.identity .mk-wave { animation: mkWave 10s ease-out infinite; }
.mark.identity .mk-wave.w2 { animation-delay: .14s; }
@keyframes mkWave { 0%, 60% { opacity: 0; transform: translateX(-2px); } 62% { opacity: 1; transform: none; } 63.500% { opacity: .35; } 65%, 100% { opacity: 1; transform: none; } }

/* 5. verified: the shield spins up and draws itself, fills in, and the tick is struck through it; sparks fly, rings spread */
.mark.identity .mk-shield { animation: mkShield 10s ease-in-out infinite; }
@keyframes mkShield { 0%, 69.500% { opacity: 0; transform: scale(.25) rotate(-40deg); animation-timing-function: cubic-bezier(.2, 1.5, .4, 1); }
  76%, 96% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.6); } }
.mark.identity .mk-draw, .mark.identity .mk-tick { stroke-dasharray: 1; stroke-dashoffset: 0; }
.mark.identity .mk-draw { fill: currentColor; animation: mkDraw 10s ease-in-out infinite; }
.mark.identity .mk-tick { stroke: #ff0000; stroke-width: 2.4; animation: mkTick 10s ease-out infinite; }
@keyframes mkDraw { 0%, 70% { stroke-dashoffset: 1; fill-opacity: 0; } 77.500% { stroke-dashoffset: 0; fill-opacity: 0; } 80.500%, 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
@keyframes mkTick { 0%, 80% { stroke-dashoffset: 1; } 84%, 100% { stroke-dashoffset: 0; } }
.mark.identity .mk-sparks { animation: mkSparksOn 10s linear infinite; }
@keyframes mkSparksOn { 0%, 79% { opacity: 0; } 80%, 100% { opacity: 1; } }
.mark.identity .mk-sparks path { stroke-width: 1.5; transform: scale(0); animation: mkSpark 10s ease-out infinite; }
.mark.identity .mk-sparks .k2 { animation-delay: .12s; }
.mark.identity .mk-sparks .k3 { animation-delay: .24s; }
.mark.identity .mk-sparks .k4 { animation-delay: .36s; }
@keyframes mkSpark { 0%, 82% { transform: scale(0) rotate(-90deg); } 85.500% { transform: scale(1.2) rotate(0); } 90%, 100% { transform: scale(0) rotate(90deg); } }
.mark.identity .mk-ripple { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #ff0000; opacity: 0; pointer-events: none; animation: mkRipple 10s ease-out infinite; }
.mark.identity .mk-ripple.r2 { animation-delay: .28s; }
@keyframes mkRipple { 0%, 73.500% { opacity: 0; transform: none; } 74% { opacity: .6; transform: none; } 84%, 100% { opacity: 0; transform: scale(1.6); } }
@keyframes settle { from { transform: scale(.6); opacity: 0; } }

.steps-list { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 300px; text-align: left; border-top: 1px solid var(--line); }
.steps-list li { display: flex; gap: 16px; align-items: baseline; padding: clamp(10px, 1.8dvh, 15px) 2px; border-bottom: 1px solid var(--line); }
.steps-list span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .05em; }

/* ---------- Actions (always pinned to the bottom) ---------- */
.actions { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 16px 0 clamp(16px, 3dvh, 28px); }
.actions.row { flex-direction: row; }
.btn { flex: 1; min-height: 60px; border-radius: 80px; border: 0; font: 500 16px var(--font); letter-spacing: .01em; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: opacity .2s, transform .1s, background .2s; }
.btn:active { transform: scale(.985); }
.btn.primary { background: #000000; color: #ffffff; }
@media (prefers-color-scheme: dark) { .btn.primary { box-shadow: inset 0 0 0 1px var(--line); } } /* keeps the black button visible on the dark background */
.btn.primary:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--sunk); color: var(--text); }
.btn.loading { pointer-events: none; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: 500 inherit/inherit var(--font); font-size: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.fineprint { margin: 0; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- Form fields ---------- */
.field { display: block; min-width: 0; }
.field > span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
input, select { font: inherit; color: var(--text); }
.field > input, .field > select, .phone-input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .2s; -webkit-appearance: none; appearance: none;
}
.field > select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767b76' stroke-width='1.5'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 32px; }
.field > input:focus, .field > select:focus, .phone-input:focus-within { border-color: var(--accent); }
/* Phone number: one quiet field. The dial code is plain text with a small chevron; the real menu sits invisibly on top of it. */
.phone-input { display: flex; align-items: center; height: 56px; padding: 0 6px 0 16px; border-radius: 80px; }
.phone-input .cc { position: relative; display: flex; align-items: center; gap: 2px; height: 100%; padding-right: 10px; color: var(--text); font-size: 18px; white-space: nowrap; }
.phone-input .cc svg { width: 16px; height: 16px; color: var(--muted); stroke-width: 1.6; }
.phone-input .cc select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; font-size: 16px; }
.phone-input .cc:focus-within { color: var(--accent); }
.phone-input input { flex: 1; min-width: 0; border: 0; height: 100%; padding: 0 10px 0 4px; background: transparent; outline: none; font-size: 18px; letter-spacing: .01em; }
.phone-input input::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.error { display: block; color: var(--error); font-size: 13px; font-style: normal; min-height: 18px; margin-top: 4px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: clamp(16px, 3dvh, 28px); }
.fields .full { grid-column: 1 / -1; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-top: 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* ---------- OTP ---------- */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { width: 100%; height: clamp(52px, 8dvh, 64px); text-align: center; font-size: 22px; font-weight: 500; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color .2s; }
.otp input:focus { border-color: var(--accent); }
.otp.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-2px); } }
.dev-hint { font-size: 13px; padding: 8px 12px; border-radius: 10px; background: var(--sunk); color: var(--muted); margin: 4px 0 0; }

/* ---------- Capture surfaces ---------- */
.capture-card { position: relative; border-radius: var(--r); background: var(--sunk); overflow: hidden; display: grid; place-items: center;
  cursor: pointer; transition: box-shadow .2s; outline: none; }
.capture-card::before { content: ""; position: absolute; inset: 8px; border: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent); border-radius: inherit; pointer-events: none; }
.capture-card:focus-visible, .capture-card:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.capture-card.has-image::before { display: none; }
.capture-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.capture-card .placeholder { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.capture-card .placeholder svg { width: 28px; height: 28px; color: var(--accent); }
.capture-card .placeholder b { font-weight: 500; color: var(--text); }
.ok-badge { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); color: var(--ok); display: grid; place-items: center; }
.ok-badge svg { width: 15px; height: 15px; stroke-width: 2; }

/* Face scan preview: a circle inside a ring of ticks; scales with available height */
.face-preview { position: relative; height: min(100%, 44dvh, 340px); aspect-ratio: 1; max-width: 100%; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring line { stroke: color-mix(in srgb, var(--muted) 35%, transparent); stroke-width: 1.3; stroke-linecap: round; transition: stroke .3s; }
.ring line.on { stroke: var(--accent); }
.capture-card.selfie { position: absolute; left: 13.64%; top: 13.64%; width: 72.73%; height: 72.73%; border-radius: 50%; }
.capture-card.selfie::before { display: none; }
.capture-card.selfie .placeholder svg { width: 52px; height: 52px; stroke-width: 1.2; }
.capture-card.selfie .ok-badge { top: auto; bottom: 8%; right: 50%; transform: translateX(50%); }
.note.center { text-align: center; }

/* ---------- Face scan overlay (always dark, like a camera) ---------- */
.facescan { position: fixed; inset: 0; z-index: 55; background: #151715; color: #ebe8e2; display: flex; flex-direction: column; align-items: center;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom); animation: fsIn .3s ease; }
@keyframes fsIn { from { opacity: 0; } }
.fs-top { align-self: stretch; height: 52px; display: flex; align-items: center; }
/* Same chevron as the back button on the step screens: 12 × 21, same weight, same position from the left edge */
.fs-cancel { display: flex; align-items: center; gap: 8px; min-height: 44px; background: none; border: 0; padding: 0 8px 0 0; color: #a9c2b4; font: 400 17px var(--font); cursor: pointer; }
.fs-cancel svg { width: 12px; height: 21px; stroke-width: 2.4; }
.fs-main { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(20px, 5dvh, 48px); padding-bottom: 56px; }
.fs-stage { position: relative; width: min(88vw, 54dvh, 420px); aspect-ratio: 1; }
.fs-stage video { position: absolute; left: 13.64%; top: 13.64%; width: 72.73%; height: 72.73%; border-radius: 50%; object-fit: cover; transform: scaleX(-1);
  background: #232723; opacity: 0; transition: opacity .5s; }
.fs-stage.ready video { opacity: 1; }
.fs-stage::after { content: ""; position: absolute; left: 13.64%; top: 13.64%; width: 72.73%; height: 72.73%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(235, 232, 226, .18); pointer-events: none; }
.fs-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 3px rgba(190, 240, 212, .55)); }
.fs-ring line { stroke: rgba(235, 232, 226, .2); stroke-width: 1.4; stroke-linecap: round; transition: stroke .25s; }
.fs-ring line.on { stroke: #dcfbe8; stroke-width: 1.7; }
/* Challenge: the part of the ring to move toward pulses until the movement is made */
.fs-ring line.want { stroke: #dcfbe8; stroke-width: 1.7; animation: fsWant .7s ease-in-out infinite alternate; }
@keyframes fsWant { from { opacity: .25; } to { opacity: 1; } }
.fs-check { position: absolute; left: 13.64%; top: 13.64%; width: 72.73%; height: 72.73%; border-radius: 50%; display: grid; place-items: center;
  background: rgba(21, 23, 21, .6); opacity: 0; transition: opacity .4s; }
.fs-check svg { width: 28%; height: 28%; stroke: #a9c2b4; stroke-width: 1.6; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .5s .25s; }
.fs-stage.complete .fs-check { opacity: 1; }
.fs-stage.complete .fs-check svg { stroke-dashoffset: 0; }
.fs-text { text-align: center; min-height: 64px; }
.fs-title { margin: 0 0 4px; font-size: clamp(19px, 2.8dvh, 22px); font-weight: 500; letter-spacing: -.01em; }
.fs-sub { margin: 0; color: #8f958f; font-size: 15px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.capture-card.doc { aspect-ratio: 1.586; }
/* Payment card: stacked and larger when height allows */
.pair.stacked { flex: 1; margin-bottom: 4px; min-height: 0; grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; justify-items: center; }
.pair.stacked .capture-card { height: 100%; max-height: 210px; max-width: 100%; }


/* ---------- Review ---------- */
.review { list-style: none; padding: 0; margin: 4px 0 0; border-top: 1px solid var(--line); }
.review li { display: flex; align-items: center; gap: 14px; padding: clamp(10px, 1.8dvh, 14px) 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.review li > div:not(.thumbs) { flex: 1; min-width: 0; }
.review small { display: block; color: var(--muted); font-size: 12px; letter-spacing: .03em; }
.review b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review .link { font-size: 14px; }
.rv-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; color: var(--muted); flex: none; }
.thumbs { display: flex; flex-direction: column; gap: 2px; width: 40px; flex: none; }
.thumb { width: 40px; height: 19px; object-fit: cover; border-radius: 3px; background: var(--sunk); display: block; }
.thumb.round { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.pill { font-size: 12px; color: var(--ok); }
.review + .check { margin-top: auto; padding-top: 12px; }

.ref { margin-top: 8px; padding: 12px 20px; border: 1px solid var(--line); border-radius: var(--r); }
.ref small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ref b { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 500; letter-spacing: .04em; }

/* ---------- Short screens: tighten so nothing ever scrolls ---------- */
@media (max-height: 700px) {
  .lede { font-size: 15px; }
  .field > input, .field > select { height: 46px; }
  .phone-input { height: 50px; }
  .btn { min-height: 60px; }
  .fields { gap: 8px; }
  .field > span { margin-bottom: 4px; }
}
@media (max-height: 620px) {
  .topbar { height: 44px; }
  .mark { display: none; }
  .note, .fineprint,   .error { min-height: 0; }
  .review li { min-height: 48px; padding: 6px 0; }
  .actions { padding-top: 10px; }
}

/* ---------- Camera ---------- */
.camera { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; overflow: hidden; }
/* The preview is magnified about the centre of the frame guide (see DOC_ZOOM in app.js) */
.camera video { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--zoom, 1)); transform-origin: 50% 45%; }
.camera video.mirror { transform: scaleX(-1) scale(var(--zoom, 1)); }
.cam-mask { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); box-shadow: 0 0 0 9999px rgba(10, 12, 10, .6); border: 1.5px solid rgba(255, 255, 255, .9); transition: border-color .2s, border-width .2s, width .3s, height .3s; }
.cam-mask.steady { border: 2.5px solid #dcfbe8; }
.cam-mask::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: -16px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #dcfbe8 calc(var(--hold, 0) * 100%), rgba(255, 255, 255, .22) 0); opacity: 0; transition: opacity .2s; }
.cam-mask.steady::after { opacity: 1; }
.cam-mask.flash-ok { border-color: #dcfbe8; }
.cam-mask.oval { width: min(66vw, 46dvh * .8, 300px); aspect-ratio: 4 / 5; border-radius: 50%; }
.cam-mask.doc { width: min(86vw, 520px); aspect-ratio: 1.586; border-radius: 14px; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; font-weight: 500; font-size: 15px; }
/* Confirmation shown in the middle of the capture frame after each photo */
.cam-done { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 12px 20px;
  border-radius: 999px; background: rgba(21, 23, 21, .82); color: #dcfbe8; font: 500 17px var(--font); white-space: nowrap; z-index: 2; }
.cam-done svg { width: 20px; height: 20px; stroke-width: 2; }
.cam-done.show { animation: camDone 1.2s ease both; }
@keyframes camDone { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.9); } 12%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
/* Camera instructions: what to show (above the frame) and what to do right now (just below it) */
.cam-label { position: absolute; left: 0; right: 0; bottom: calc(55% + min(86vw, 520px) / 1.586 / 2 + 18px); text-align: center; padding: 0 24px; }
.cam-label b { display: block; font-size: clamp(20px, 3dvh, 24px); font-weight: 500; letter-spacing: -.01em; }
.cam-label span { display: block; margin-top: 2px; font-size: 14px; color: rgba(255, 255, 255, .7); }
.cam-hint { position: absolute; left: 50%; top: calc(45% + min(86vw, 520px) / 1.586 / 2 + 34px); transform: translateX(-50%); margin: 0; padding: 9px 18px;
  width: max-content; max-width: 86vw; text-align: center; border-radius: 22px; background: rgba(21, 23, 21, .66); color: #fff; font: 500 17px/1.3 var(--font); }
.cam-hint:empty { display: none; }
.cam-auto { margin: 0 0 14px; font-size: 13px; color: rgba(255, 255, 255, .7); text-align: center; padding: 0 24px; }
.cam-bottom { position: absolute; bottom: 0; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; padding: 24px 0 calc(env(safe-area-inset-bottom) + 32px); }
.shutter { width: 72px; height: 72px; border-radius: 50%; border: 3px solid #fff; background: transparent; cursor: pointer; position: relative; }
.shutter::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; transition: transform .1s; }
.shutter:active::after { transform: scale(.88); }
.camera.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: flash .25s ease-out forwards; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 12px); transform: translate(-50%, -120px); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: transform .35s cubic-bezier(.2, .7, .2, 1); z-index: 60; max-width: calc(100vw - 32px); white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Message dialog ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px;
  background: rgba(21, 23, 21, .42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: modalFade .22s ease-out; }
.modal-card { width: 100%; max-width: 340px; padding: 30px 24px 20px; border-radius: 30px; background: var(--bg); color: var(--text); text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22), 0 0 0 1px color-mix(in srgb, var(--line) 60%, transparent); animation: modalRise .3s cubic-bezier(.2, .8, .2, 1); }
.modal-icon { width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; }
.modal-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.modal-card h3 { margin: 0 0 8px; font: 500 20px/1.25 var(--font); letter-spacing: -.01em; text-wrap: balance; }
.modal-card p { margin: 0 0 24px; color: var(--muted); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.modal-card .btn { flex: none; width: 100%; min-height: 52px; }
@keyframes modalFade { from { opacity: 0; } }
@keyframes modalRise { from { opacity: 0; transform: translateY(14px) scale(.96); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Diagnostic readout for auto-capture (only with ?debug=1) */
.cam-debug { position: absolute; left: 12px; top: calc(env(safe-area-inset-top) + 64px); margin: 0; padding: 8px 10px; border-radius: 8px;
  background: rgba(0, 0, 0, .6); color: #dcfbe8; font: 11px/1.5 ui-monospace, Menlo, monospace; pointer-events: none; }

/* Debug only (?debug=1): where the tracker thinks the card is */
.cam-card { position: absolute; border: 1px dashed #a9c2b4; pointer-events: none; opacity: 0; box-sizing: border-box; }
.cam-card.on { opacity: 1; }

/* ---------- Clear instructions ---------- */
.help { margin: 0; min-height: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.lede.tight { margin-bottom: 8px; }
.howto { list-style: none; counter-reset: how; margin: 0 0 clamp(8px, 2dvh, 16px); padding: 0; display: grid; gap: 6px; color: var(--muted); font-size: 15px; }
.howto li { counter-increment: how; position: relative; padding-left: 32px; }
.howto li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--sunk); color: var(--text); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.howto b { color: var(--text); font-weight: 600; }
.side-tag { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(21, 23, 21, .7); color: #fff; font-size: 12px; font-weight: 500; display: none; }
.capture-card.has-image .side-tag { display: block; }
@media (max-height: 620px) { .howto { font-size: 14px; gap: 3px; } .help { min-height: 0; } .cam-auto { display: none; } }

/* ---------- Keyboard open: the step is fitted into the space above the keys ---------- */
html.kb .app { height: var(--app-h); transform: translateY(var(--app-top, 0px)); padding-bottom: 0; }
html.kb .topbar { height: 44px; }
html.kb .screen { padding-top: 8px; }
html.kb .screen .body { overflow-y: auto; }              /* last resort on very small phones: never hide content */
html.kb #phoneEntry .lede { display: none; }             /* the heading already says what to do */
html.kb #otpEntry .lede { margin-bottom: 12px; }
html.kb .otp input { height: 50px; }
html.kb .actions { padding: 8px 0 10px; gap: 6px; }
html.kb .btn { min-height: 48px; }

/* ---------- Sample card shown before the camera is opened ---------- */
.doc-sample { flex: 1; min-height: 0; display: grid; place-items: center; padding: 4px 0; }
.sample-card { width: min(100%, 340px); height: auto; max-height: 100%; stroke: none; filter: drop-shadow(0 10px 22px rgba(30, 33, 31, .12)); }
.sample-card * { stroke: none; }
.sample-card .sc-body { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.sample-card .sc-band { fill: var(--accent); }
.sample-card .sc-title { fill: var(--accent-ink); font: 600 13px var(--font); letter-spacing: .08em; }
/* Sample ID: the title alternates between the two accepted documents, each fading up into place and out again.
   Without animation (reduced motion) only the first title shows. */
.sample-card .sc-swap { animation: scSwapA 6s ease-in-out infinite; }
.sample-card .sc-swap.alt { opacity: 0; animation-name: scSwapB; }
@keyframes scSwapA {
  0%, 42% { opacity: 1; transform: none; }
  50%, 91% { opacity: 0; transform: translateY(-5px); }
  92% { opacity: 0; transform: translateY(5px); }
  100% { opacity: 1; transform: none; }
}
@keyframes scSwapB {
  0%, 42% { opacity: 0; transform: translateY(5px); }
  50%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-5px); }
}
.sample-card .sc-photo { fill: var(--sunk); }
.sample-card .sc-face { fill: color-mix(in srgb, var(--muted) 45%, var(--sunk)); }
.sample-card .sc-line { fill: var(--line); }
.sample-card .sc-line.strong { fill: color-mix(in srgb, var(--muted) 55%, var(--line)); }
.sample-card .sc-sample { fill: var(--muted); font: 600 11px var(--font); letter-spacing: .16em; }
.sample-card .sc-dark { fill: #2f4a40; }
.sample-card .sc-chip { fill: #d8c48c; }
.sample-card .sc-dots circle { fill: rgba(255, 255, 255, .85); }
.sample-card .sc-light { fill: rgba(255, 255, 255, .55); }
.sample-card .sc-sample.light { fill: rgba(255, 255, 255, .7); }
