:root {
  --bg: #07090f;
  --panel: rgba(15, 19, 31, 0.82);
  --panel-strong: #101522;
  --text: #f6f8ff;
  --muted: #9aa4b8;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #38d6a6;
  --accent-strong: #2cf5b4;
  --warning: #ffcc66;
  --danger: #ff6b7a;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(56, 214, 166, 0.16), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(255, 204, 102, 0.11), transparent 26%),
    linear-gradient(135deg, #07090f 0%, #0d111c 48%, #07090f 100%);
}

/* FIX: remove mobile blue highlight */
button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px 16px;
  position: relative;
}

.view {
  display: none;
  width: min(100%, 760px);
  animation: viewIn 420ms ease both;
}

.view.active {
  display: block;
}

.hero {
  min-height: calc(100vh - 64px);
  place-items: center;
  position: relative;
}

.hero.active {
  display: grid;
}

.hero-content,
.quiz-card,
.loading-view,
.result-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 23, 36, 0.88), rgba(10, 13, 22, 0.86));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-content {
  width: min(100%, 900px);
  padding: clamp(42px, 8vw, 86px) clamp(22px, 6vw, 72px);
  text-align: center;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-inline: auto;
  margin-bottom: 18px;
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  line-height: 0.94;
}

.subheadline {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.primary-button {
  min-height: 60px;
  padding: 0 26px;
  border: 0;
  border-radius: 8px;
  color: #03110c;
  background: linear-gradient(135deg, var(--accent-strong), #9dffce);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(44, 245, 180, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
}

.primary-button:active {
  transform: scale(0.98);
  opacity: 0.95;
}

.quiz-card,
.loading-view,
.result-card {
  border-radius: 8px;
  padding: clamp(22px, 5vw, 42px);
}

/* Quiz progress */
.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

#progressPercent {
  color: var(--accent-strong);
}

.progress-track {
  height: 8px;
  margin-bottom: clamp(24px, 4vw, 38px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
}

.progress-fill {
  width: 13%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong), var(--warning));
  box-shadow: 0 0 24px rgba(56, 214, 166, 0.28);
  transition: width 360ms ease;
}

.options-grid {
  display: grid;
  gap: 10px;
}

.option-button {
  width: 100%;
  min-height: 64px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

/* Keep mobile taps from leaving a sticky selected/focus state on the next question. */
.option-button:focus,
.option-button:focus-visible {
  outline: none;
}

.option-button.is-selected {
  transform: scale(0.98);
  border-color: rgba(56, 214, 166, 0.7);
  background: rgba(56, 214, 166, 0.11);
}

.option-button:disabled {
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .option-button:hover {
    transform: translateX(4px);
    border-color: rgba(56, 214, 166, 0.7);
    background: rgba(56, 214, 166, 0.11);
  }
}

@media (hover: none) {
  .option-button:hover,
  .option-button:focus,
  .option-button:focus-visible {
    transform: none;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.045);
  }
}

/* rest unchanged */

.score-ring {
  --score: 62%;
  display: grid;
  width: 132px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
}

.cta-pretext {
  margin: 2px auto 10px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.result-card > .primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 420px);
  margin: 12px auto 10px;
}

.result-card .cta-note {
  margin: 0 auto 18px;
  max-width: 480px;
}

.result-card .reason-box {
  margin-top: 0;
}

.risk-high {
  color: var(--danger);
}

.risk-medium {
  color: var(--warning);
}

.risk-low {
  color: var(--accent-strong);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Result layout and selected-state refinements */
.loading-view,
.result-card {
  text-align: center;
}

.loading-steps {
  display: grid;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
  padding: 0;
  color: var(--muted);
  line-height: 1.45;
  list-style: none;
}

.loading-steps li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.score-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 22px;
  margin: 0 0 18px;
  text-align: left;
}

.score-ring {
  --score: 62%;
  display: grid;
  width: 140px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--panel-strong) 0 58%, transparent 59%),
    conic-gradient(var(--accent-strong) var(--score), rgba(255, 255, 255, 0.09) 0);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.28);
}

.score-ring.risk-high {
  background:
    radial-gradient(circle at center, var(--panel-strong) 0 58%, transparent 59%),
    conic-gradient(var(--danger) var(--score), rgba(255, 255, 255, 0.09) 0);
}

.score-ring.risk-medium {
  background:
    radial-gradient(circle at center, var(--panel-strong) 0 58%, transparent 59%),
    conic-gradient(var(--warning) var(--score), rgba(255, 255, 255, 0.09) 0);
}

.score-ring span {
  color: var(--text);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.score-copy h2 {
  margin-bottom: 10px;
}

.score-copy p,
.cta-note {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.score-copy p {
  margin-bottom: 0;
}

.reason-box {
  margin: 20px 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
}

.reason-box h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.reason-box ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.reason-box li::marker {
  color: var(--accent);
}

.result-card > .primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 420px);
  margin: 16px auto 10px;
}

.result-card .cta-note {
  max-width: 480px;
  margin: 0 auto;
}

.option-button.is-selected {
  transform: scale(0.98);
  border-color: rgba(56, 214, 166, 0.7);
  background: rgba(56, 214, 166, 0.11);
}

@media (hover: none) {
  .option-button.is-selected {
    transform: scale(0.98);
    border-color: rgba(56, 214, 166, 0.7);
    background: rgba(56, 214, 166, 0.11);
  }
}

@media (max-width: 560px) {
  /* Mobile landing position */
  .page-shell {
    min-height: 100svh;
    place-items: start center;
    padding: max(18px, env(safe-area-inset-top)) 14px 18px;
  }

  .hero {
    min-height: auto;
    width: 100%;
  }

  .hero.active {
    display: grid;
    place-items: start center;
  }

  .hero-content {
    margin-top: 0;
  }

  .quiz-topline {
    margin-bottom: 10px;
    font-size: 0.84rem;
  }

  .progress-track {
    height: 7px;
    margin-bottom: 22px;
  }

  .result-card {
    padding: 22px 16px;
  }

  .result-card .eyebrow {
    margin-bottom: 12px;
  }

  .score-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
    margin-bottom: 14px;
    text-align: center;
  }

  .score-ring {
    width: 112px;
  }

  .score-ring span {
    font-size: 1.9rem;
  }

  .score-copy h2 {
    margin-bottom: 8px;
    font-size: 1.55rem;
  }

  .score-copy p,
  .cta-note {
    font-size: 0.93rem;
    line-height: 1.45;
  }

  .reason-box {
    margin: 16px 0 14px;
    padding: 14px;
  }

  .reason-box h3 {
    margin-bottom: 10px;
  }

  .reason-box ul {
    gap: 8px;
    padding-left: 18px;
    font-size: 0.9rem;
  }

  .result-card > .primary-button {
    width: 100%;
    margin: 14px auto 8px;
  }
}


/* Email capture step */
.email-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 42px);
  background: linear-gradient(180deg, rgba(18, 23, 36, 0.88), rgba(10, 13, 22, 0.86));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  text-align: center;
}

.email-card h2 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.08;
}

.email-copy,
.form-note,
.form-error,
.form-success {
  max-width: 520px;
  margin-inline: auto;
  color: var(--muted);
  line-height: 1.55;
}

.email-copy {
  margin-bottom: 22px;
  font-size: 1rem;
}

.email-form {
  display: grid;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
}

.email-form input[type="email"] {
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.email-form input[type="email"]::placeholder {
  color: rgba(154, 164, 184, 0.82);
}

.email-form input[type="email"]:focus {
  border-color: rgba(56, 214, 166, 0.75);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 4px rgba(56, 214, 166, 0.1);
}

.email-form .primary-button {
  width: 100%;
}

.open-plan-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 440px);
  margin: 16px auto 0;
  text-decoration: none;
}

.open-plan-button[hidden] {
  display: none !important;
}

.email-form .primary-button:disabled {
  cursor: wait;
  filter: saturate(0.8);
  opacity: 0.78;
}

.form-note {
  margin-top: 12px;
  font-size: 0.9rem;
}

.form-success {
  margin-top: 18px;
  color: var(--accent-strong);
  font-weight: 700;
}

.form-error {
  margin-top: 18px;
  color: var(--danger);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .email-card {
    padding: 22px 16px;
  }

  .email-card .eyebrow {
    margin-bottom: 12px;
  }

  .email-card h2 {
    margin-bottom: 12px;
    font-size: 1.65rem;
  }

  .email-copy {
    margin-bottom: 18px;
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .email-form input[type="email"] {
    min-height: 60px;
  }
}
