/* Brand: Pritchard Black dominant, Gray for surfaces, Blue as accent only. */
@font-face {
  font-family: 'Gunterz';
  src: local('Gunterz Bold'), local('Gunterz-Bold'), url('fonts/Gunterz-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --black: #231f20;
  --gray: #414042;
  --gray-2: #59585a;
  --blue: #1f4993;
  --blue-bright: #3c6fc9; /* blue lifted for contrast on black (focus rings, rings) */
  --white: #ffffff;
  --text: #f4f4f4;
  --muted: #b9b8ba;
  --warn: #f2b84b;
  --error: #ff8a80;
  --font-head: 'Gunterz', 'Montserrat', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-body: Calibri, Carlito, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

.screen {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}
.screen-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px;
}

.eyebrow {
  display: block; font-family: var(--font-head); font-weight: 700; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.headline {
  font-family: var(--font-head); font-weight: 800; font-size: 30px; line-height: 1.1;
  margin: 6px 0 8px; letter-spacing: -0.01em;
}
.brandbar { margin-bottom: 20px; border-left: 4px solid var(--blue); padding-left: 14px; }
.muted { color: var(--muted); margin: 0; }
.fineprint { color: var(--muted); font-size: 14px; text-align: center; margin: 14px 0 0; }
.error { color: var(--error); margin: 4px 0 12px; }

/* Form */
.field { display: block; border: 0; padding: 0; margin: 0 0 18px; }
.field > span, .field > legend { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
input[type=text], input[type=email] {
  width: 100%; font: inherit; color: var(--text); background: var(--gray);
  border: 1px solid var(--gray-2); border-radius: 10px; padding: 13px 14px;
}
input::placeholder { color: #8f8e90; }
input:focus-visible, button:focus-visible, .segmented label:has(input:focus-visible), .option:has(input:focus-visible) {
  outline: 2px solid var(--blue-bright); outline-offset: 2px;
}

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented label {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px;
  padding: 8px 10px; border-radius: 10px; background: var(--gray); border: 1px solid var(--gray-2);
  font-weight: 700; line-height: 1.15; cursor: pointer;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { border-color: var(--blue-bright); box-shadow: inset 0 0 0 1px var(--blue-bright); background: #2b3446; }

.option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin-bottom: 8px;
  border-radius: var(--radius); background: var(--gray); border: 1px solid var(--gray-2); cursor: pointer;
}
.option:has(input:checked) { border-color: var(--blue-bright); box-shadow: inset 0 0 0 1px var(--blue-bright); background: #2b3446; }
.option input { margin-top: 4px; accent-color: var(--blue-bright); width: 18px; height: 18px; flex: none; }
.option-body { display: flex; flex-direction: column; gap: 2px; }
.option small { color: var(--muted); font-size: 15px; }
.badge {
  display: inline-block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--blue); color: var(--white); border-radius: 999px; padding: 2px 8px; margin-left: 4px; vertical-align: 2px;
}
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 16px; font-size: 15px; color: var(--muted); }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--blue-bright); }

.btn {
  display: block; width: 100%; font: inherit; font-family: var(--font-head); font-weight: 700; font-size: 17px;
  padding: 15px 18px; border-radius: 999px; border: 0; cursor: pointer;
}
a.btn { text-align: center; text-decoration: none; box-sizing: border-box; }
.btn-primary { background: var(--white); color: var(--black); }
.btn-primary:active { background: #dcdcdc; }
.btn-secondary { background: transparent; color: var(--text); border: 1.5px solid var(--gray-2); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 16px; }

.spinner {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--gray); border-top-color: var(--white);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Camera */
.screen-camera {
  position: fixed; inset: 0; max-width: none; padding: 0; background: #000; overflow: hidden; touch-action: none;
}
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#video.mirror { transform: scaleX(-1); }
.guide {
  position: absolute; left: 50%; top: 46%;
  width: min(86vw, 60vh, 520px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 200vmax rgba(15, 13, 14, 0.62);
  border-radius: 6px;
}
.guide svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.oval { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 2.5; stroke-dasharray: 6 6; transition: stroke 0.2s; }
.ring { fill: none; stroke: var(--white); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.guide.ready .oval { stroke: var(--blue-bright); stroke-dasharray: none; }
.corner { position: absolute; width: 26px; height: 26px; border: 3px solid var(--white); }
.corner.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corner.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corner.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corner.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }

.cam-top {
  position: absolute; left: 0; right: 0; top: 0; padding: calc(12px + var(--safe-top)) 14px 0;
  display: flex; align-items: flex-start; gap: 10px;
}
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(35, 31, 32, 0.75); color: var(--white); cursor: pointer;
}
.prompt {
  flex: 1; margin: 0 54px 0 0; text-align: center; font-family: var(--font-head); font-weight: 700;
  font-size: 22px; line-height: 1.2; padding: 10px 14px; border-radius: 12px; background: rgba(35, 31, 32, 0.8);
}
.prompt.ok { background: var(--blue); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 12px calc(16px + var(--safe-bottom)); }
.chips { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 520px; }
.chips li {
  font-size: 13px; font-weight: 700; padding: 5px 10px 5px 8px; border-radius: 999px;
  background: rgba(65, 64, 66, 0.85); color: var(--muted); display: flex; align-items: center; gap: 6px;
}
.chips li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.chips li.pass { background: rgba(31, 73, 147, 0.92); color: var(--white); }
.chips li.pass::before { background: var(--white); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 0.35s ease-out; }
@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } }
.debug {
  position: absolute; left: 8px; top: calc(70px + var(--safe-top)); margin: 0; padding: 6px 8px; font: 11px/1.35 ui-monospace, Consolas, monospace;
  background: rgba(0, 0, 0, 0.6); color: #9fe; border-radius: 6px; pointer-events: none;
}

/* Review */
.review-img { display: block; width: 100%; aspect-ratio: 1; border-radius: var(--radius); background: var(--gray); object-fit: cover; }
.review-checks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 15px; }
.review-checks li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.review-checks li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-bright); flex: none; }
.done-mark { color: var(--blue-bright); margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  .flash.go { animation: none; }
}
