:root {
  --ink: #0D1014;
  --blue-deep: #0078D4;
  --blue: #149fff;
  --blue-light: #4DAAFC;
  --white: #FFFFFF;
  --surface: #10151b;
  --surface-2: #161d25;
  --border: rgba(255,255,255,0.08);
  --text-dim: rgba(255,255,255,0.65);
  --text-faint: rgba(255,255,255,0.45);
  --radius: 16px;
  --shadow-glow: 0 0 0 1px rgba(20,159,255,0.15), 0 20px 60px -20px rgba(20,159,255,0.35);
  --ease: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 20% -10%, #132030 0%, var(--ink) 45%) fixed;
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
p { margin: 0 0 16px; }
ul { margin: 0; padding: 0; list-style: none; }
em { color: var(--blue-light); font-style: normal; }

.container { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13,16,20,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.logo span { color: var(--blue); }
.header-progress { display: none; align-items: center; gap: 12px; flex: 1; max-width: 320px; }
.header-progress.show { display: flex; }
.header-progress-track { flex: 1; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.header-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue-deep), var(--blue), var(--blue-light)); border-radius: 999px; transition: width .4s var(--ease); }
.header-progress-label { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }

/* ---------- Screens ---------- */
.screen { display: none; padding: 64px 0 96px; animation: fadeIn .5s var(--ease); }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 14px 28px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  color: var(--white);
  box-shadow: 0 10px 30px -10px rgba(20,159,255,0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -8px rgba(20,159,255,0.7); background: linear-gradient(135deg, var(--blue), var(--blue-light)); }
.btn-primary:active { transform: translateY(0); }
.btn-large { padding: 16px 36px; font-size: 1.05rem; }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-light); }
.btn-text {
  background: none;
  color: var(--text-dim);
  padding: 10px 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-text:hover { color: var(--blue-light); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.is-loading .btn-spinner { display: inline-block; }
.is-loading .btn-label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Welcome screen ---------- */
.welcome-container { position: relative; text-align: center; padding-top: 24px; }
.welcome-glow {
  position: absolute;
  top: -120px; left: 50%; transform: translateX(-50%);
  width: 640px; height: 420px;
  background: radial-gradient(circle, rgba(20,159,255,0.35), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}
.eyebrow {
  display: inline-block;
  color: var(--blue-light);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(20,159,255,0.12);
  border: 1px solid rgba(20,159,255,0.3);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.welcome-container h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); max-width: 20ch; margin-left: auto; margin-right: auto; }
.lead { color: var(--text-dim); font-size: 1.08rem; max-width: 56ch; margin-left: auto; margin-right: auto; }
.micro { color: var(--text-faint); font-size: 0.85rem; margin-top: 12px; }

.pain-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 56px 0;
  text-align: left;
}
.pain-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.pain-num { display: block; font-size: 1.8rem; font-weight: 800; color: var(--blue-light); margin-bottom: 6px; }
.pain-text { color: var(--text-dim); font-size: 0.9rem; }

.services-grid { margin: 48px 0 40px; text-align: left; }
.services-grid h2 { text-align: center; font-size: 1.3rem; margin-bottom: 24px; }
.services-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.service-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.92rem;
}
.service-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-deep), var(--blue-light)); flex-shrink: 0; }

/* ---------- Quiz ---------- */
.quiz-container { padding-top: 8px; }
.step { display: none; border: none; margin: 0; padding: 0; animation: fadeIn .35s var(--ease); }
.step.active { display: block; }
.step-kicker { color: var(--blue-light); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.step h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
.step-sub { color: var(--text-dim); margin-top: -6px; }

.field-label { display: block; font-weight: 700; margin: 24px 0 8px; }
.optional { color: var(--text-faint); font-weight: 400; }
.text-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--white);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s;
}
.text-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,159,255,0.2); }
select.text-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%234DAAFC' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }

.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.option-grid.stacked { grid-template-columns: 1fr; }
.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 600;
  transition: border-color .15s, background .15s, transform .1s;
}
.option-card:hover { border-color: rgba(77,170,252,0.5); }
.option-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-card span { pointer-events: none; }
.option-card span::before {
  content: "";
  display: inline-block;
  width: 18px; height: 18px;
  margin-right: 10px;
  border-radius: 5px;
  border: 1.5px solid var(--text-faint);
  vertical-align: -4px;
  transition: all .15s;
}
.option-grid[data-type="radio"] .option-card span::before { border-radius: 50%; }
.option-card.selected {
  border-color: var(--blue);
  background: linear-gradient(135deg, rgba(20,159,255,0.14), rgba(0,120,212,0.08));
}
.option-card.selected span::before {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-light));
  border-color: var(--blue);
  box-shadow: inset 0 0 0 3px var(--surface);
}
.consent-card { margin-top: 22px; grid-template-columns: none; }

.error-text { color: #ff8080; font-weight: 600; font-size: 0.9rem; min-height: 1.2em; margin-top: 14px; }

.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; gap: 12px; }
.quiz-nav .btn-primary { margin-left: auto; }

/* ---------- Results ---------- */
.results-container { text-align: center; }
.results-badge {
  display: inline-block;
  color: var(--blue-light);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(20,159,255,0.12);
  border: 1px solid rgba(20,159,255,0.3);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}
#resultsHeadline { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }

.score-card {
  display: flex;
  align-items: center;
  gap: 28px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 32px 0;
}
.score-ring-wrap { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.score-ring { width: 140px; height: 140px; transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 10; }
.score-ring-fill { fill: none; stroke: var(--blue); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 377; stroke-dashoffset: 377; transition: stroke-dashoffset 1.1s var(--ease), stroke 1.1s; }
.score-ring-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px; line-height: 1; font-size: 2rem; font-weight: 800; }
.score-ring-value small { font-size: 0.9rem; color: var(--text-faint); font-weight: 600; align-self: flex-end; padding-bottom: 3px; }
.score-label { font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.score-desc { color: var(--text-dim); margin: 0; font-size: 0.95rem; }

.findings-card, .package-card, .confirm-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.findings-card h3 { font-size: 1.05rem; }
.findings-card ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.findings-card ul li::before {
  content: "";
  position: absolute; left: 0; top: 6px;
  width: 10px; height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-light));
}

.package-card { border-color: rgba(20,159,255,0.4); box-shadow: var(--shadow-glow); }
.package-eyebrow { color: var(--blue-light); font-weight: 700; text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.08em; margin-bottom: 4px; }
.package-card h2 { font-size: 1.6rem; }
.package-tagline { color: var(--text-dim); }
.package-services { margin: 18px 0; }
.package-services li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}
.package-services li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--blue-light);
  font-weight: 800;
}
.package-note { color: var(--text-faint); font-size: 0.85rem; margin: 0; }

.confirm-card { text-align: center; background: linear-gradient(135deg, rgba(20,159,255,0.12), rgba(0,120,212,0.06)); }
.confirm-card p { margin: 0; font-weight: 600; }
.confirm-card .micro { margin-top: 8px; font-weight: 400; }

#restartBtn { display: block; margin: 18px auto 0; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; color: var(--text-faint); font-size: 0.85rem; padding: 32px 24px 48px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .pain-strip { grid-template-columns: 1fr; }
  .services-cards { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .score-card { flex-direction: column; text-align: center; }
  .score-card .score-meta { text-align: center; }
  .header-progress { display: none !important; }
  .quiz-nav { flex-wrap: wrap; }
}
