/* Family Checklist — Quiz Shared Styles
   Used by both quiz-positive-parent/ and quiz-is-it-normal/
   Mobile-first, soft palette extending main landing primary. */

:root {
  --primary: hsl(211 100% 50%);
  --primary-dark: #0284C7;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --bg-soft: #FAFAF7;
  --bg-white: #FFFFFF;
  --border-light: #E2E8F0;
  --accent-peach: #FFE5D1;
  --accent-mint: #D6F0E5;
  --accent-lavender: #E5DEFB;
  --accent-yellow: #FFF3B8;
  --accent-blue-soft: #DBEAFE;
  --color-norm: #10B981;
  --color-attention: #F59E0B;
  --color-redflag: #EF4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-soft);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100dvh;
}

/* Card surfaces — slightly translucent so mesh bg peeks through subtly */
.quiz-card { background: rgba(255,255,255,0.92); backdrop-filter: blur(4px); }
.quiz-tip,
.quiz-result-group { background: rgba(255,255,255,0.90); backdrop-filter: blur(4px); }
.quiz-resume-banner { backdrop-filter: blur(4px); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ─── SHELL + BACKGROUND ──────────────────────────────────── */
.quiz-shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Watercolor scene background — soft per-step image, blurred for legibility.
   The .quiz-bg div carries the image (scaled+blurred to absorb the picture
   into the page). A white-gradient overlay above keeps text readable.
   The mood-color tint adds extra warmth on top of the image. */
.quiz-bg {
  position: fixed;
  inset: -20px;
  z-index: 0;
  background-color: var(--bg-soft);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(8px) saturate(115%);
  transform: scale(1.06);
  transition: background-image 0.5s ease;
}
/* Subtle mood-color tint blob over the image, kept for that "watercolor wash" feel */
.quiz-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, var(--mood-c1, transparent) 0%, transparent 55%),
              radial-gradient(circle at 60% 90%, var(--mood-c2, transparent) 0%, transparent 60%);
  opacity: 0.35;
  pointer-events: none;
}

/* White overlay above bg, below content — for legibility.
   Lighter at top (image shows through more), heavier near content cards. */
.quiz-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.20) 0%,
    rgba(255,255,255,0.42) 50%,
    rgba(255,255,255,0.62) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Lift content above bg + overlay layers */
.quiz-topbar { z-index: 100; }
.quiz-progress-track { z-index: 99; }
.quiz-main { position: relative; z-index: 2; }

/* Per-mood background images */
.quiz-shell[data-mood="welcome"]      .quiz-bg { background-image: url('../images/quiz-bg/welcome.jpg'); }
.quiz-shell[data-mood="tension"]      .quiz-bg { background-image: url('../images/quiz-bg/q1-listening.jpg'); }
.quiz-shell[data-mood="calm-blue"]    .quiz-bg { background-image: url('../images/quiz-bg/q2-tantrum.jpg'); }
.quiz-shell[data-mood="warm-pink"]    .quiz-bg { background-image: url('../images/quiz-bg/q3-love.jpg'); }
.quiz-shell[data-mood="growth-green"] .quiz-bg { background-image: url('../images/quiz-bg/q4-school.jpg'); }
.quiz-shell[data-mood="cool-violet"]  .quiz-bg { background-image: url('../images/quiz-bg/q5-anger.jpg'); }
.quiz-shell[data-mood="connect-teal"] .quiz-bg { background-image: url('../images/quiz-bg/q6-1on1.jpg'); }
.quiz-shell[data-mood="peace-cream"]  .quiz-bg { background-image: url('../images/quiz-bg/q7-conflict.jpg'); }
.quiz-shell[data-mood="loader"]       .quiz-bg { background-image: url('../images/quiz-bg/result.jpg'); }
.quiz-shell[data-mood="result"]       .quiz-bg { background-image: url('../images/quiz-bg/result.jpg'); }

/* is-it-normal funnel backgrounds */
.quiz-shell[data-mood="isn-welcome"]      .quiz-bg { background-image: url('../images/quiz-bg-isnormal/welcome.jpg'); }
.quiz-shell[data-mood="isn-age"]          .quiz-bg { background-image: url('../images/quiz-bg-isnormal/age-step.jpg'); }
.quiz-shell[data-mood="isn-young"]        .quiz-bg { background-image: url('../images/quiz-bg-isnormal/young-bedtime.jpg'); }
.quiz-shell[data-mood="isn-mid"]          .quiz-bg { background-image: url('../images/quiz-bg-isnormal/mid-screen.jpg'); }
.quiz-shell[data-mood="isn-tween"]        .quiz-bg { background-image: url('../images/quiz-bg-isnormal/tween-privacy.jpg'); }
.quiz-shell[data-mood="isn-teen"]         .quiz-bg { background-image: url('../images/quiz-bg-isnormal/teen-conversation.jpg'); }
.quiz-shell[data-mood="isn-teen-support"] .quiz-bg { background-image: url('../images/quiz-bg-isnormal/teen-supportive.jpg'); }
.quiz-shell[data-mood="isn-result-norm"]  .quiz-bg { background-image: url('../images/quiz-bg-isnormal/result-norm.jpg'); }
.quiz-shell[data-mood="isn-result-mixed"] .quiz-bg { background-image: url('../images/quiz-bg-isnormal/result-mixed.jpg'); }

/* ─── MOOD PALETTES ──────────────────────────────────────────
   Each [data-mood] sets two CSS variables that the mesh picks up. */
.quiz-shell[data-mood="welcome"]      { --mood-c1: #FFE9A8; --mood-c2: #FFD7B5; }
.quiz-shell[data-mood="tension"]      { --mood-c1: #FFD1C9; --mood-c2: #FFD7B5; }
.quiz-shell[data-mood="calm-blue"]    { --mood-c1: #C9DFF8; --mood-c2: #E5DEFB; }
.quiz-shell[data-mood="warm-pink"]    { --mood-c1: #FBC9DB; --mood-c2: #FFD7B5; }
.quiz-shell[data-mood="growth-green"] { --mood-c1: #C9EBD3; --mood-c2: #DBEAFE; }
.quiz-shell[data-mood="cool-violet"]  { --mood-c1: #E5DEFB; --mood-c2: #C9DFF8; }
.quiz-shell[data-mood="connect-teal"] { --mood-c1: #B9E5DB; --mood-c2: #DBEAFE; }
.quiz-shell[data-mood="peace-cream"]  { --mood-c1: #FFF1C2; --mood-c2: #FFE5D1; }
.quiz-shell[data-mood="loader"]       { --mood-c1: #DBEAFE; --mood-c2: #E5DEFB; }
.quiz-shell[data-mood="result"]       { --mood-c1: #FFE9A8; --mood-c2: #C9EBD3; }
.quiz-shell[data-mood="neutral"]      { --mood-c1: #E2E8F0; --mood-c2: #F1F5F9; }

/* ─── TOP BAR ─────────────────────────────────────────────── */
.quiz-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-bottom: 1px solid rgba(226,232,240,0.5);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.quiz-back {
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  font-size: 22px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.quiz-back:hover { background: rgba(0,0,0,0.05); }
.quiz-back:disabled, .quiz-back[hidden] { display: none; }

.quiz-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; color: var(--text-primary);
}
.quiz-brand::before {
  content: "✓";
  width: 22px; height: 22px;
  background: var(--primary); color: white;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}

.quiz-get-app {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: white;
  transition: all 0.15s;
  white-space: nowrap;
}
.quiz-get-app:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ─── PROGRESS BAR ────────────────────────────────────────── */
.quiz-progress-track {
  height: 4px;
  background: var(--border-light);
  width: 100%;
  position: sticky;
  top: 60px;
  z-index: 99;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  border-radius: 0 2px 2px 0;
  transition: width 0.35s ease-out;
}

/* ─── MAIN CONTENT ────────────────────────────────────────── */
.quiz-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 40px;
  width: 100%;
}

.quiz-screen {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeUp 0.32s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── EMOJI HERO (legacy) ─────────────────────────────────── */
.quiz-emoji-hero {
  width: 96px; height: 96px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

/* ─── SVG ICON HERO (new) ─────────────────────────────────── */
.quiz-icon-hero {
  width: 96px; height: 96px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-md), 0 0 0 8px rgba(255,255,255,0.5);
  flex-shrink: 0;
  overflow: hidden;
}
.quiz-icon-hero svg { width: 48px; height: 48px; opacity: 0.85; }

/* Photo variant — img instead of SVG */
.quiz-icon-hero--photo {
  background: white;
  width: 120px; height: 120px;
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(255,255,255,0.9), 0 0 0 8px rgba(255,255,255,0.4);
}
.quiz-icon-hero--photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@media (min-width: 768px) {
  .quiz-icon-hero--photo { width: 140px; height: 140px; }
}

/* ─── HEADINGS ────────────────────────────────────────────── */
.quiz-headline {
  font-size: clamp(28px, 5.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.quiz-question {
  font-size: clamp(22px, 4.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 28px;
  max-width: 520px;
}

.quiz-subtitle {
  font-size: clamp(15px, 2.5vw, 17px);
  color: var(--text-secondary);
  margin-bottom: 16px;
  max-width: 460px;
}

.quiz-social {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  letter-spacing: 0.01em;
}

.quiz-microcopy {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.quiz-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 17px;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  min-width: 240px;
  min-height: 56px;
  box-shadow: 0 4px 16px rgba(14,165,233,0.30);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.quiz-btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(14,165,233,0.40); }
.quiz-btn-primary:active { transform: translateY(0); }

.quiz-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.quiz-btn-ghost:hover { background: rgba(0,0,0,0.04); }

/* ─── ANSWER CARDS ────────────────────────────────────────── */
.quiz-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

.quiz-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  min-height: 64px;
  width: 100%;
  transition: all 0.15s ease;
  position: relative;
}
.quiz-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.quiz-card:active { transform: scale(0.99); }
.quiz-card.selected { border-color: var(--primary); background: var(--accent-blue-soft); }

.quiz-card-emoji {
  font-size: 28px;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  flex-shrink: 0;
}

/* SVG icon inside answer card */
.quiz-card-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.quiz-card-icon svg { width: 24px; height: 24px; }
.quiz-card:hover .quiz-card-icon { background: var(--accent-blue-soft); color: var(--primary); }
.quiz-card.selected .quiz-card-icon { background: white; color: var(--primary); }

.quiz-card-label {
  flex: 1;
  line-height: 1.35;
}

/* Age selector — special grid */
.quiz-age-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin: 8px auto 0;
}
.quiz-age-btn {
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.15s;
  min-height: 72px;
}
.quiz-age-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.quiz-age-btn:active { transform: scale(0.98); }

/* ─── LOADER ──────────────────────────────────────────────── */
.quiz-loader {
  display: flex; flex-direction: column; align-items: center;
  gap: 24px;
  padding: 60px 20px;
}
.quiz-spinner {
  width: 64px; height: 64px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.quiz-loader-text {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}
.quiz-loader-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: -16px;
}
.quiz-loader-bar {
  width: 240px;
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.quiz-loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.1s linear;
}

/* ─── RESULT ──────────────────────────────────────────────── */
.quiz-result-tips {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  margin-bottom: 32px;
  text-align: left;
}
.quiz-tip {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
}
.quiz-tip::before {
  content: "✦";
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.4;
}

.quiz-result-bridge {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 28px;
}

.quiz-result-bridge strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Result groups for funnel 2 */
.quiz-result-group {
  width: 100%;
  max-width: 520px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  text-align: left;
  border-left: 4px solid var(--border-light);
}
.quiz-result-group.norm      { border-left-color: var(--color-norm); }
.quiz-result-group.attention { border-left-color: var(--color-attention); }
.quiz-result-group.redflag   { border-left-color: var(--color-redflag); }
.quiz-result-group-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}
.quiz-result-group-list {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  list-style: none;
}
.quiz-result-group-list li { padding: 4px 0 4px 0; }
.quiz-result-group-list li::before { content: "•"; margin-right: 8px; color: var(--text-muted); }

.quiz-disclaimer {
  margin-top: 20px;
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  max-width: 520px;
  text-align: center;
  line-height: 1.5;
}

/* Citation strip on result screen */
.quiz-authorities {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 520px;
  text-align: center;
  line-height: 1.5;
  margin-top: 8px;
  font-style: italic;
}

/* ─── STORE BADGES ─────────────────────────────────────────── */
.quiz-store-badges {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}
.quiz-store-badge {
  display: inline-block;
  transition: transform 0.15s;
}
.quiz-store-badge:hover { transform: translateY(-2px); }
.quiz-store-badge img {
  height: 60px;
  width: auto;
}

@media (min-width: 768px) {
  .quiz-store-badge img { height: 72px; }
}

/* ─── RESUME BANNER ───────────────────────────────────────── */
.quiz-resume-banner {
  width: 100%;
  max-width: 520px;
  background: var(--accent-yellow);
  border: 1px solid #F3D77E;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  font-size: 14px;
}
.quiz-resume-banner-row { display: flex; gap: 12px; justify-content: flex-end; }
.quiz-resume-banner button { font-size: 13px; font-weight: 700; padding: 8px 14px; }
.quiz-resume-banner .quiz-btn-primary { min-width: auto; min-height: auto; box-shadow: none; padding: 8px 16px; }

/* ─── DESKTOP ENHANCEMENTS ─────────────────────────────────── */
@media (min-width: 768px) {
  .quiz-main { padding: 64px 20px 64px; }
  .quiz-emoji-hero { width: 112px; height: 112px; font-size: 56px; margin-bottom: 32px; }
}

/* ─── REDUCE MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
