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

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --accent: #0033cc;
  --accent-hover: #0029a3;
  --accent-light: rgba(0, 51, 204, 0.06);
  --text: #010326;
  --text-secondary: #3a3d4a;
  --text-muted: #6b7080;
  --card-bg: #ffffff;
  --card-border: #e2e4ea;
  --critical: #d92b2b;
  --critical-bg: rgba(217, 43, 43, 0.06);
  --moderate: #c47a00;
  --moderate-bg: rgba(196, 122, 0, 0.06);
  --minor: #1a8a42;
  --minor-bg: rgba(26, 138, 66, 0.06);
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(1, 3, 38, 0.06);
  --shadow-md: 0 4px 16px rgba(1, 3, 38, 0.08);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-secondary);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Screens */
.screen {
  display: none;
  min-height: 100dvh;
}
.screen.active {
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── LANDING ── */
#landing {
  background: var(--bg);
}
#landing .container {
  text-align: center;
  gap: 1.25rem;
}

h1 {
  font-size: clamp(1.875rem, 5.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--text);
}

.subhead {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto;
}

.trust-line {
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 0.25rem;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  padding: 0.9375rem 2.25rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 51, 204, 0.2);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(0, 51, 204, 0.3);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── PROGRESS BAR ── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--card-border);
  z-index: 100;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
  width: 0;
}

/* Step indicator below progress bar */
.step-indicator {
  position: fixed;
  top: 12px;
  right: 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  z-index: 100;
  letter-spacing: 0.03em;
}

/* ── QUIZ ── */
#quiz .container {
  justify-content: flex-start;
  padding-top: 4.5rem;
}

.question-text {
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.35;
}

.question-number {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.9375rem 1.125rem;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Other text input for Q1 */
.other-input {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}
.other-input::placeholder {
  color: var(--text-muted);
}
.other-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 51, 204, 0.1);
}

.quiz-nav {
  margin-top: 1.25rem;
}

.quiz-back {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.15s;
}
.quiz-back:hover {
  color: var(--text);
}

/* ── EMAIL GATE ── */
#email-gate .container {
  justify-content: flex-start;
  padding-top: 4.5rem;
}

#email-gate h2 {
  font-size: clamp(1.375rem, 4vw, 1.625rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.gate-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 0.875rem;
}
.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3125rem;
}
.optional {
  font-weight: 400;
  color: var(--text-muted);
}
.form-group input {
  width: 100%;
  padding: 0.8125rem 0.875rem;
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 51, 204, 0.1);
}

#lead-form .btn-primary {
  width: 100%;
  margin-top: 0.375rem;
}

.error-text {
  color: var(--critical);
  font-size: 0.8125rem;
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

/* ── LOADING ── */
#loading {
  background: var(--bg-subtle);
}
.loading-container {
  align-items: center;
  text-align: center;
  gap: 1rem;
}
.loading-container h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
}
.loading-sub {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── RESULTS ── */
#results {
  background: var(--bg-subtle);
}
#results .container {
  justify-content: flex-start;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  max-width: 580px;
}

.results-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3125rem 0.875rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}
.results-badge.critical {
  background: var(--critical-bg);
  color: var(--critical);
  border: 1px solid rgba(217, 43, 43, 0.15);
}
.results-badge.moderate {
  background: var(--moderate-bg);
  color: var(--moderate);
  border: 1px solid rgba(196, 122, 0, 0.15);
}
.results-badge.minor {
  background: var(--minor-bg);
  color: var(--minor);
  border: 1px solid rgba(26, 138, 66, 0.15);
}

.results-name {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.results-headline {
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 1.75rem;
}

.audit-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.audit-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.audit-card.dimmed {
  opacity: 0.55;
}
.audit-card.highlight {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent);
}

.audit-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}
.audit-card.highlight .audit-card-label {
  color: var(--accent);
}
.leak-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--critical);
  background: var(--critical-bg);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.audit-card p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.priority-fix {
  background: var(--card-bg);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.priority-fix-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.375rem;
}

.priority-fix p {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  font-weight: 500;
}

/* ── CTA BLOCK ── */
.results-cta {
  text-align: center;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.results-cta-hook {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.375rem;
  line-height: 1.3;
}

.results-cta-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.results-cta .btn-primary {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.0625rem;
  margin-bottom: 0.75rem;
}

.results-cta .btn-secondary {
  display: block;
  width: 100%;
  text-align: center;
  border: none;
  padding: 0.5rem;
}

/* ── ANIMATIONS ── */
.fade-in {
  animation: fadeIn 0.25s ease;
}

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

/* ── RESPONSIVE ── */
@media (min-width: 768px) {
  .container {
    padding: 3rem 2rem;
  }
  #quiz .container,
  #email-gate .container {
    padding-top: 5rem;
  }
}
