/* MeetCute — warm, restrained. Deliberately not pink-heart-confetti;
 * the product is about substance. Primary accent is a muted coral, and
 * the surface is a soft off-white that reads adult without being corporate. */

:root {
  --bg: #fef6f1;
  --surface: #ffffff;
  --text: #3b2f2a;
  --muted: #7b6b63;
  --accent: #db5461;
  --accent-hover: #b83d49;
  --border: #ecd7c7;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #241b1a;
    --surface: #2f2422;
    --text: #f6eee8;
    --muted: #b3a39a;
    --border: #4a3a36;
  }
}

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

/* Restore the HTML ``hidden`` attribute's meaning. Class-scoped
 * ``display: flex`` / ``display: block`` rules below would otherwise
 * out-specify the user-agent ``[hidden] { display: none }`` and leave
 * elements visible after element.hidden = true. */
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Landing ---- */

.landing {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}
.brand-mark {
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  transform: translateY(-2px);
}
.brand-name {
  font-weight: 600;
  letter-spacing: 0.5px;
  font-size: 20px;
}

.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin: 0 0 20px;
}
@media (max-width: 520px) {
  .hero h1 { font-size: 32px; }
}
.lead {
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 28px;
}
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cta, .cta-ghost, .cta-sm {
  display: inline-block;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--radius);
  text-decoration: none;
}
.cta {
  background: var(--accent);
  color: #fff;
}
.cta:hover { background: var(--accent-hover); text-decoration: none; }
.cta-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
.cta-ghost:hover { background: var(--surface); }
.cta-sm {
  background: var(--accent);
  color: #fff;
  padding: 6px 14px;
  font-size: 14px;
  margin-left: 8px;
}
.cta-sm:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }

.how {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.how h2 { margin: 0 0 16px; font-size: 20px; font-weight: 600; }
.how ol {
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.how li {
  counter-increment: step;
  padding: 12px 0 16px 44px;
  position: relative;
  line-height: 1.55;
}
.how li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.how strong { font-weight: 600; }

.site-foot {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.site-foot a { color: var(--muted); }

/* ---- App shell (signed in) ---- */

.app-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.app-header nav { display: flex; gap: 16px; font-size: 14px; align-items: center; }
.app-header nav a { color: var(--muted); }
.app-header nav a:hover { color: var(--text); text-decoration: none; }

.logout-form { display: inline; margin: 0; padding: 0; }
.linkish {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.linkish:hover { color: var(--text); }

.welcome h1 {
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.onboarding-steps {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
}
.step {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 12px;
}
.step.done { opacity: 0.7; }
.step-n {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex: 0 0 auto;
}
.step.done .step-n { background: var(--muted); }
.step.done .step-n::after { content: "✓"; }
.step.done .step-n { color: transparent; position: relative; }
.step.done .step-n::after {
  color: #fff;
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

.muted { color: var(--muted); }
.muted.small { font-size: 13px; }

.pool-badge {
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- Questionnaire ---- */

.q-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.q-progress { margin-bottom: 40px; }
.q-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.q-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.q-progress-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  text-align: right;
}

.q-prompt {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 32px;
  letter-spacing: -0.2px;
}

.likert {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 24px 0 6px;
}
.likert-opt { flex: 1; cursor: pointer; }
.likert-opt input { position: absolute; opacity: 0; pointer-events: none; }
.likert-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  max-height: 60px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.likert-opt:hover .likert-bubble { border-color: var(--accent); color: var(--text); }
.likert-opt input:checked + .likert-bubble {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.likert-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 28px;
}

.choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.choices.yn { flex-direction: row; gap: 12px; }
.choices.yn .choice { flex: 1; text-align: center; }
.choice {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--accent); }
.choice:has(input:checked) {
  border-color: var(--accent);
  background: rgba(219, 84, 97, 0.06);
}

.q-actions { text-align: right; margin-top: 24px; }

.q-done {
  max-width: 520px;
  margin: 40px auto 0;
  text-align: center;
}
.q-done h1 {
  font-size: 28px;
  margin: 0 0 16px;
  letter-spacing: -0.3px;
}

/* ---- Legal pages ---- */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}
.legal .brand-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.legal-article {
  margin-top: 32px;
  line-height: 1.6;
}
.legal-article h1 {
  font-size: 30px;
  letter-spacing: -0.3px;
  margin: 0 0 8px;
}
.legal-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 28px;
}
.legal-article h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 12px;
  letter-spacing: -0.1px;
}
.legal-article p { margin: 0 0 14px; }
.legal-article ul, .legal-article ol {
  padding-left: 22px;
  margin: 0 0 14px;
}
.legal-article li { margin-bottom: 6px; }

.retention-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}
.retention-table th, .retention-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.retention-table th {
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
}

/* ---- Photo capture ---- */
.photos-intro { max-width: 720px; margin: 24px auto 12px; padding: 0 20px; }
.photos-intro h1 { margin: 0 0 8px; font-size: 1.6rem; }
.photos-intro .lead { color: var(--muted); margin: 0 0 6px; }

.photo-tiles {
  max-width: 720px;
  margin: 16px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .photo-tiles { grid-template-columns: 1fr; }
}
.photo-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.photo-tile.has-capture { border-color: var(--accent); }
.tile-preview {
  aspect-ratio: 1 / 1;
  background: #0004;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: hidden;
}
.tile-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-placeholder { opacity: 0.5; }
.tile-label { padding: 10px 12px 12px; }
.tile-label strong { display: block; margin-bottom: 6px; font-size: 0.95rem; }
.tile-actions { display: flex; gap: 12px; align-items: center; }
.photos-footer { max-width: 720px; margin: 12px auto 40px; padding: 0 20px; }

/* ---- Capture modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
}
.modal-card {
  position: relative;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  width: min(520px, 94vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-close { font-size: 1.1rem; }
.capture-stage {
  position: relative;
  background: #000;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.capture-stage video,
.capture-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.silhouette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  pointer-events: none;
}
.cam-error {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 16px;
  background: rgba(184, 61, 73, 0.92);
  color: white;
  font-size: 0.9rem;
}
.cam-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 0.95rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  padding: 0 16px;
  text-align: center;
}

/* Live framing hint — thin band overlaid at the bottom of the capture
 * stage, colour-coded to the current framing state. */
.pose-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 0.92rem;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  transition: background 120ms ease;
}
.pose-hint[data-state="in-frame"]  { background: rgba(34, 150, 66, 0.85); }
.pose-hint[data-state="adjust"]    { background: rgba(201, 140, 30, 0.85); }
.pose-hint[data-state="off-frame"] { background: rgba(184, 61, 73, 0.85); }

/* Silhouette colour tracks the framing state so the overlay itself is
 * the primary visual signal. Default (no data-state) keeps the original
 * subtle white dashed outline. */
.silhouette[data-state="in-frame"]  g { stroke: #88e6a5; stroke-opacity: 1; }
.silhouette[data-state="adjust"]    g { stroke: #ffcf73; stroke-opacity: 1; }
.silhouette[data-state="off-frame"] g { stroke: #ff8b93; stroke-opacity: 0.95; }
.timer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}
.timer-toggle select {
  appearance: auto;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 0.9rem;
}
.modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  gap: 12px;
}
.capture-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.shutter { min-width: 110px; }
