/* FaceSign × Trusona evaluator — "Recovery Demo Minimal"
   Skinned with the FaceSign design system (colors_and_type.css tokens +
   BorderedFrame / Badge / Button component specs). Self-hosted assets only:
   the page ships under CSP script/style/font-src 'self'. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src:
    url("/fonts/Geist_wght_.woff2") format("woff2-variations"),
    url("/fonts/Geist_wght_.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src:
    url("/fonts/Geist-Italic_wght_.woff2") format("woff2-variations"),
    url("/fonts/Geist-Italic_wght_.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #09090b;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --muted-foreground: #737373;
  --border: #e5e5e5;
  --cta: #10b981;
  --section-dark: #1e3a5f;
  --ink: #14181f;
  --gray-400: #9aa3af;
  --gray-300: #c7ced7;
  --amber-700: #9a6700;
  --amber-50: #fff6e6;
  --amber-200: #f0d9a8;
  --green-50: #eafbf2;
  --green-200: #9adbb8;
  --green-700: #00935d;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 4%);
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --pad-x: clamp(24px, 5vw, 44px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
select {
  font: inherit;
}

input[type="checkbox"] {
  accent-color: #171717;
}

:focus-visible {
  outline: 1px solid #737373;
  outline-offset: 0;
}

@keyframes fsPulse {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

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

/* ── page shell + BorderedFrame (framed, max 800) ─────────────── */

.page {
  min-height: 100vh;
  padding: 48px 16px 80px;
  padding-right: max(16px, env(safe-area-inset-right));
  padding-left: max(16px, env(safe-area-inset-left));
}

.fs-frame {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--border);
  background: var(--background);
}

/* 7×7 corner joists: white fill, 1px border, −4px offsets — each sits on a
   real vertical×horizontal rail crossing because the frame is `framed`. */
.joist {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid var(--border);
  background: #fff;
  z-index: 5;
}

.joist-tl {
  top: -4px;
  left: -4px;
}

.joist-tr {
  top: -4px;
  right: -4px;
}

.joist-bl {
  bottom: -4px;
  left: -4px;
}

.joist-br {
  bottom: -4px;
  right: -4px;
}

/* ── shared type ──────────────────────────────────────────────── */

.t-tagline {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* ── badges (DS Badge: framed pill, 24px, shadow-xs) ──────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}

.badge-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentcolor;
  flex: 0 0 auto;
}

.badge-flagged {
  background: rgb(245 158 11 / 8%);
  border-color: rgb(245 158 11 / 30%);
  color: #b45309;
}

.badge-verified {
  background: rgb(16 185 129 / 8%);
  border-color: rgb(16 185 129 / 25%);
  color: #047857;
}

.badge-blocked {
  background: rgb(220 38 38 / 6%);
  border-color: rgb(220 38 38 / 25%);
  color: #b91c1c;
}

/* ── buttons (DS Button variants) ─────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

.btn-cta {
  background: var(--cta);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.btn-cta:hover:not(:disabled) {
  background: #0ea672;
}

.btn-default {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow:
    0 4px 12px rgb(0 0 0 / 8%),
    inset 0 0.5px 0 rgb(255 255 255 / 12%);
}

.btn-default:hover:not(:disabled) {
  background: #262626;
}

.btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.text-link-button {
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--foreground);
  cursor: pointer;
  text-underline-offset: 3px;
}

.text-link-button:hover {
  text-decoration: underline;
}

/* ── screen: preflight ────────────────────────────────────────── */

.hero {
  padding: 36px var(--pad-x) 32px;
  border-bottom: 1px solid var(--border);
}

.hero .t-tagline {
  margin-bottom: 16px;
}

.hero h1 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4.5vw, 42px);
  line-height: 1.05;
  letter-spacing: -1.2px;
  font-weight: 600;
  text-wrap: balance;
}

.hero h2 {
  margin-bottom: 14px;
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.1;
  letter-spacing: -1.2px;
  font-weight: 600;
  text-wrap: balance;
}

.lede {
  margin-bottom: 16px;
  max-width: 58ch;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-kit {
  padding: 28px var(--pad-x) 30px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

.kit-heading {
  margin-bottom: 18px;
}

.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 28px;
}

.kit-label {
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--gray-400);
}

.kit-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
}

.kit-answer {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.kit-answer .kit-label {
  margin-bottom: 6px;
}

.digits-lg {
  margin-bottom: 8px;
  font-size: clamp(34px, 5.5vw, 48px);
  font-weight: 500;
  letter-spacing: -1.5px;
  line-height: 1;
  color: var(--foreground);
  white-space: nowrap;
}

.kit-note {
  max-width: 58ch;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.mock-options {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.mock-options label {
  display: block;
  margin-bottom: 6px;
}

.mock-options select {
  display: block;
  margin-bottom: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--foreground);
}

.step-strip {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-400);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.step-strip .sep {
  color: var(--gray-300);
}

.start-section {
  padding: 26px var(--pad-x) 36px;
}

.start-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}

.start-helper {
  margin-top: 12px;
  max-width: 64ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.start-feedback {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--amber-700);
}

/* ── screen: active ───────────────────────────────────────────── */

.active-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 16px var(--pad-x);
  border-bottom: 1px solid var(--border);
}

.answer-band {
  background: var(--section-dark);
  padding: 20px var(--pad-x);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  border-bottom: 1px solid var(--border);
}

.band-label {
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: rgb(250 250 250 / 70%);
}

.digits-band {
  font-size: clamp(30px, 4.5vw, 40px);
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1.05;
  color: var(--primary-foreground);
  white-space: nowrap;
}

.stage-section {
  padding: 24px var(--pad-x) 32px;
}

.stage {
  position: relative;
  background: var(--ink);
  border-radius: 14px;
  height: clamp(380px, 58vh, 580px);
  overflow: hidden;
}

.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.stage iframe[hidden] {
  display: none;
}

.stage-message[hidden] {
  display: none;
}

.stage-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
}

.stage-message p {
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.6;
  color: rgb(250 250 250 / 80%);
}

.stage-caption {
  position: absolute;
  bottom: 12px;
  color: rgb(250 250 250 / 50%);
  pointer-events: none;
}

.stage-caption-left {
  left: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.stage-caption-right {
  right: 16px;
  font-size: 11.5px;
}

.status-line {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

/* ── screen: complete ─────────────────────────────────────────── */

.result-header {
  padding: 36px var(--pad-x) 28px;
  border-bottom: 1px solid var(--border);
}

.result-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 18px;
}

.result-header h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3.5vw, 36px);
  letter-spacing: -1.2px;
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
}

.result-note {
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

.scorecard {
  padding: 8px var(--pad-x) 12px;
  border-bottom: 1px solid var(--border);
}

.scorecard[hidden] {
  display: none;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 24px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.score-row:first-child {
  border-top: none;
}

.score-side {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.chip {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--border);
}

.chip-pass {
  background: var(--green-50);
  color: var(--green-700);
  border-color: var(--green-200);
}

.chip-part {
  background: var(--amber-50);
  color: var(--amber-700);
  border-color: var(--amber-200);
}

.chip-none {
  background: #fff;
  color: var(--gray-400);
  border-color: var(--border);
}

.chip-fail {
  background: rgb(220 38 38 / 6%);
  color: #b91c1c;
  border-color: rgb(220 38 38 / 25%);
}

.score-label {
  font-size: 14px;
  color: var(--muted-foreground);
}

.score-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.score-value.is-muted {
  color: var(--muted-foreground);
}

.score-value.is-part {
  color: var(--amber-700);
}

.score-value.is-fail {
  color: #b91c1c;
}

.result-actions {
  padding: 24px var(--pad-x) 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}

.result-actions-note {
  font-size: 13.5px;
  color: var(--muted-foreground);
}

/* ── mobile (brief: full-width actions, tall active frame) ────── */

@media (max-width: 680px) {
  .page {
    padding: 24px 12px 56px;
  }

  .start-row .btn,
  .result-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .stage {
    height: 68vh;
  }
}
