@font-face {
  font-family: "Outfit";
  src: url("fonts/Outfit-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Anton";
  src: url("fonts/Anton-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b1020;
  --bg-deep: #050916;
  --card: #08142c;
  --card-border: rgba(255, 255, 255, 0.055);
  --icon-well: #171d36;
  --text: #f5f6fb;
  --muted: #8b8ca8;
  --muted-2: #6e7190;
  --orange: #ff6a1a;
  --orange-hot: #ff3d2e;
  --orange-btn: #ff5310;
  --orange-deep: #e63208;
  --glow: rgba(255, 80, 16, 0.55);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 56px;
  --tab-h: 68px;
  --radius-card: 22px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  color-scheme: dark;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

button, a { font-family: inherit; }

img, svg { display: block; }

.hidden { display: none !important; }

#app {
  height: 100dvh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 60, 20, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(255, 80, 20, 0.05), transparent 50%),
    var(--bg);
  overflow: hidden;
}

/* ========== Header ========== */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + var(--safe-top)) 16px 8px;
  min-height: calc(var(--header-h) + var(--safe-top));
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 8px rgba(255, 80, 20, 0.7));
}

.brand-name {
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.brand-name span { color: #ff4d1a; }

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  cursor: pointer;
}

.icon-btn:active { background: rgba(255,255,255,0.06); }

.icon-btn svg { width: 24px; height: 24px; }

/* ========== Views ========== */
.view {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px 24px;
  position: relative;
}

.view.has-tabs {
  padding-bottom: calc(24px + var(--tab-h) + var(--safe-bottom));
}

/* ========== Landing ========== */
#view-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  padding-bottom: 48px;
}

.hero-flame {
  width: 112px;
  height: 112px;
  margin: 8px auto 28px;
  filter:
    drop-shadow(0 0 18px rgba(255, 90, 20, 0.85))
    drop-shadow(0 0 48px rgba(255, 50, 16, 0.45));
  animation: pulse-flame 2.8s ease-in-out infinite;
}

@keyframes pulse-flame {
  0%, 100% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 18px rgba(255, 90, 20, 0.85)) drop-shadow(0 0 48px rgba(255, 50, 16, 0.45)); }
  50% { transform: scale(1.05) translateY(-3px); filter: drop-shadow(0 0 26px rgba(255, 110, 20, 1)) drop-shadow(0 0 60px rgba(255, 50, 16, 0.6)); }
}

.headline {
  font-size: clamp(1.85rem, 8vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
  max-width: 20ch;
  margin: 0 auto 16px;
}

.brand-line {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 26ch;
  margin: 0 auto 32px;
}

.brand-line em {
  font-style: normal;
  color: #ff8a4a;
  font-weight: 600;
}

.cta {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  min-height: 58px;
  padding: 16px 22px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  background: linear-gradient(180deg, #ff7a1a 0%, #ff4a12 55%, #e63208 100%);
  box-shadow:
    0 8px 28px rgba(255, 70, 10, 0.48),
    0 0 0 1px rgba(255, 180, 80, 0.15) inset,
    0 -2px 8px rgba(160, 20, 0, 0.25) inset;
  text-decoration: none;
}

.cta:active { transform: scale(0.985); }

.trust {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.trust strong {
  color: var(--muted);
  font-weight: 600;
}

/* ========== Quiz ========== */
.quiz-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.quiz-progress-row .back {
  flex: 0 0 auto;
}

.progress-label {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 28px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6a1a, #ff3d2e);
  box-shadow: 0 0 12px rgba(255, 80, 20, 0.55);
  transition: width 0.28s ease;
}

.q-title {
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.25;
  margin-bottom: 8px;
}

.q-hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 22px;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer {
  appearance: none;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  text-align: left;
  border-radius: 16px;
  padding: 16px 18px;
  min-height: 58px;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.answer:active { transform: scale(0.99); }

.answer.selected {
  border-color: var(--orange);
  background: linear-gradient(180deg, rgba(255, 90, 20, 0.16), rgba(255, 60, 20, 0.07));
  box-shadow: 0 0 0 1px rgba(255, 90, 20, 0.35);
}

/* ========== Scanning ========== */
#view-scanning {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.scan-flame {
  width: 88px;
  height: 88px;
  margin-bottom: 22px;
  filter: drop-shadow(0 0 20px rgba(255, 80, 20, 0.9));
  animation: pulse-flame 1.2s ease-in-out infinite;
}

.scan-title {
  font-size: 1.4rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.scan-sub {
  color: var(--muted);
  margin-bottom: 28px;
}

.scan-list {
  list-style: none;
  width: 100%;
  max-width: 280px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scan-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 0.95rem;
  font-weight: 550;
  opacity: 0;
  transform: translateY(6px);
  animation: scan-in 0.4s ease forwards;
}

.scan-list li.on { color: var(--text); }

.scan-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.scan-list li.on .scan-dot {
  border-color: var(--orange);
  background: var(--orange);
}

.scan-list li.on .scan-dot svg { opacity: 1; }

.scan-dot svg { width: 10px; height: 10px; opacity: 0; }

@keyframes scan-in {
  to { opacity: 1; transform: none; }
}

/* ========== Results ========== */
.results-kicker {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.15;
  margin: 8px 0 8px;
}

.results-sub {
  color: var(--muted);
  font-size: 0.98rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sparkle {
  color: #ffb04a;
  filter: drop-shadow(0 0 6px rgba(255, 160, 40, 0.7));
}

.yearly-wrap {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.28em;
  margin: 4px 0 28px;
  isolation: isolate;
}
.yearly-wrap::before {
  content: "";
  position: absolute;
  left: -8%;
  right: 10%;
  top: -30%;
  bottom: -40%;
  background: radial-gradient(ellipse at 35% 50%, rgba(255, 70, 16, 0.32), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.yearly-wrap .embers {
  position: absolute;
  inset: -30px -20px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ember {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ff8a3a;
  box-shadow: 0 0 8px 2px rgba(255, 90, 20, 0.7);
  animation: rise 3.8s linear infinite;
  opacity: 0;
}

@keyframes rise {
  0% { transform: translateY(40px) scale(0.6); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-90px) scale(1.1); opacity: 0; }
}

.yearly-amount,
.yearly-unit {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #ffb04a 0%, #ff7a28 28%, #ff4e14 78%, #ff3d2e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter:
    drop-shadow(0 0 16px rgba(255, 90, 20, 0.85))
    drop-shadow(0 0 42px rgba(255, 50, 16, 0.45));
}

.yearly-amount {
  font-size: clamp(3.4rem, 16vw, 4.7rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.yearly-unit {
  font-size: clamp(1.5rem, 6.5vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.flare-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.flare-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 14px 12px 14px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.flare-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--icon-well);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.flare-icon svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 6px rgba(255, 70, 20, 0.8));
}

.flare-body { flex: 1 1 auto; min-width: 0; }

.flare-title {
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.flare-amt {
  color: #ff5a18;
  font-weight: 650;
  font-size: 0.95rem;
}

.fix-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff6a1a 0%, #ff4310 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 14px rgba(255, 70, 10, 0.35);
  white-space: nowrap;
}

.fix-btn:active { transform: scale(0.98); }

.clean-state {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 22px 18px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 18px;
}

.clean-state strong { color: var(--text); display: block; margin-bottom: 6px; font-size: 1.05rem; }

.share-btn {
  width: 100%;
  margin: 6px 0 120px;
  min-height: 58px;
}

.share-btn svg { width: 20px; height: 20px; }

/* Email capture */
.alert-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 18px 16px 16px;
  margin-bottom: 20px;
}

.alert-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.alert-card p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.email-row {
  display: flex;
  gap: 8px;
}

.email-row input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #050b18;
  color: var(--text);
  padding: 0 12px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.email-row input:focus {
  border-color: var(--orange);
}

.email-row button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  min-height: 46px;
  background: linear-gradient(180deg, #ff6a1a 0%, #ff4310 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.todo-note {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted-2);
  line-height: 1.4;
}

.alert-card.thanks p { margin: 0; color: var(--text); }

/* Legal on results */
.ftc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.footer-legal {
  font-size: 0.75rem;
  color: var(--muted-2);
  line-height: 1.55;
  padding-bottom: 12px;
}

.footer-legal a { color: #a8aac0; }

.footer-links { margin-top: 8px; }

/* ========== Tab bar ========== */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(5, 10, 24, 0.92), #050916 40%);
  border-top: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
}

.tabbar.hidden { display: none; }

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #8a8aa0;
  width: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
}

.tab svg { width: 24px; height: 24px; }

.tab.active { color: #ff4d1a; }

/* ========== Menu drawer ========== */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.backdrop.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: #0c1228;
  z-index: 50;
  padding: calc(16px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
  transform: translateX(110%);
  transition: transform 0.25s ease;
  box-shadow: -12px 0 40px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer.show { transform: none; }

.drawer h2 {
  font-size: 1.1rem;
  margin: 8px 0 16px;
}

.drawer a, .drawer button.linkish {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  text-decoration: none;
  padding: 14px 10px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.drawer a:active, .drawer button.linkish:active {
  background: rgba(255,255,255,0.06);
}

/* ========== Share modal ========== */
#share-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #070916;
  display: flex;
  flex-direction: column;
  padding: calc(12px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
}

#share-modal.hidden { display: none !important; }

.share-preview-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin-bottom: 16px;
}

#share-canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.5);
  background: #0a0834;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}

.btn-secondary {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: #141a2e;
  color: var(--text);
  min-height: 48px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.98rem;
  cursor: pointer;
  width: 100%;
}

/* Coming soon */
.soon {
  text-align: center;
  padding: 48px 12px;
  color: var(--muted);
}

.soon h2 { color: var(--text); margin-bottom: 8px; font-size: 1.4rem; }

/* Legal pages (standalone) */
body.legal-page {
  overflow: auto;
}

body.legal-page #app {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}

.legal {
  max-width: 40rem;
  margin: 0 auto;
  padding: 12px 20px calc(48px + var(--safe-bottom));
}

.legal h1 {
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  margin: 12px 0 16px;
}

.legal h2 {
  font-size: 1.1rem;
  margin: 24px 0 8px;
}

.legal p, .legal li {
  color: #c5c7d8;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.legal ul { padding-left: 1.2em; }

.legal a { color: #ff8a4a; }

@media (min-width: 720px) {
  .view { padding-left: 28px; padding-right: 28px; }
  .headline { font-size: 2.6rem; }
}
