:root {
  color-scheme: light dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7faf8;
  --card-bg: #ffffff;
  --card-elevated: #eef4f0;
  --border: #d5e1d9;
  --border-highlight: rgba(13, 99, 56, 0.35);
  --primary: #075c35;
  --primary-dark: #064326;
  --accent: #087a4b;
  --text: #15231b;
  --text-muted: #4b6053;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070c09;
  --card-bg: #0e1712;
  --card-elevated: #13211a;
  --border: #1c2e24;
  --border-highlight: rgba(16, 185, 129, 0.4);
  --primary: #10b981;
  --primary-dark: #0d6338;
  --accent: #34d399;
  --text: #f1f7f3;
  --text-muted: #a8b7ae;
}

.theme-control {
  position: relative;
  z-index: 60;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.theme-toggle:hover,
.theme-toggle[aria-expanded="true"],
.theme-toggle:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.theme-toggle-icon {
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

#themeCurrent {
  color: var(--text-muted);
}

.theme-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 176px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.theme-menu-item:hover,
.theme-menu-item:focus-visible,
.theme-menu-item[aria-pressed="true"] {
  background: var(--card-elevated);
  outline: none;
}

.theme-check {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
}

.theme-menu-item[aria-pressed="true"] .theme-check {
  opacity: 1;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f7faf8;
    --card-bg: #ffffff;
    --card-elevated: #eef4f0;
    --border: #d5e1d9;
    --border-highlight: rgba(13, 99, 56, 0.35);
    --primary: #075c35;
    --primary-dark: #064326;
    --accent: #087a4b;
    --text: #15231b;
    --text-muted: #4b6053;
  }
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) body {
    background-color: var(--bg);
    color: var(--text);
  }

  html:not([data-theme="dark"]) header {
    background: rgba(247, 250, 248, 0.94);
  }

  html:not([data-theme="dark"]) .brand,
  html:not([data-theme="dark"]) h1,
  html:not([data-theme="dark"]) h2,
  html:not([data-theme="dark"]) .btn-outline,
  html:not([data-theme="dark"]) .cohort-title,
  html:not([data-theme="dark"]) .cohort-meter-title,
  html:not([data-theme="dark"]) .cohort-input-label,
  html:not([data-theme="dark"]) .cohort-spec-title,
  html:not([data-theme="dark"]) .cohort-pass-slot,
  html:not([data-theme="dark"]) .cohort-pass-row strong,
  html:not([data-theme="dark"]) .stat-number,
  html:not([data-theme="dark"]) .feature-title,
  html:not([data-theme="dark"]) .mobile-feat-title,
  html:not([data-theme="dark"]) .footer-col h4,
  html:not([data-theme="dark"]) #inlineTicketHeadline,
  html:not([data-theme="dark"]) #passHeadline {
    color: #15231b;
  }

  html:not([data-theme="dark"]) .gradient-text {
    background-image: linear-gradient(135deg, #15231b 30%, #075c35 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  html:not([data-theme="dark"]) .cohort-card,
  html:not([data-theme="dark"]) .cohort-inline-box,
  html:not([data-theme="dark"]) .cohort-modal-card,
  html:not([data-theme="dark"]) .feature-card,
  html:not([data-theme="dark"]) .stat-card,
  html:not([data-theme="dark"]) .mobile-features-card {
    background: #fff;
    border-color: #d5e1d9;
    box-shadow: 0 12px 32px rgba(20, 50, 32, 0.08);
  }

  html:not([data-theme="dark"]) .cohort-meter-wrap,
  html:not([data-theme="dark"]) .cohort-spec-card,
  html:not([data-theme="dark"]) .cohort-form-input,
  html:not([data-theme="dark"]) .cohort-pass-token {
    background: #f2f6f3;
    color: #15231b;
    border-color: #d5e1d9;
  }

  html:not([data-theme="dark"]) .cohort-form-input::placeholder {
    color: #617468;
  }

  html:not([data-theme="dark"]) .cohort-meta-badge {
    background: #eef4f0;
    color: #4b6053;
  }

  html:not([data-theme="dark"]) .mobile-banner {
    background: linear-gradient(135deg, #eef6f0, #e2efe6);
  }

  html:not([data-theme="dark"]) footer {
    background: #edf3ef;
  }

  html:not([data-theme="dark"]) .cohort-pass-box {
    background: linear-gradient(135deg, #eff7f1, #fff);
  }

  html:not([data-theme="dark"]) .cohort-modal-overlay {
    background: rgba(16, 32, 23, 0.55);
  }

  html:not([data-theme="dark"]) .live-pulse,
  html:not([data-theme="dark"]) .cohort-badge,
  html:not([data-theme="dark"]) .cohort-pass-pill {
    color: #075c35;
  }
}

html[data-theme="light"] body {
  background-color: var(--bg);
  color: var(--text);
}

html[data-theme="light"] header {
  background: rgba(247, 250, 248, 0.94);
}

html[data-theme="light"] .brand,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] .btn-outline,
html[data-theme="light"] .cohort-title,
html[data-theme="light"] .cohort-meter-title,
html[data-theme="light"] .cohort-input-label,
html[data-theme="light"] .cohort-spec-title,
html[data-theme="light"] .cohort-pass-slot,
html[data-theme="light"] .cohort-pass-row strong,
html[data-theme="light"] .stat-number,
html[data-theme="light"] .feature-title,
html[data-theme="light"] .mobile-feat-title,
html[data-theme="light"] .footer-col h4,
html[data-theme="light"] #inlineTicketHeadline,
html[data-theme="light"] #passHeadline {
  color: #15231b;
}

html[data-theme="light"] .gradient-text {
  background-image: linear-gradient(135deg, #15231b 30%, #075c35 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .cohort-card,
html[data-theme="light"] .cohort-inline-box,
html[data-theme="light"] .cohort-modal-card,
html[data-theme="light"] .feature-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .mobile-features-card {
  background: #fff;
  border-color: #d5e1d9;
  box-shadow: 0 12px 32px rgba(20, 50, 32, 0.08);
}

html[data-theme="light"] .cohort-meter-wrap,
html[data-theme="light"] .cohort-spec-card,
html[data-theme="light"] .cohort-form-input,
html[data-theme="light"] .cohort-pass-token {
  background: #f2f6f3;
  color: #15231b;
  border-color: #d5e1d9;
}

html[data-theme="light"] .cohort-form-input::placeholder {
  color: #617468;
}

html[data-theme="light"] .cohort-meta-badge {
  background: #eef4f0;
  color: #4b6053;
}

html[data-theme="light"] .mobile-banner {
  background: linear-gradient(135deg, #eef6f0, #e2efe6);
}

html[data-theme="light"] footer {
  background: #edf3ef;
}

html[data-theme="light"] .cohort-pass-box {
  background: linear-gradient(135deg, #eff7f1, #fff);
}

html[data-theme="light"] .cohort-modal-overlay {
  background: rgba(16, 32, 23, 0.55);
}

html[data-theme="light"] .live-pulse,
html[data-theme="light"] .cohort-badge,
html[data-theme="light"] .cohort-pass-pill {
  color: #075c35;
}

html[data-theme="dark"] .cohort-card,
html[data-theme="dark"] .cohort-inline-box,
html[data-theme="dark"] .cohort-modal-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .mobile-features-card {
  background-color: var(--card-bg);
  color: var(--text);
}

html[data-theme="dark"] .cohort-card,
html[data-theme="dark"] .cohort-meter-wrap,
html[data-theme="dark"] .cohort-spec-card,
html[data-theme="dark"] .cohort-meta-badge,
html[data-theme="dark"] .cohort-form-input,
html[data-theme="dark"] .cohort-pass-box,
html[data-theme="dark"] .cohort-modal-card,
html[data-theme="dark"] .cohort-inline-box {
  background-color: var(--card-bg) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .cohort-title,
html[data-theme="dark"] .cohort-meter-title,
html[data-theme="dark"] .cohort-spec-title,
html[data-theme="dark"] .cohort-form-group label,
html[data-theme="dark"] .cohort-pass-slot,
html[data-theme="dark"] .cohort-pass-row strong,
html[data-theme="dark"] .cohort-input-label {
  color: var(--text) !important;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .form-card,
  html:not([data-theme="dark"]) .tier-card,
  html:not([data-theme="dark"]) .cohort-status-banner {
    background-color: #fff;
    border-color: #d5e1d9;
    color: #15231b;
    box-shadow: 0 12px 32px rgba(20, 50, 32, 0.08);
  }

  html:not([data-theme="dark"]) .form-input {
    background: #f2f6f3;
    border-color: #d5e1d9;
    color: #15231b;
  }

  html:not([data-theme="dark"]) .tier-card.selected {
    background: #eaf4ed;
    border-color: #075c35;
  }

  html:not([data-theme="dark"]) .csb-title,
  html:not([data-theme="dark"]) .tier-title,
  html:not([data-theme="dark"]) .tier-price,
  html:not([data-theme="dark"]) .form-card h1,
  html:not([data-theme="dark"]) .form-card h2,
  html:not([data-theme="dark"]) .form-card label {
    color: #15231b;
  }
}

html[data-theme="light"] .form-card,
html[data-theme="light"] .tier-card,
html[data-theme="light"] .cohort-status-banner {
  background-color: #fff;
  border-color: #d5e1d9;
  color: #15231b;
  box-shadow: 0 12px 32px rgba(20, 50, 32, 0.08);
}

html[data-theme="light"] .form-input {
  background: #f2f6f3;
  border-color: #d5e1d9;
  color: #15231b;
}

html[data-theme="light"] .tier-card.selected {
  background: #eaf4ed;
  border-color: #075c35;
}

html[data-theme="light"] .csb-title,
html[data-theme="light"] .tier-title,
html[data-theme="light"] .tier-price,
html[data-theme="light"] .form-card h1,
html[data-theme="light"] .form-card h2,
html[data-theme="light"] .form-card label {
  color: #15231b;
}

html[data-theme="dark"] .form-card,
html[data-theme="dark"] .tier-card,
html[data-theme="dark"] .cohort-status-banner,
html[data-theme="dark"] .form-input {
  background-color: var(--card-bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .form-card h1,
html[data-theme="dark"] .form-card h2,
html[data-theme="dark"] .form-card label,
html[data-theme="dark"] .tier-title,
html[data-theme="dark"] .tier-price,
html[data-theme="dark"] .csb-title {
  color: var(--text) !important;
}
