@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* Colors mirror the app's onboarding (src/components/OnboardingV2/theme.js). */
:root {
  --bg: #faf9f6;
  --bg-fade: rgba(250, 249, 246, 0);
  --ink: #0b0707;
  --muted: #8a8a94;
  --faint: #9ca3af;
  --line: #ece9e2;
  --surface: #ffffff;
  --primary: #fe5b25;
  --primary-soft: #ffe4d9;
  --secondary: #009feb;
  --track: #e5e2db;
  --green: #57ad55;
  /* CTA_GRADIENT: the logo's own ramp. */
  --gradient: linear-gradient(90deg, #C7095B 0%, #F81460 28%, #FA4E4D 55%, #FD773C 78%, #FEA52A 100%);
  --gradient-diag: linear-gradient(135deg, #C7095B 0%, #F81460 28%, #FA4E4D 55%, #FD773C 78%, #FEA52A 100%);
  --content: 672px; /* MAX_CONTENT_WIDTH */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body {
  height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: Inter, -apple-system, "SF Pro Text", system-ui, sans-serif; font-size: 16px;
  padding-top: env(safe-area-inset-top);
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; height: 28px; margin: 6px auto 0;
  width: min(100% - 40px, var(--content) - 60px); transition: opacity 0.3s;
}
.topbar.gone { opacity: 0; pointer-events: none; }
.back, .slot { width: 36px; flex: none; display: flex; align-items: center; }
.back { height: 36px; margin-left: -6px; padding-left: 6px; color: var(--ink); transition: opacity 0.2s; }
.back.off { opacity: 0; pointer-events: none; }
.track { position: relative; flex: 1; height: 5px; border-radius: 999px; background: #d1d5db; overflow: hidden; }
/* The gradient spans the FULL track and is revealed by the clip, so the ramp
   advances with progress instead of being squeezed into the filled part. */
.track-fill {
  position: absolute; inset: 0; border-radius: 999px; background: var(--gradient);
  clip-path: inset(0 100% 0 0 round 999px); transition: clip-path 0.5s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- steps ---------- */
.viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.step { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.step-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  width: 100%; max-width: var(--content); margin: 0 auto; padding: 34px 20px 140px;
}
.step-scroll.center { display: flex; flex-direction: column; }
.step h1 { margin: 0; font-size: 29px; line-height: 35px; font-weight: 700; letter-spacing: -0.4px; }
.step .sub { margin: 6px 0 28px; color: var(--muted); font-size: 15px; }

/* ---------- CTA (onboarding "secondary" button: gradient pill, 62px) ---------- */
.cta-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none;
  padding: 40px 20px calc(max(env(safe-area-inset-bottom), 12px) + 8px);
  background: linear-gradient(to top, var(--bg) 62%, var(--bg-fade));
}
.cta {
  pointer-events: auto; display: block; width: 100%; max-width: calc(var(--content) - 40px); margin: 0 auto;
  height: 62px; border-radius: 999px; color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 0.1px;
  background: var(--gradient-diag);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.5),
    inset 0 -12px 16px rgba(255, 255, 255, 0.22),
    inset 0 10px 16px rgba(140, 5, 60, 0.28);
  transition: transform 0.12s, filter 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.cta:active { transform: scale(0.97); }
.cta:disabled { background: #d1d5db; color: #6b7280; box-shadow: none; }
.cta:disabled:active { transform: none; }

/* ---------- options (app's Option.jsx: white card, 2px primary border when picked) ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.list { display: flex; flex-direction: column; gap: 14px; }
.option {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface); border: 2px solid var(--surface); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 12, 8, 0.06), 0 2px 10px rgba(16, 12, 8, 0.05);
  font-size: 17px; font-weight: 500; text-align: left; color: var(--ink);
  transition: border-color 0.18s, color 0.18s, transform 0.12s, background 0.18s;
}
.option:active { transform: scale(0.98); }
.option.row { min-height: 64px; padding: 0 52px 0 18px; }
.option.tile { flex-direction: column; justify-content: center; gap: 10px; min-height: 108px; padding: 14px 10px; text-align: center; font-size: 15px; line-height: 19px; }
.option .emoji { font-size: 26px; line-height: 1; }
.option.row .emoji { font-size: 22px; width: 28px; text-align: center; }
.option.selected { border-color: var(--primary); color: var(--primary); background: #fffaf7; }
.option .check {
  position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--primary);
  display: grid; place-items: center; transform: scale(0); opacity: 0;
  transition: transform 0.32s cubic-bezier(.34, 1.56, .64, 1), opacity 0.2s;
}
.option.row .check { right: 16px; top: calc(50% - 11px); }
.option.tile .check { right: 10px; top: 10px; }
.option.selected .check { transform: scale(1); opacity: 1; }
.option.dim { opacity: 0.45; }

/* ---------- exam date ---------- */
.exam { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 40px; }
.days { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.days b { font-size: 112px; line-height: 1; font-weight: 800; letter-spacing: -5px; font-variant-numeric: tabular-nums; }
.days span { font-size: 22px; font-weight: 500; color: var(--muted); }
.exam-date { text-align: center; color: var(--muted); font-size: 16px; margin: 14px 0 52px; }
.exam-date strong { color: var(--primary); font-weight: 600; }
.slider { position: relative; height: 36px; }
.slider .rail, .slider .rail-fill { position: absolute; left: 0; right: 0; top: 15px; height: 6px; border-radius: 999px; }
.slider .rail { background: var(--track); }
.slider .rail-fill { background: var(--gradient); }
.slider input {
  position: absolute; inset: 0; width: 100%; margin: 0; background: none;
  -webkit-appearance: none; appearance: none; touch-action: none;
}
.slider input::-webkit-slider-runnable-track { height: 36px; background: transparent; }
.slider input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: 3px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.slider input::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.slider input::-moz-range-track { background: transparent; }
.slider-labels { display: flex; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 14px; }

/* ---------- lectures illustration ---------- */
.lectures { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 30px; }
.lecture-art { position: relative; width: 290px; height: 230px; animation: float 5s ease-in-out infinite; }
.slide {
  position: absolute; width: 196px; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  box-shadow: 0 2px 4px rgba(16, 12, 8, 0.05), 0 12px 28px rgba(16, 12, 8, 0.09);
  font-size: 11px; font-weight: 600; color: #4b4b55;
}
.slide .title { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.slide .title span { overflow: hidden; text-overflow: ellipsis; }
.slide .title i { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.6px solid var(--primary); }
.slide.s1 { left: 0; top: 0; transform: rotate(-7deg); }
.slide.s2 { right: 0; top: 34px; transform: rotate(5deg); z-index: 1; }
.slide.s3 { left: 36px; top: 110px; transform: rotate(-2deg); z-index: 2; height: 108px; display: flex; align-items: flex-end; gap: 8px; }
.lines { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.lines span { height: 5px; border-radius: 3px; background: #efece6; }
.lines span:nth-child(2) { width: 82%; }
.lines span:nth-child(3) { width: 64%; }
.flow { display: flex; align-items: center; gap: 0; margin-top: 14px; }
.flow span { width: 26px; height: 18px; border: 1.6px solid #c9c4bb; border-radius: 5px; }
.flow span:last-child { border-color: var(--primary); background: var(--primary-soft); }
.flow em { flex: 1; height: 1.6px; background: #c9c4bb; }
.slide.s3 span { flex: 1; border-radius: 4px 4px 2px 2px; background: #efece6; }
.slide.s3 span:nth-child(4) { background: var(--gradient-diag); }
.formats { margin-top: 26px; color: var(--muted); font-size: 14px; letter-spacing: 0.2px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- reading your slides ---------- */
.reading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 24px; }
.orbit-wrap { position: relative; width: 270px; height: 270px; margin: 10px 0 18px; }
.orbit { position: absolute; inset: 0; animation: spin 26s linear infinite; }
.orbit-item {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  transform: rotate(var(--a)) translateY(-112px) rotate(calc(-1 * var(--a)));
}
.orbit-item span {
  display: grid; place-items: center; width: 100%; height: 100%; font-size: 26px;
  animation: spin 26s linear infinite reverse, pop 0.5s cubic-bezier(.34, 1.56, .64, 1) both;
  animation-delay: 0s, var(--d);
}
.core {
  position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(250, 78, 77, 0.18), 0 2px 6px rgba(16, 12, 8, 0.06);
}
.core::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; background: var(--gradient-diag);
  opacity: 0.18; animation: pulse 1.8s ease-in-out infinite; z-index: -1;
}
.core img { width: 50px; height: 50px; }
.pct { font-size: 34px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.found { margin-top: 4px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.checks {
  list-style: none; margin: 34px 0 0; padding: 18px 20px; width: 100%; border-radius: 16px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(16, 12, 8, 0.05), 0 2px 10px rgba(16, 12, 8, 0.04);
  display: flex; flex-direction: column; gap: 16px;
}
.checks li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--faint); transition: color 0.3s; }
.checks li.active, .checks li.done { color: var(--ink); }
.checks .mark {
  position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #dedad3;
  display: grid; place-items: center; transition: background 0.25s, border-color 0.25s;
}
.checks li.active .mark { border-color: rgba(254, 91, 37, 0.22); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
.checks li.done .mark { border-color: var(--primary); background: var(--primary); animation: none; }
.checks .mark svg { opacity: 0; transform: scale(0.4); transition: 0.3s cubic-bezier(.34, 1.56, .64, 1); }
.checks li.done .mark svg { opacity: 1; transform: scale(1); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.12); opacity: 0.08; } }
@keyframes pop { from { transform: scale(0); opacity: 0; } }

/* ---------- study plan (single page) ---------- */
.final { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 12px; }
.plan-art { position: relative; width: 300px; height: 260px; margin-bottom: 18px; }
.plan-glow {
  position: absolute; inset: -40px -60px; pointer-events: none;
  background:
    radial-gradient(closest-side at 36% 48%, rgba(248, 20, 96, 0.20), transparent),
    radial-gradient(closest-side at 64% 52%, rgba(254, 165, 42, 0.26), transparent);
  filter: blur(18px); animation: breathe 4s ease-in-out infinite;
}
.ring-wrap { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; }
.ring { width: 100%; height: 100%; display: block; }
.ring-draw { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 1.1s 0.25s cubic-bezier(.6, 0, .3, 1) forwards; }
.plan-core {
  position: absolute; left: 50%; top: 50%; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center;
  box-shadow: 0 14px 34px rgba(250, 78, 77, 0.20), 0 2px 6px rgba(16, 12, 8, 0.06);
  animation: pop 0.6s cubic-bezier(.34, 1.56, .64, 1) both;
}
.plan-core img { width: 60px; height: 60px; }
.plan-check {
  position: absolute; right: 2px; bottom: 6px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gradient-diag); border: 3px solid var(--surface);
  animation: pop 0.5s 1.25s cubic-bezier(.34, 1.56, .64, 1) both;
}
.plan-check svg { width: 16px; height: 16px; }
.plan-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px 8px 10px; border-radius: 999px;
  background: var(--surface); font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 12, 8, 0.06), 0 6px 18px rgba(16, 12, 8, 0.08);
  animation: pop 0.5s var(--d) cubic-bezier(.34, 1.56, .64, 1) both, bob 3.2s calc(var(--d) + 0.5s) ease-in-out infinite;
}
.plan-chip i { font-style: normal; font-size: 15px; }
.plan-chip.tl { left: 0; top: 22px; }
.plan-chip.tr { right: 0; top: 50px; }
.plan-chip.bl { left: 6px; bottom: 44px; }
.plan-chip.br { right: 4px; bottom: 14px; }
.final-title { margin: 0 !important; font-size: 30px !important; line-height: 36px !important; }
.final-sub { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 21px; max-width: 320px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 420px; margin-top: 26px; }
.stat { background: var(--surface); border-radius: 16px; padding: 14px 8px; box-shadow: 0 1px 2px rgba(16, 12, 8, 0.05), 0 2px 10px rgba(16, 12, 8, 0.04); }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.8px; line-height: 30px; }
.stat b.grad { background: var(--gradient-diag); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 16px; }
.rise { opacity: 0; animation: rise 0.6s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 110ms + 700ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes breathe { 50% { opacity: 0.7; transform: scale(1.05); } }

.confetti { position: fixed; top: -20px; width: 9px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 10; }
