:root {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --cream: #171314;
  --white: #211a1c;
  --rose: #d58b92;
  --rose-deep: #efa0a8;
  --rose-light: #39272b;
  --rose-action: #d87580;
  --action: #df8a94;
  --text: #f7edef;
  --ink: #f7edef;
  --dark: #f7edef;
  --text-muted: #cbb5b9;
  --muted: #cbb5b9;
  --border: #4b393d;
  --sage: #a8bbaa;
  --sage-light: #283229;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

html,
body {
  transition: background-color 180ms ease, color 180ms ease;
}

html[data-theme="dark"] body {
  background: var(--cream) !important;
  color: var(--text, var(--ink, var(--dark))) !important;
}

html[data-theme="dark"] nav,
html[data-theme="dark"] .site-nav {
  background: rgba(23, 19, 20, 0.94) !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background-color: #1b1617;
  color: var(--text, var(--ink, var(--dark)));
  border-color: var(--border);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #a88e93;
}

html[data-theme="dark"] .nav-dropdown-menu {
  background: var(--white);
  border-color: var(--border);
}

html[data-theme="dark"] footer {
  background: var(--cream) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] :is(
  .about-note,
  .card,
  .cat-card,
  .category-card,
  .compare-col,
  .contact-box,
  .faq-item,
  .focus-item,
  .form-card,
  .info-card,
  .input-card,
  .intro-note,
  .journey-panel,
  .preview,
  .pricing-bg,
  .result-card,
  .results-card,
  .scan-card,
  .stats,
  .tips,
  .upload-area
) {
  background: var(--white) !important;
}

html[data-theme="dark"] :is(
  .analysing-tip,
  .btn-again,
  .btn-camera,
  .btn-plan,
  .btn-scan-again,
  .email-action,
  .icon-btn,
  .upload-btn
) {
  background: var(--white) !important;
  color: var(--text, var(--ink, var(--dark))) !important;
}

html[data-theme="dark"] :is(
  .email-card,
  .plan.featured,
  .upgrade-banner
) {
  background: #2b2023 !important;
  border-color: #594047 !important;
  color: #fff7f8 !important;
}

html[data-theme="dark"] :is(
  .btn,
  .btn-primary,
  .btn-primary-action,
  .btn-submit,
  .about-cta,
  .nav-cta,
  .upgrade-btn
) {
  background: var(--rose-deep) !important;
  color: #211a1c !important;
}

html[data-theme="dark"] :is(
  form button[type="submit"],
  .billing-opt.annual
) {
  color: #211a1c !important;
}

html[data-theme="dark"] a[style*="background:var(--rose-deep)"] {
  color: #211a1c !important;
}

html[data-theme="dark"] .journey-tab[aria-selected="true"] {
  background: var(--rose-light) !important;
  border-color: var(--rose-deep) !important;
  color: var(--rose-deep) !important;
}

html[data-theme="dark"] .step-dot:not(.active) {
  background: var(--white) !important;
  color: var(--text-muted) !important;
}

html[data-theme="dark"] .step-dot.active {
  color: #211a1c !important;
}

html[data-theme="dark"] :is(
  .about-body p,
  .faq-answer,
  .wrap p,
  .wrap li
) {
  color: var(--text-muted) !important;
}

html[data-theme="dark"] a[style*="background:white"],
html[data-theme="dark"] button[style*="background:white"] {
  background: var(--white) !important;
  color: var(--text, var(--ink, var(--dark))) !important;
}

html[data-theme="dark"] .scan-frame {
  background: var(--cream) !important;
}

html[data-theme="dark"] .google-btn {
  background: var(--white);
  color: var(--text, var(--ink, var(--dark)));
  border-color: var(--border);
}

.brand-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
}

.theme-toggle {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--border, rgba(201, 121, 127, 0.35));
  border-radius: 50%;
  background: var(--white, rgba(255, 255, 255, 0.72));
  color: var(--text, var(--ink, var(--dark, #2c1f1f)));
  cursor: pointer;
  box-shadow: none;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  color: var(--rose-deep, var(--rose));
  border-color: var(--rose-deep, var(--rose));
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(201, 121, 127, 0.28);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  display: block;
  pointer-events: none;
}

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