:root {
  --background: #07110f;
  --surface: #10201c;
  --surface-2: #173129;
  --surface-3: #214339;
  --mint: #6fe2af;
  --lime: #b6ef7f;
  --text: #f1f7f3;
  --muted: #b9cbc2;
  --dark-text: #07110f;
  --danger: #ffb4a9;
  --warning: #ffd489;
  --line: rgba(241, 247, 243, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--background); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 12%, rgba(111, 226, 175, 0.12), transparent 28rem),
    radial-gradient(circle at 15% 78%, rgba(182, 239, 127, 0.07), transparent 25rem),
    var(--background);
}

button, select, input { font: inherit; }

button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--dark-text);
  background: var(--lime);
  transform: translateY(-160%);
}

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

.topbar {
  width: min(1180px, calc(100% - 2rem));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.7rem; }
.service-status { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2rem; padding: 0.35rem 0.75rem; border: 1px solid rgba(111, 226, 175, 0.32); border-radius: 999px; color: #bff5db; background: rgba(111, 226, 175, 0.08); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
.service-status::before { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #6fe2af; box-shadow: 0 0 0 0.25rem rgba(111, 226, 175, 0.12); content: ''; }
.lock-button { min-height: 2.3rem; padding: 0.35rem 0.8rem; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; color: #effff8; background: rgba(255, 255, 255, 0.06); font: inherit; font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.lock-button:hover, .lock-button:focus-visible { border-color: #6fe2af; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--dark-text);
  font-weight: 900;
  font-size: 1.15rem;
  background: linear-gradient(145deg, var(--lime), var(--mint));
  clip-path: polygon(50% 0, 94% 16%, 86% 76%, 50% 100%, 14% 76%, 6% 16%);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.02rem; letter-spacing: 0.015em; }
.brand small { margin-top: 0.12rem; color: var(--muted); font-size: 0.75rem; }

.language-switch {
  display: flex;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.language-button {
  min-width: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.6rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.language-button.is-active { color: var(--dark-text); background: var(--mint); }

.shell {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.progress { margin: 0 auto 1.25rem; max-width: 720px; }
.progress ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.progress li { position: relative; display: grid; justify-items: center; gap: 0.35rem; color: #8da098; font-size: 0.73rem; }
.progress li::before { content: ""; position: absolute; z-index: -1; top: 15px; left: 0; right: 0; height: 2px; background: var(--surface-3); }
.progress li:first-child::before { left: 50%; }
.progress li:last-child::before { right: 50%; }
.progress span { width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid var(--surface-3); border-radius: 50%; background: var(--background); font-weight: 900; }
.progress li.is-current, .progress li.is-complete { color: var(--text); }
.progress li.is-current span { color: var(--dark-text); background: var(--lime); border-color: var(--lime); }
.progress li.is-complete span { color: var(--dark-text); background: var(--mint); border-color: var(--mint); }

.panel {
  max-width: 840px;
  margin: 0 auto;
  padding: clamp(1.3rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(23, 49, 41, 0.96), rgba(10, 25, 21, 0.98));
  box-shadow: var(--shadow);
}

.panel[hidden] { display: none; }
.access-panel { width: min(100%, 44rem); margin-inline: auto; }
.test-boundary { margin: 1.5rem 0; padding: 1rem 1.1rem; border: 1px solid rgba(182, 239, 127, 0.34); border-radius: 1rem; color: #e8fbed; background: rgba(182, 239, 127, 0.07); }
.test-boundary strong { display: block; margin-bottom: 0.35rem; color: #b6ef7f; }
.test-boundary p { margin: 0; line-height: 1.6; }
.text-input { width: 100%; min-height: 3.4rem; padding: 0.85rem 1rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 0.85rem; color: #f5fff9; background: rgba(4, 18, 14, 0.78); font: inherit; }
.text-input:focus { border-color: #6fe2af; outline: 3px solid rgba(111, 226, 175, 0.2); }
.access-actions { justify-content: flex-end; }
.test-ribbon { display: inline-flex; margin-bottom: 1rem; padding: 0.45rem 0.75rem; border: 1px solid rgba(255, 204, 102, 0.36); border-radius: 999px; color: #ffe3a5; background: rgba(255, 204, 102, 0.08); font-size: 0.76rem; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }
.hero { max-width: 940px; }
.eyebrow { margin-bottom: 0.8rem; color: var(--mint); font-size: 0.76rem; font-weight: 900; letter-spacing: 0.15em; text-transform: uppercase; }
h1 { max-width: 750px; margin: 0; font-size: clamp(2rem, 6vw, 4.25rem); line-height: 0.98; letter-spacing: -0.055em; }
.panel:not(.hero) h1 { font-size: clamp(1.8rem, 5vw, 3.2rem); }
.lede { max-width: 700px; margin: 1.15rem 0 1.6rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.13rem); line-height: 1.62; }

.assurance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin: 2rem 0; }
.assurance-grid article { min-height: 190px; padding: 1.1rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(7, 17, 15, 0.45); }
.assurance-grid h2 { margin: 1rem 0 0.35rem; font-size: 1rem; }
.assurance-grid p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.48; }
.icon-chip { display: inline-grid; place-items: center; width: 40px; height: 32px; border-radius: 10px; color: var(--dark-text); background: var(--mint); font-size: 0.72rem; font-weight: 900; }

.button {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: 0.005em;
}

.button:disabled { cursor: not-allowed; opacity: 0.42; }
.button-primary { color: var(--dark-text); background: linear-gradient(135deg, var(--lime), var(--mint)); box-shadow: 0 12px 30px rgba(111, 226, 175, 0.14); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

.notice-card { padding: 1.25rem; border-radius: 18px; color: var(--dark-text); background: var(--mint); }
.notice-card h2 { margin: 0 0 0.7rem; font-size: 1.08rem; }
.notice-card ul { margin: 0; padding-left: 1.2rem; line-height: 1.55; }
.retention-note { margin: 0.9rem 0 0; padding-top: 0.85rem; border-top: 1px solid rgba(7, 17, 15, 0.22); font-weight: 750; }
.field-label { display: block; margin: 1.25rem 0 0.45rem; color: var(--text); font-weight: 800; }
.select { width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 13px; padding: 0 0.85rem; color: var(--text); background: var(--surface); }
.consent-box { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 0.85rem; margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; color: var(--muted); line-height: 1.5; cursor: pointer; }
.consent-box input { width: 22px; height: 22px; margin: 0.15rem 0 0; accent-color: var(--lime); }

.capture-copy { margin-bottom: 1rem; }
.camera-stage { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 22px; background: #020706; border: 1px solid rgba(111, 226, 175, 0.35); }
.camera-stage video, .demo-camera { width: 100%; height: 100%; object-fit: cover; }
.demo-camera { display: grid; place-content: center; justify-items: center; gap: 0.6rem; color: var(--dark-text); background: linear-gradient(135deg, #91e9c1, #d3f7a1); }
.demo-camera[hidden] { display: none; }
.demo-camera span { width: 84px; height: 60px; display: grid; place-items: center; border: 4px solid var(--dark-text); border-radius: 14px; font-size: 1.4rem; font-weight: 950; }
.demo-camera strong { font-size: clamp(1.2rem, 4vw, 2.2rem); letter-spacing: 0.08em; }
.demo-camera small { font-weight: 800; }
.guide { position: absolute; inset: 12%; pointer-events: none; }
.guide i { position: absolute; width: 34px; height: 34px; border-color: var(--lime); border-style: solid; filter: drop-shadow(0 1px 2px #000); }
.guide i:nth-child(1) { top: 0; left: 0; border-width: 3px 0 0 3px; }
.guide i:nth-child(2) { top: 0; right: 0; border-width: 3px 3px 0 0; }
.guide i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.guide i:nth-child(4) { right: 0; bottom: 0; border-width: 0 3px 3px 0; }
.selfie-guide .guide { inset: 10% 27%; border: 2px solid var(--lime); border-radius: 50%; }
.selfie-guide .guide i { display: none; }
.camera-badge { position: absolute; top: 0.75rem; left: 0.75rem; padding: 0.38rem 0.55rem; border-radius: 999px; color: var(--dark-text); background: var(--lime); font-size: 0.7rem; font-weight: 900; }
.capture-actions { justify-content: space-between; }
.capture-button { min-width: 150px; }
.error-card { margin-top: 1rem; padding: 0.9rem 1rem; border: 1px solid var(--danger); border-radius: 14px; color: #190503; background: var(--danger); font-weight: 750; }

.preview-frame { display: grid; place-items: center; min-height: 280px; padding: 1rem; border: 1px solid var(--line); border-radius: 22px; background: #020706; }
.preview-frame img { display: block; max-width: 100%; max-height: 60vh; border-radius: 12px; }
.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.review-item { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.review-item img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #020706; }
.review-item strong { display: block; padding: 0.7rem 0.8rem; color: var(--text); font-size: 0.85rem; }
.submit-note { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; margin-top: 1rem; padding: 0.95rem; border-radius: 15px; color: var(--dark-text); background: var(--lime); }
.submit-note span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--dark-text); color: var(--lime); font-weight: 900; }
.submit-note p { margin: 0; line-height: 1.5; font-weight: 700; }

.result-panel { text-align: center; }
.result-panel .eyebrow, .result-panel .lede { margin-left: auto; margin-right: auto; }
.result-icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 1rem; border-radius: 50%; color: var(--dark-text); background: var(--warning); font-size: 1.8rem; font-weight: 950; }
.result-boundary { max-width: 600px; margin: 1.3rem auto; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(7, 17, 15, 0.45); }
.result-boundary p { margin: 0.4rem 0 0; color: var(--muted); line-height: 1.5; }
.result-details { display: grid; grid-template-columns: minmax(7rem, 0.7fr) minmax(0, 1.3fr); gap: 0; max-width: 600px; margin: 1.25rem auto; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 1rem; text-align: left; background: rgba(4, 18, 14, 0.54); }
.result-details dt, .result-details dd { margin: 0; padding: 0.75rem 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); overflow-wrap: anywhere; }
.result-details dt { color: #bff5db; font-size: 0.78rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.result-details dd { color: #f3fff8; }
.result-details > :nth-last-child(-n + 2) { border-bottom: 0; }

footer { width: min(980px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 2.5rem; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.mode-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.mode-button {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 96px;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(182, 239, 127, 0.34);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(20, 50, 41, 0.96), rgba(9, 25, 21, 0.96));
  color: #f7fff9;
  text-align: left;
  cursor: pointer;
}

.mode-button:hover,
.mode-button:focus-visible {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(182, 239, 127, 0.16);
}

.mode-button strong,
.mode-button small { display: block; }
.mode-button strong { font-size: 1rem; line-height: 1.25; }
.mode-button small { margin-top: 0.3rem; color: #cfe2d7; line-height: 1.35; }
.mode-number {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--lime);
  color: var(--dark-text);
  font-weight: 950;
}

.photo-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.photo-picker {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 330px;
  padding: 1rem;
  overflow: hidden;
  border: 2px dashed rgba(182, 239, 127, 0.5);
  border-radius: 22px;
  background: rgba(5, 18, 15, 0.66);
  color: #f7fff9;
  cursor: pointer;
}

.photo-picker:hover,
.photo-picker:focus-within {
  border-color: var(--lime);
  background: rgba(20, 50, 41, 0.82);
}

.photo-picker-title {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 2;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--lime);
  color: var(--dark-text);
  font-size: 0.75rem;
  font-weight: 900;
}

.photo-picker img {
  width: 100%;
  height: 250px;
  object-fit: contain;
  border-radius: 15px;
  background: #07110f;
}

.photo-picker-status {
  max-width: 100%;
  margin-top: 0.8rem;
  overflow: hidden;
  color: #dff5e7;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .topbar { width: min(calc(100% - 1.2rem), 1180px); min-height: 68px; align-items: flex-start; padding-block: 0.65rem; }
  .topbar-actions { flex-wrap: wrap; gap: 0.45rem; }
  .service-status { order: 3; width: 100%; justify-content: center; }
  .brand small { display: none; }
  .shell { width: min(calc(100% - 1rem), 980px); padding-top: 1rem; }
  .panel { border-radius: 22px; }
  .assurance-grid, .review-grid { grid-template-columns: 1fr; }
  .assurance-grid article { min-height: auto; }
  .actions { flex-direction: column-reverse; }
  .button { width: 100%; }
  .capture-actions { flex-direction: row; }
  .capture-actions .button { width: auto; flex: 1; }
  .progress b { font-size: 0.65rem; }
  footer { flex-direction: column; }
  .mode-actions, .photo-pair-grid { grid-template-columns: 1fr; }
  .photo-picker { min-height: 280px; }
  .result-details { grid-template-columns: 1fr; }
  .result-details dt { padding-bottom: 0.2rem; border-bottom: 0; }
  .result-details dd { padding-top: 0.2rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .panel { animation: panel-in 280ms ease-out; }
  .button { transition: transform 140ms ease, filter 140ms ease; }
  .button:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.04); }
  @keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }
}
