:root {
  --bg-1: #eef2ff;
  --bg-2: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --yes: #16a34a;
  --no: #94a3b8;
  --ring: rgba(79, 70, 229, 0.35);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-1), transparent 60%),
              linear-gradient(180deg, var(--bg-2), #eef1f7);
  min-height: 100vh;   /* fallback */
  min-height: 100dvh;  /* dynamic viewport height: follows the mobile address bar */
  display: grid;
  place-items: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

/* Confetti overlay */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.card {
  width: 100%;
  max-width: 620px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.28),
              0 8px 20px -12px rgba(15, 23, 42, 0.18);
  padding: clamp(28px, 6vw, 56px);
}

.screen { display: none; }
.screen.active {
  display: block;
  animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

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

h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin: 18px 0 26px;
  font-size: clamp(1.3rem, 4vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 28px;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  line-height: 1.6;
  color: var(--muted);
}

/* Progress */
.progress {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
#progressBar {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  transition: width 0.4s ease;
}

.qcount {
  margin: 16px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* "What next?" action box */
.whatnext {
  margin: 24px 0 30px;
  padding: 20px 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f5f3ff, #eef2ff);
  border: 1px solid #e4e2ff;
}
.whatnext-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.whatnext-text {
  margin: 0 0 14px;
  font-size: 0.98rem;
  line-height: 1.55;
}
.next-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.next-links a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e4e2ff;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.next-links a::after { content: " \2192"; opacity: 0.6; }
.next-links a:hover { border-color: var(--accent); box-shadow: 0 8px 18px -14px var(--ring); }
.next-links a:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

/* Buttons */
.answers {
  display: flex;
  gap: 14px;
  margin-top: 30px;
}

.btn {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 15px 26px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn.primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  box-shadow: 0 12px 24px -10px var(--ring);
}
.btn.primary:hover { filter: brightness(1.05); }

.answers .btn { flex: 1; background: #fff; color: var(--ink); border-color: #e2e8f0; }
.answers .btn.yes:hover { border-color: var(--yes); color: var(--yes); box-shadow: 0 10px 22px -14px rgba(22,163,74,.5); }
.answers .btn.no:hover  { border-color: #cbd5e1; background: #f8fafc; }

.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

/* Locale / regional picker */
.locale-picker {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.locale-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
a.locale-option:hover { color: var(--accent); border-color: var(--accent); }
.locale-option.current {
  color: var(--accent);
  border-color: var(--accent);
  background: #f5f3ff;
}

@media (max-width: 460px) {
  .answers { flex-direction: column; }
}
