:root {
  --page: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --subtle: #86868b;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.14);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #e8f2ff;
  --green: #16803c;
  --green-soft: #eaf8ef;
  --amber: #9b6200;
  --amber-soft: #fff6df;
  --red: #c62828;
  --red-soft: #fff0f0;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.035);
  --radius: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -18%, rgba(0, 113, 227, 0.10), transparent 35rem),
    var(--page);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #fff;
  background: #000;
  border-radius: 10px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(18px, var(--safe-top)) 20px max(18px, var(--safe-bottom));
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1040px);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand b { color: var(--blue); font-weight: 650; }

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.brand-mark svg { width: 21px; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.secure-label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.secure-label svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }

.app-shell {
  display: grid;
  width: 100%;
  min-width: 0;
  place-items: center;
  padding: 34px 0;
  outline: none;
}

.card {
  width: 100%;
  max-width: 520px;
  min-width: 0;
  padding: clamp(26px, 5vw, 46px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  animation: card-in 420ms cubic-bezier(.2,.8,.2,1) both;
}

.card.wide { max-width: 720px; }
.card.camera-card { max-width: 560px; padding: 14px; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.loading-card {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(0, 113, 227, .16);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 440px;
  margin-bottom: 14px;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.043em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(25px, 6vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.lead {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.hero-icon, .result-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 26px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 22px;
}

.hero-icon svg, .result-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.result-icon.success { color: var(--green); background: var(--green-soft); }
.result-icon.warning { color: var(--amber); background: var(--amber-soft); }
.result-icon.danger { color: var(--red); background: var(--red-soft); }
.centered .result-icon { margin-right: auto; margin-left: auto; }

.feature-list {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0 0 30px;
  list-style: none;
}

.feature-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  color: #424245;
  font-size: 14px;
  line-height: 1.45;
}

.feature-list svg { width: 21px; color: var(--blue); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.button-row { display: flex; gap: 10px; align-items: center; }
.button-row.stack { flex-direction: column; align-items: stretch; }

.button {
  display: inline-flex;
  min-height: 50px;
  padding: 0 22px;
  justify-content: center;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button:hover { background: var(--blue-hover); }
.button:active { transform: scale(.985); }
.button:focus-visible { outline: 3px solid rgba(0, 113, 227, .28); outline-offset: 3px; }
.button:disabled { opacity: .52; cursor: not-allowed; transform: none; }
.button.full { width: 100%; }
.button.secondary { color: var(--text); background: #f0f0f2; }
.button.secondary:hover { background: #e8e8eb; }
.button.ghost { min-height: 42px; padding: 0 12px; color: var(--blue); background: transparent; }
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.fine-print {
  margin: 18px 2px 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.consent-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 28px;
}

.consent-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 15px;
  align-items: start;
  background: #f7f7f9;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: border 160ms ease, background 160ms ease;
}

.consent-item:hover { background: #f2f2f4; }
.consent-item:has(input:focus-visible) { outline: 3px solid rgba(0, 113, 227, .22); }
.consent-item:has(input:checked) { background: #f3f8ff; border-color: rgba(0, 113, 227, .17); }

.consent-item input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--blue);
}

.consent-copy { color: #424245; font-size: 13px; line-height: 1.45; }
.consent-copy strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 14px; }

.handoff-grid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 42px; align-items: center; }
.qr-wrap { display: grid; gap: 12px; justify-items: center; }
.qr-box { width: 220px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 8px 30px rgba(0, 0, 0, .06); }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-note { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.handoff-status { display: flex; gap: 8px; min-height: 18px; margin: 16px 0 0; align-items: center; color: var(--muted); font-size: 12px; }
.pulse-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 0 rgba(22,128,60,.35); animation: pulse 1.8s infinite; }
@keyframes pulse { 60% { box-shadow: 0 0 0 6px rgba(22,128,60,0); } 100% { box-shadow: 0 0 0 0 rgba(22,128,60,0); } }

.permission-visual {
  position: relative;
  display: grid;
  width: 130px;
  height: 130px;
  margin: 4px auto 28px;
  place-items: center;
  color: var(--blue);
  background: linear-gradient(145deg, #eef6ff, #e1efff);
  border-radius: 42px;
}

.permission-visual::before, .permission-visual::after { content: ""; position: absolute; border: 1px solid rgba(0,113,227,.16); border-radius: 50%; }
.permission-visual::before { inset: -12px; }
.permission-visual::after { inset: -23px; border-color: rgba(0,113,227,.07); }
.permission-visual svg { width: 52px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }

.centered { text-align: center; }
.centered .lead { margin-right: auto; margin-left: auto; max-width: 390px; }

.camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 400px;
  overflow: hidden;
  background: #111;
  border-radius: 21px;
  isolation: isolate;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-shade {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 39% 37% at 50% 43%, transparent 96%, rgba(0,0,0,.53) 100%);
}

.face-guide {
  position: absolute;
  z-index: 3;
  top: 13%;
  left: 50%;
  width: 52%;
  height: 58%;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 48% 48% 44% 44% / 40% 40% 57% 57%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.12), inset 0 0 34px rgba(255,255,255,.05);
  transition: border-color 180ms ease, transform 240ms ease;
  pointer-events: none;
}

.face-guide.capturing { border-color: #6ee7a0; transform: translateX(-50%) scale(1.015); }

.camera-top {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: 16px;
  left: 16px;
}

.progress-track { height: 5px; overflow: hidden; background: rgba(255,255,255,.28); border-radius: 999px; backdrop-filter: blur(5px); }
.progress-fill { width: 0; height: 100%; background: #fff; border-radius: inherit; transition: width 420ms cubic-bezier(.2,.7,.2,1); }

.camera-bottom {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 14px;
  left: 14px;
  padding: 18px;
  color: #fff;
  background: rgba(15, 15, 17, .62);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  text-align: center;
  backdrop-filter: blur(18px) saturate(130%);
}

.task-count { margin: 0 0 7px; color: rgba(255,255,255,.7); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.task-title { margin: 0; font-size: clamp(21px, 5.5vw, 27px); line-height: 1.12; letter-spacing: -.025em; }
.task-hint { min-height: 19px; margin: 7px 0 0; color: rgba(255,255,255,.74); font-size: 12px; line-height: 1.4; }
.camera-card .camera-actions { padding: 12px 5px 1px; }

.status-detail {
  display: flex;
  gap: 12px;
  padding: 15px;
  margin: 24px 0 4px;
  align-items: flex-start;
  color: var(--muted);
  background: #f7f7f9;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
}

.status-detail svg { width: 19px; flex: 0 0 auto; fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.reference { margin: 18px 0 0; color: var(--subtle); font-size: 11px; word-break: break-all; }

.inline-error {
  padding: 12px 14px;
  margin: 14px 0;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.site-footer {
  display: flex;
  gap: 8px;
  justify-content: center;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.noscript {
  position: fixed;
  z-index: 200;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  color: #fff;
  background: #1d1d1f;
  border-radius: 12px;
  text-align: center;
}

@media (max-width: 680px) {
  .page { padding-right: 14px; padding-left: 14px; }
  .secure-label { font-size: 0; }
  .secure-label svg { width: 17px; height: 17px; }
  .app-shell { padding: 24px 0; }
  .card { border-radius: 24px; }
  .handoff-grid { grid-template-columns: 1fr; gap: 28px; }
  .handoff-grid .qr-wrap { order: -1; }
  .footer-dot { display: none; }
  .site-footer { flex-direction: column; gap: 2px; }
}

@media (max-width: 440px) {
  .card { padding: 26px 22px; }
  .card.camera-card { padding: 8px; border-radius: 24px; }
  .camera-stage { min-height: min(68svh, 590px); border-radius: 18px; }
  .camera-bottom { right: 9px; bottom: 9px; left: 9px; }
}

@media (max-height: 700px) and (orientation: portrait) {
  .camera-stage { min-height: 520px; aspect-ratio: auto; height: calc(100svh - 142px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .button { border: 1px solid ButtonText; }
  .face-guide { border: 3px solid CanvasText; }
}
