/* Solace Creations brand palette — pixel-sampled from the company profile deck (no formal
   brand bible exists; see implementation-notes.md). Kenao (the deck's display serif) has no
   available web-font file, so --font-display substitutes Playfair Display, a visually similar
   ligature-heavy serif, until the real font file is sourced. */
:root {
  --maroon: #5a0f2e;      /* Primary — wordmark, headers, dark blocks */
  --maroon-dark: #3d0a1f; /* hover/active variant, not separately sampled */
  --mauve: #a3798a;       /* Secondary — script accents, subheads */
  --blood: #6b0810;       /* Accent — sampled range #55050A–#820A14, used sparingly */

  --bg: #ffffff;          /* Base — page background per the deck */
  --bg-card: #fffdfd;
  --text: #2a1620;        /* near-black with a maroon tint, for body readability */
  --text-dim: #8a7480;
  --accent: var(--maroon);
  --accent-strong: var(--maroon-dark);
  --error: #c0392b;       /* functional red, kept distinct from the decorative --blood accent */
  --ok: #3c8a53;
  --radius: 16px;

  --line: #ece0e4;
  --field: #faf5f4;
  /* One shared control height so every tap target is comfortably thumb-sized on a phone. */
  --tap: 54px;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

#flash-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
#flash-overlay.on { opacity: 1; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

body {
  /* Subtle mauve glow so the white page doesn't read as flat under class lighting. */
  background-image: radial-gradient(120% 60% at 50% 0%, rgba(163,121,138,0.10), transparent 70%);
  background-repeat: no-repeat;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}

.screen { width: 100%; max-width: 480px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: 0 10px 30px rgba(90,15,46,0.08);
}

.card.center { text-align: center; }

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--maroon);
}

.brand {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede { color: var(--text-dim); line-height: 1.55; margin: 0 0 20px; }
.lede strong { color: var(--text); }

/* ---------- progress steps ---------- */
.steps {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0 0 20px;
}

.step {
  flex: 1;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b7a5ac;
  padding-top: 8px;
  border-top: 3px solid #f0e5e9;
  border-radius: 2px;
}

.step.is-done { color: var(--text-dim); border-top-color: var(--accent-strong); }
.step.is-current { color: var(--accent); font-weight: 700; border-top-color: var(--accent); }

/* ---------- form ---------- */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  height: var(--tap);
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

input[type="text"]::placeholder { color: #b7a5ac; letter-spacing: 0.06em; }

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163,121,138,0.25);
}

/* ---------- buttons ---------- */
.btn {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 15px 16px;
  border-radius: 999px;
  border: none;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 0.06s ease, background-color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.985); }

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(90,15,46,0.28);
}
.btn.primary:disabled {
  background: #d9cdd2;
  color: #8a7480;
  cursor: not-allowed;
  box-shadow: none;
}
.btn.ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--line); }

.linkbtn {
  background: none;
  border: none;
  padding: 8px 4px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.error {
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
  margin: -2px 0 10px;
}

.fine { color: var(--text-dim); font-size: 0.82rem; line-height: 1.5; text-align: center; margin-top: 16px; }

/* ---------- ticked lists (consent + prep) ---------- */
.consent-list, .prep-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  color: var(--text-dim);
  line-height: 1.5;
}

.consent-list li, .prep-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.consent-list strong, .prep-list strong { color: var(--text); }

.tick {
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(90,15,46,0.1);
}

.tick::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- prep screen illustration ---------- */
.prep-figure {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px 10px;
  margin-bottom: 20px;
}

.prep-figure svg { display: block; width: 100%; height: auto; }

.prep-figure .skin { fill: url(#skin); }
.prep-figure .hair { fill: var(--maroon); }
.prep-figure .body { fill: var(--mauve); }
.prep-figure .line { fill: none; stroke: #7d5c68; stroke-width: 2.4; stroke-linecap: round; }
.prep-figure .line-soft { stroke: rgba(90,15,46,0.18); stroke-width: 1.6; }

.prep-figure .fig-no .hair { fill: #8a7480; }
.prep-figure .fig-no { opacity: 0.6; }
.prep-figure .fig-yes .hair { fill: var(--maroon-dark); }

.prep-figure .badge { stroke: var(--field); stroke-width: 2.5; }
.prep-figure .badge-no { fill: var(--error); }
.prep-figure .badge-yes { fill: var(--ok); }
.prep-figure .badge-mark {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prep-labels { display: flex; margin-top: 2px; }
.prep-label {
  flex: 1;
  text-align: center;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.prep-label.no { color: var(--error); }
.prep-label.yes { color: var(--ok); }

/* ---------- capture screen ---------- */
.capture-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.capture-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.capture-step {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.camera-box {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

#camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1); /* mirror front camera */
}

.capture-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.face-guide {
  width: 62%;
  aspect-ratio: 3 / 4;
  border: 3px dashed rgba(255,255,255,0.55);
  border-radius: 50%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Turns solid + green the moment every check passes, so "you can shoot now" is readable
   from the video itself without reading any chips. */
.capture-wrap.ready .face-guide {
  border-style: solid;
  border-color: var(--ok);
  box-shadow: 0 0 0 9999px rgba(127,191,143,0.08);
}

/* Status sits ON the video: the customer is looking at their own face, not below it. */
.status-pill {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  /* max-content so an absolutely-positioned pill doesn't shrink to the half-width available
     to the right of left:50% and wrap after two or three words. */
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(23,18,26,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  pointer-events: none;
}

.capture-wrap.ready .status-pill { background: rgba(127,191,143,0.9); color: #10240f; }

.capture-hud { width: 100%; text-align: center; }

.checks {
  list-style: none;
  padding: 0;
  margin: 12px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.checks li {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px 6px 26px;
  position: relative;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text-dim);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Dot/tick marker so pass vs. fail reads at a glance, not by colour alone. */
.checks li::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.checks li.pass { background: rgba(127,191,143,0.2); color: var(--ok); }
.checks li.fail { background: rgba(226,101,101,0.15); color: var(--error); }

.checks li.pass::before {
  width: 5px;
  height: 10px;
  margin-top: -6px;
  border-radius: 0;
  background: none;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 1;
}

.capture-btn { max-width: 260px; }

/* ---------- processing ---------- */
.processing-text { font-weight: 600; margin: 0; }

.spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 8px auto 16px;
  animation: spin 0.9s linear infinite;
}

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

/* ---------- results ---------- */
.results-card { max-width: 480px; }

#results-thumb-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

#results-canvas {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
}

#results-body h2 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

.result-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.result-block:last-child { border-bottom: none; }

#results-body p { margin: 0 0 4px; color: var(--text); }
#results-body .headline { font-size: 1.08rem; font-weight: 700; }
#results-body .sub { color: var(--text-dim); font-size: 0.86rem; line-height: 1.45; }

/* ---------- motion ---------- */
.screen:not([hidden]) { animation: fade-in 0.22s ease both; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen:not([hidden]) { animation: none; }
  .btn { transition: none; }
  .spinner { animation-duration: 2s; }
}
