/* ===========================================================
   Breakscroll — Web onboarding quiz
   Mirrors the React Native onboarding (src/screens/*)
   =========================================================== */

:root {
  --q-primary: #b968ff;
  --q-primary-2: #9c20fd;
  --q-primary-3: #6a10b0;
  --q-green: #22c55e;
  --q-green-2: #16a34a;
  --q-green-3: #15803d;
  --q-muted: #9ca3af;
  --q-muted-2: #6b7280;
  --q-radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #000000;
  color: #ffffff;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.quiz-body { overflow-x: hidden; }

/* ---------- app frame ----------
   A phone-like centered column so the experience reads the same
   on desktop and mobile. Full-bleed on small screens. */
#quiz-root {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: #000000;
  overflow: hidden;
}

/* Each step fills the frame and stacks header / scrollable body / footer */
.quiz-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  animation: quizFadeIn 400ms ease both;
}

@keyframes quizFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* gradient backdrops for the emotional screens */
.quiz-screen--results,
.quiz-screen--insights { background: linear-gradient(180deg, #1a0533 0%, #0a0a1a 55%, #000000 100%); }
.quiz-screen--reclaim  { background: linear-gradient(180deg, #011a0a 0%, #0a0a1a 55%, #000000 100%); }
.quiz-screen--done     { background: linear-gradient(180deg, #011a0a 0%, #0a0a1a 55%, #000000 100%); }

/* ---------- header ---------- */
.quiz-header {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px 0;
  flex: 0 0 auto;
}
.quiz-back {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--q-muted);
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
}
.quiz-back:hover { color: #fff; }
.quiz-back--hidden { visibility: hidden; }

/* ---------- scrollable body ---------- */
.quiz-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 24px 8px;
  -webkit-overflow-scrolling: touch;
}
.quiz-content--center {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.quiz-content--around {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

/* ---------- footer ---------- */
.quiz-footer {
  flex: 0 0 auto;
  padding: 8px 24px 24px;
}

/* ---------- typography ---------- */
.quiz-step-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--q-muted);
  margin: 0 0 8px;
}
.quiz-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 24px;
  letter-spacing: 0;
  text-transform: none;
}
.quiz-title--sm { font-size: 24px; }
.quiz-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--q-muted);
  margin: 0 0 28px;
}

/* ---------- primary button ---------- */
.quiz-btn {
  display: block;
  width: 100%;
  border: 0;
  cursor: pointer;
  border-radius: var(--q-radius);
  padding: 18px 20px;
  text-align: center;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--q-primary-2) 0%, var(--q-primary-3) 100%);
  box-shadow: 0 4px 12px rgba(156, 32, 253, 0.35);
  transition: transform 120ms ease, opacity 120ms ease;
}
.quiz-btn:hover { transform: translateY(-2px); }
.quiz-btn:active { transform: translateY(0); }
.quiz-btn[disabled] {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.07);
  color: var(--q-muted-2);
  box-shadow: none;
  transform: none;
}
.quiz-btn--bebas {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.quiz-btn--green {
  background: linear-gradient(135deg, var(--q-green-2) 0%, var(--q-green-3) 100%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

/* ---------- intro (Understanding) ---------- */
.intro-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  background: linear-gradient(135deg, var(--q-primary) 0%, var(--q-primary-2) 50%, var(--q-primary-3) 100%);
  box-shadow: 0 8px 30px rgba(156, 32, 253, 0.6);
}
.intro-logo svg { width: 46px; height: 46px; fill: #fff; }
.intro-title {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #fff;
  margin: 0;
}
.intro-title .ltr { opacity: 0; animation: quizFadeIn 200ms ease forwards; }
.intro-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--q-muted-2);
  margin: 12px 0 0;
  opacity: 0;
}
.intro-block { width: 100%; }

/* ---------- name input ---------- */
.quiz-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  border-radius: 14px;
  padding: 20px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 18px;
  outline: none;
}
.quiz-input::placeholder { color: var(--q-muted-2); }
.quiz-input:focus { box-shadow: 0 0 0 2px rgba(156, 32, 253, 0.5) inset; }

/* ---------- goals list (Achieve) ---------- */
.goal-list { display: flex; flex-direction: column; gap: 10px; }
.goal-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 15px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #d1d5db;
  transition: background 120ms ease, border-color 120ms ease;
}
.goal-item .goal-ico {
  width: 30px;
  text-align: center;
  color: var(--q-primary);
  font-size: 20px;
  flex: 0 0 auto;
}
.goal-item .goal-label {
  flex: 1 1 auto;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
}
.goal-item .goal-radio {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.goal-item.is-selected {
  border-color: rgba(156, 32, 253, 0.5);
  background: rgba(156, 32, 253, 0.08);
  color: #fff;
}
.goal-item.is-selected .goal-radio {
  border-color: var(--q-primary-2);
  background: rgba(156, 32, 253, 0.15);
}
.goal-item.is-selected .goal-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--q-primary-2);
}

/* ---------- stepper (Screen time / Goal) ---------- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 120px;
}
.stepper-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.3);
  color: var(--q-muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stepper-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.stepper-value {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 80px;
  letter-spacing: 0.03em;
  color: #fff;
  min-width: 120px;
  text-align: center;
  line-height: 1;
}
.stepper-value.bump { animation: stepperBump 280ms ease; }
@keyframes stepperBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.stepper-unit {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: #fff;
  text-align: center;
  margin: 4px 0 0;
}

/* ---------- quiz questions ---------- */
.quiz-greet {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 16px;
  color: var(--q-muted-2);
}
.quiz-greet .name { color: var(--q-primary-2); }
.quiz-question {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 36px;
  line-height: 1.16;
  letter-spacing: 0.03em;
  color: #fff;
  margin: 0 0 32px;
  animation: quizFadeIn 400ms ease both;
}
.option-list { display: flex; flex-direction: column; gap: 12px; }
.option {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid rgba(156, 32, 253, 0.2);
  background: rgba(156, 32, 253, 0.1);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  transition: background 120ms ease, border-color 120ms ease;
  animation: quizFadeIn 400ms ease both;
}
.option:hover { border-color: rgba(156, 32, 253, 0.55); }
.option.is-selected {
  background: rgba(156, 32, 253, 0.2);
  border-color: var(--q-primary-2);
}

/* ---------- top apps / age cards ---------- */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transition: background 120ms ease, border-color 120ms ease;
  animation: quizFadeIn 300ms ease both;
}
.choice-card .app-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex: 0 0 auto;
}
.choice-card .choice-label {
  flex: 1 1 auto;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
}
.choice-card.is-selected {
  background: rgba(156, 32, 253, 0.12);
  border-color: var(--q-primary-2);
}
.choice-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--q-primary-2);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: 0 0 auto;
}
.choice-card.is-selected .choice-check { display: inline-flex; }
.choice-card--age { padding: 16px 20px; }
.choice-card--age .choice-label { font-size: 16px; }

/* ---------- results chart ---------- */
.results-text { text-align: center; }
.results-headline {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  margin: 0 0 12px;
  color: #fff;
}
.results-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--q-muted);
  line-height: 1.5;
  margin: 0;
}
.chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 48px;
  margin: 0 0 28px;
}
.bar-group { display: flex; flex-direction: column; align-items: center; }
.bar-wrap {
  width: 64px;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.bar-pct {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 32px;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  opacity: 0;
  flex: 0 0 auto;
  transition: opacity 800ms ease;
}
.bar-pct--user { color: var(--q-primary-2); }
.bar-pct--avg { color: #fff; }
.bar {
  width: 64px;
  height: 0;
  flex: 0 0 auto;
  border-radius: 16px;
  transition: height 2000ms cubic-bezier(0.22, 1, 0.36, 1);
}
.bar--user {
  background: linear-gradient(180deg, #c77dff 0%, #9c20fd 50%, #6a10b0 100%);
  box-shadow: 0 0 16px rgba(156, 32, 253, 0.5);
}
.bar--avg {
  background: linear-gradient(180deg, #ffffff 0%, #9ca3af 100%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
.bar-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--q-muted);
  margin-top: 10px;
}
.results-diff {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--q-muted);
  text-align: center;
  margin: 0;
  opacity: 0;
  transition: opacity 1000ms ease;
}
.results-diff .hl { font-weight: 700; color: var(--q-primary-2); }
.results-disclaimer,
.stat-disclaimer {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: rgba(156, 163, 175, 0.5);
  text-align: center;
  margin: 0;
}
.results-disclaimer { opacity: 0; transition: opacity 800ms ease; }

/* ---------- insights / reclaim stats ---------- */
.stat-header { margin-bottom: 36px; }
.stat-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  margin: 0 0 8px;
  color: #fff;
}
.stat-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--q-muted-2);
  margin: 0;
}
.stat-card { margin-bottom: 4px; }
.stat-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--q-muted);
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}
.stat-number-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 6px;
}
.stat-number {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 100px;
  line-height: 1;
}
.stat-unit {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 36px;
  opacity: 0.7;
  margin-bottom: 12px;
}
.stat-number--purple { color: var(--q-primary-2); text-shadow: 0 0 20px rgba(156, 32, 253, 0.5); }
.stat-unit--purple { color: var(--q-primary-2); }
.stat-number--white { color: #fff; text-shadow: 0 0 16px rgba(255, 255, 255, 0.25); }
.stat-unit--white { color: #fff; }
.stat-number--green { color: var(--q-green); text-shadow: 0 0 20px rgba(34, 197, 94, 0.45); }
.stat-unit--green { color: var(--q-green); }
.stat-context {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--q-muted-2);
  margin: 0;
}
.stat-divider {
  height: 1px;
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  margin: 24px 0 28px;
}
.stat-card--second { animation: quizFadeIn 400ms ease both; }
.quiz-footer--stat { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- completion ---------- */
.done-wrap { text-align: center; }
.done-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  background: linear-gradient(135deg, var(--q-green-2) 0%, var(--q-green-3) 100%);
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.5);
}
.done-title {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 44px;
  letter-spacing: 0.04em;
  color: #fff;
  margin: 0 0 12px;
}
.done-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--q-muted);
  line-height: 1.5;
  margin: 0 0 32px;
  padding: 0 8px;
}
.done-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 10px;
  transition: transform 150ms ease, filter 150ms ease;
}
.done-badge:hover { transform: translateY(-2px); filter: drop-shadow(0 8px 18px rgba(185, 104, 255, 0.35)); }
.done-badge img { height: 92px; width: auto; margin: -8px 0; }
.done-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--q-muted-2);
  margin: 16px 0 0;
}

/* ---------- account form ---------- */
.account-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.form-field { width: 100%; }
.form-error {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #f87171;
  margin: 4px 0 0;
  min-height: 18px;
}
.status-ok { color: var(--q-green) !important; font-weight: 700; }

/* ---------- plan cards ---------- */
.plan-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.plan-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 18px 16px;
  border-radius: 14px;
  border: 2px solid rgba(156, 32, 253, 0.2);
  background: rgba(156, 32, 253, 0.08);
  color: #fff;
  transition: background 120ms ease, border-color 120ms ease;
}
.plan-card:hover { border-color: rgba(156, 32, 253, 0.5); }
.plan-card.is-selected {
  border-color: var(--q-primary-2);
  background: rgba(156, 32, 253, 0.18);
}
.plan-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-card.is-selected .plan-radio { border-color: var(--q-primary-2); }
.plan-card.is-selected .plan-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--q-primary-2);
}
.plan-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.plan-name { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 16px; color: #fff; }
.plan-note { font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--q-muted); }
.plan-price { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; }
.plan-amount { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 28px; line-height: 1; color: #fff; letter-spacing: 0.02em; }
.plan-per { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--q-muted); }
.plan-badge {
  position: absolute;
  top: -10px;
  right: 14px;
  background: linear-gradient(135deg, var(--q-primary) 0%, var(--q-primary-2) 100%);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

/* fade utility used by JS */
.fade-up { opacity: 0; animation: quizFadeIn 600ms ease forwards; }

/* Respect reduced-motion: snap animations and guarantee content is visible
   so nothing that fades/slides in can be left stuck invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .intro-title .ltr,
  .intro-sub,
  .quiz-btn,
  .quiz-question,
  .option,
  .choice-card,
  .bar-pct,
  .results-diff,
  .results-disclaimer { opacity: 1 !important; }
}

/* ---------- desktop niceties ---------- */
@media (min-width: 480px) {
  #quiz-root {
    margin-top: 24px;
    margin-bottom: 24px;
    min-height: calc(100vh - 48px);
    min-height: calc(100dvh - 48px);
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
  .quiz-screen { border-radius: 28px; }
}
