/* ---------- tokens ---------- */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --border: #e3e7ed; --border-strong: #cfd6df;
  --text: #17202b; --text-2: #4b5766; --text-3: #7a8594;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-soft: #e8efff;
  --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fdf3e2; --bad: #b91c1c; --bad-soft: #fdecec;
  --radius: 10px; --radius-sm: 6px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-2); } .small { font-size: 13px; } .tiny { font-size: 12px; color: var(--text-3); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.container { max-width: 880px; margin: 0 auto; padding: 32px 16px 64px; }
.container.wide { max-width: 1180px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .container { padding: 20px 16px 48px; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 14px var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: #f1c4c4; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 6px; color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 14px var(--font); }
textarea { height: auto; padding: 10px 12px; min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field + .field { margin-top: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); font-size: 14px; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }

/* ---------- feedback ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px;
  font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--accent-soft); color: var(--accent); }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.alert.ok { background: var(--ok-soft); border-color: #bfe5cb; color: #14532d; }
.alert.warn { background: var(--warn-soft); border-color: #f3d9a6; color: #78350f; }
.alert.bad { background: var(--bad-soft); border-color: #f3c0c0; color: #7f1d1d; }
.alert.info { background: var(--accent-soft); border-color: #c7d7fe; color: #1e3a8a; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- steps ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2);
  font-weight: 600; font-size: 12px; }
.step.active { color: var(--text); font-weight: 600; } .step.active .n { background: var(--accent); color: #fff; }
.step.done .n { background: var(--ok); color: #fff; }
.step + .step::before { content: ""; width: 24px; height: 1px; background: var(--border-strong); }

/* ---------- capture ---------- */
.capture { position: relative; background: #0f141a; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; }
.capture video, .capture img, .capture canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.capture .guide { position: absolute; inset: 12% 10%; border: 2px dashed rgba(255,255,255,.7); border-radius: 12px; pointer-events: none; }
.capture .guide.face { inset: 12% 28%; border-radius: 50%; }
.capture .hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-size: 13px;
  text-shadow: 0 1px 3px rgba(0,0,0,.6); }

/* ---------- tables ---------- */
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

/* ---------- task option cards ---------- */
.option { display: block; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; background: var(--surface); }
.option:hover { border-color: var(--accent); }
.option input { display: none; }
.option.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.option .title { font-weight: 600; margin-bottom: 4px; }

.legal h2 { margin-top: 1.6em; font-size: 17px; } .legal li { margin-bottom: 6px; }
.kpi { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.footer { text-align: center; color: var(--text-3); font-size: 12px; padding: 24px; }
