.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 76px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(31, 235, 182, 0.32);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
    rgba(7, 7, 26, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 28px rgba(0, 0, 0, 0.2);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 235, 182, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 34px rgba(17, 130, 244, 0.18);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(31, 235, 182, 0.36);
  outline-offset: 3px;
}

.theme-toggle-icons {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.theme-toggle svg {
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 180ms ease, transform 220ms ease;
}

.theme-toggle-sun {
  opacity: 0;
  transform: rotate(-35deg) scale(0.72);
}

.theme-toggle-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

html[data-theme="light"] .theme-toggle-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

html[data-theme="light"] .theme-toggle-moon {
  opacity: 0;
  transform: rotate(35deg) scale(0.72);
}

html[data-theme="light"] {
  --bg: #f3f8f6;
  --panel: #ffffff;
  --text: #07071a;
  --body: rgba(7, 7, 26, 0.78);
  --muted: rgba(7, 7, 26, 0.58);
  --soft-border: rgba(7, 7, 26, 0.11);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-line: rgba(7, 7, 26, 0.12);
  --glass-shadow: 0 24px 70px rgba(16, 52, 68, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] body {
  background:
    linear-gradient(rgba(0, 181, 132, 0.095) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 181, 132, 0.095) 1px, transparent 1px),
    linear-gradient(rgba(17, 130, 244, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 130, 244, 0.045) 1px, transparent 1px),
    radial-gradient(ellipse at 12% 30%, rgba(31, 235, 182, 0.14), transparent 34rem),
    radial-gradient(ellipse at 86% 52%, rgba(17, 130, 244, 0.12), transparent 38rem),
    var(--bg);
  background-size: 80px 80px, 80px 80px, 20px 20px, 20px 20px, auto, auto, auto;
  background-attachment: fixed;
}

html[data-theme="light"] body::before {
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.72) 34%, transparent 56%),
    repeating-linear-gradient(90deg, rgba(0, 84, 190, 0.035) 0 1px, transparent 1px 120px);
}

html[data-theme="light"] .site-header {
  border-color: rgba(31, 235, 182, 0.24);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035)),
    rgba(7, 7, 26, 0.94);
  box-shadow: 0 18px 60px rgba(7, 7, 26, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .hero-benefits li {
  border-color: rgba(0, 181, 132, 0.28);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 #fff, 0 8px 24px rgba(0, 84, 190, 0.06);
  color: rgba(7, 7, 26, 0.78);
}

html[data-theme="light"] .hero .hero-note,
html[data-theme="light"] .form-progress-current,
html[data-theme="light"] .analysis-form label > span,
html[data-theme="light"] .consent-option strong {
  color: rgba(7, 7, 26, 0.7);
}

html[data-theme="light"] .section-heading span,
html[data-theme="light"] .solution h2 span,
html[data-theme="light"] .cta-inner span,
html[data-theme="light"] .compare .section-heading span,
html[data-theme="light"] summary:hover,
html[data-theme="light"] details[open] summary::after,
html[data-theme="light"] details.is-open summary::after {
  color: #007e65;
}

html[data-theme="light"] .quick-strip,
html[data-theme="light"] .pain-card,
html[data-theme="light"] .compare-card,
html[data-theme="light"] .step-card,
html[data-theme="light"] .final-cta-card,
html[data-theme="light"] details,
html[data-theme="light"] .intro-video-card,
html[data-theme="light"] .thank-you-copy,
html[data-theme="light"] .thank-you-card,
html[data-theme="light"] .lead-form-copy,
html[data-theme="light"] .lead-form-card,
html[data-theme="light"] .consent-banner,
html[data-theme="light"] .legal-card {
  border-color: rgba(0, 84, 190, 0.12);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.76) 55%, rgba(17, 130, 244, 0.055)),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--glass-shadow);
}

html[data-theme="light"] .quick-strip::before,
html[data-theme="light"] .pain-card::before,
html[data-theme="light"] .compare-card::before,
html[data-theme="light"] .step-card::before,
html[data-theme="light"] .final-cta-card::before,
html[data-theme="light"] details::before,
html[data-theme="light"] .intro-video-card::before,
html[data-theme="light"] .thank-you-copy::before,
html[data-theme="light"] .thank-you-card::before,
html[data-theme="light"] .lead-form-copy::before,
html[data-theme="light"] .lead-form-card::before,
html[data-theme="light"] .consent-banner::before,
html[data-theme="light"] .legal-card::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), transparent 34%, rgba(31, 235, 182, 0.08));
}

html[data-theme="light"] .quick-strip h2,
html[data-theme="light"] .quick-strip-heading h2 {
  color: var(--text);
}

html[data-theme="light"] .solution img,
html[data-theme="light"] .timeline-item img {
  border-color: rgba(0, 84, 190, 0.12);
  box-shadow: 0 24px 70px rgba(16, 52, 68, 0.14);
}

html[data-theme="light"] .pain-card.featured,
html[data-theme="light"] .compare-card.pro,
html[data-theme="light"] .step-card.active {
  --body: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.46);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(140deg, rgba(17, 130, 244, 0.96) 0%, rgba(0, 181, 132, 0.92) 100%);
  color: #fff;
}

html[data-theme="light"] .pain-card.featured .eyebrow,
html[data-theme="light"] .compare-card.pro .eyebrow,
html[data-theme="light"] .step-card.active .eyebrow,
html[data-theme="light"] .founder-card .eyebrow {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(7, 7, 26, 0.18);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

html[data-theme="light"] .check-list li::before {
  background: rgba(0, 181, 132, 0.12);
  color: #007e65;
}

html[data-theme="light"] .x-list li::before {
  background: rgba(7, 7, 26, 0.13);
  color: #07071a;
}

html[data-theme="light"] .compare-card.pro .check-list li::before,
html[data-theme="light"] .compare-card.pro .x-list li::before {
  background: rgba(255, 255, 255, 0.9);
  color: #007e65;
}

html[data-theme="light"] .timeline-list::before {
  background: rgba(0, 181, 132, 0.28);
}

html[data-theme="light"] .final-cta-card {
  border-color: rgba(0, 181, 132, 0.25);
}

html[data-theme="light"] summary::after {
  color: rgba(7, 7, 26, 0.55);
}

html[data-theme="light"] details[open],
html[data-theme="light"] details.is-open {
  border-color: rgba(0, 181, 132, 0.34);
  box-shadow: 0 26px 70px rgba(16, 52, 68, 0.12), 0 8px 28px rgba(17, 130, 244, 0.07);
}

html[data-theme="light"] .founder-card {
  --body: rgba(255, 255, 255, 0.88);
  color: #fff;
}

html[data-theme="light"] .form-progress-bar {
  background: rgba(7, 7, 26, 0.1);
}

html[data-theme="light"] .analysis-form input,
html[data-theme="light"] .analysis-form select,
html[data-theme="light"] .analysis-form textarea,
html[data-theme="light"] .option-card span {
  border-color: rgba(7, 7, 26, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 249, 0.92)),
    #fff;
  box-shadow: inset 0 1px 0 #fff;
  color: #07071a;
}

html[data-theme="light"] .analysis-form input::placeholder,
html[data-theme="light"] .analysis-form textarea::placeholder {
  color: rgba(7, 7, 26, 0.42);
}

html[data-theme="light"] .option-card input:checked + span {
  border-color: rgba(0, 181, 132, 0.55);
  background:
    linear-gradient(180deg, rgba(31, 235, 182, 0.14), rgba(17, 130, 244, 0.08)),
    #fff;
  box-shadow: 0 0 0 4px rgba(0, 181, 132, 0.09), 0 14px 34px rgba(17, 130, 244, 0.1);
}

html[data-theme="light"] .consent-check,
html[data-theme="light"] .consent-option {
  border-color: rgba(7, 7, 26, 0.1);
  background: rgba(7, 7, 26, 0.035);
}

html[data-theme="light"] .legal-card a {
  color: #0054be;
}

html[data-theme="light"] .footer {
  --body: rgba(255, 255, 255, 0.8);
  --muted: rgba(255, 255, 255, 0.55);
  color: #fff;
}

html[data-theme="light"] .footer-strip {
  background: var(--bg);
}

html[data-theme="light"] .consent-launcher {
  color: #fff;
}

@media (max-width: 1120px) {
  .theme-toggle {
    min-width: 44px;
    width: 44px;
    padding: 0;
  }

  .theme-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0;
  }

  .header-actions > :not(.theme-toggle) {
    display: none;
  }

  .legal-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }

  html[data-theme="light"] .nav {
    color: #fff;
  }
}

@media (max-width: 560px) {
  .logo img {
    width: min(164px, 100%);
  }

  .site-header {
    padding-inline: 12px;
  }

  .legal-nav {
    gap: 8px 12px;
  }

  .legal-nav a {
    font-size: 12px;
  }

  .legal-card h1 {
    font-size: clamp(32px, 10vw, 40px);
    overflow-wrap: anywhere;
    hyphens: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle svg {
    transition: none;
  }
}

body.analysis-intro-pending .site-header {
  position: fixed;
  top: 18px;
  right: 18px;
  left: auto;
  display: flex;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.analysis-intro-pending .site-header > .logo,
body.analysis-intro-pending .site-header > .nav-toggle,
body.analysis-intro-pending .site-header > .nav {
  display: none;
}

body.analysis-intro-pending .site-header > .header-actions {
  display: flex;
}

body.analysis-intro-pending .site-header .theme-toggle {
  display: inline-flex;
}
