/* =========================================================
   THEME: light mode + the sun/moon switch (loaded last on every page)
   Dark is the default design. [data-theme="light"] on <html> (set by
   theme-init.js / main.js) swaps the shared tokens to the light palette
   from the client proposals: soft white-blue page, navy text, brand blue.
   Rules below the tokens cover colours that are written directly in
   other stylesheets instead of using a token.
   ========================================================= */

/* ---- Switch ---- */
.theme-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.theme-toggle:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-toggle svg { width: 18px; height: 18px; grid-area: 1 / 1; transition: opacity 250ms ease, transform 350ms ease; }
.theme-toggle__sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
[data-theme="light"] .theme-toggle__sun { opacity: 1; transform: none; }
[data-theme="light"] .theme-toggle__moon { opacity: 0; transform: rotate(90deg) scale(.6); }

/* Theme switch crossfade (View Transitions): the old look fades out as
   the new one fades in, so the page never flashes or snaps */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 550ms;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fallback for browsers without view transitions: colours ease over */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: background-color 450ms ease, color 450ms ease, border-color 450ms ease, fill 450ms ease, box-shadow 450ms ease !important;
}
@media (prefers-reduced-motion: reduce) {
  .theme-switching, .theme-switching * { transition: none !important; }
  .theme-toggle, .theme-toggle svg { transition: none; }
}

/* ---- Light palette ---- */
[data-theme="light"] {
  color-scheme: light;

  --accent:          #1d63ed;   /* 4.9:1 on white, readable as text */
  --accent-dark:     #0b3cff;
  --accent-gradient: linear-gradient(135deg, #2f7bff 0%, #0b3cff 100%);
  --accent-border:   rgba(29, 99, 237, 0.30);
  --accent-glow:     rgba(29, 99, 237, 0.16);
  --accent-glow-far: rgba(11, 60, 255, 0.08);

  --text-primary:   #0f172a;
  --text:           #1e293b;
  --text-secondary: #334155;
  --muted:          #334155;
  --text-muted:     #3f4b5e;
  --text-dim:       #556070;
  --text-subtle:    #5a6577;
  --text-ghost:     #5f6b7d;

  --surface-card:   #f7faff;
  --surface-glass:  rgba(255, 255, 255, 0.6);

  --line:           rgba(15, 23, 42, 0.16);
  --line-strong:    rgba(15, 23, 42, 0.18);
  --line-subtle:    rgba(15, 23, 42, 0.08);

  --hero-accent: #1d63ed;
  --hero-text:   #1e293b;
  --hero-muted:  #3f4b5e;
}


/* ---- Things written in white that sit on the page (not on blue) ---- */
[data-theme="light"] .hero__title-line,
[data-theme="light"] .hero__title-line--white,
[data-theme="light"] .span-white,
[data-theme="light"] .who__title,
[data-theme="light"] .active,
[data-theme="light"] .nav__link.is-active,
[data-theme="light"] .nav__dropdown-toggle.is-active,
[data-theme="light"] .nav__chevron,
[data-theme="light"] .nav__cta { color: var(--text-primary); }

/* Menu bar: frosted white pill */
[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: 0 14px 34px rgba(30, 64, 175, 0.12), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
[data-theme="light"] .nav__cta { border-color: rgba(15, 23, 42, 0.14); background: #fff; box-shadow: 0 8px 18px rgba(30, 64, 175, 0.12); }
[data-theme="light"] .nav__toggle { background: rgba(255, 255, 255, 0.8); }
[data-theme="light"] .hamburger span { background: var(--text-primary); }
[data-theme="light"] .nav__links { --menu-bg: #fff; }
[data-theme="light"] .nav__link:focus-visible,
[data-theme="light"] .nav__cta:focus-visible,
[data-theme="light"] .nav__toggle:focus-visible,
[data-theme="light"] .brand:focus-visible { outline-color: var(--accent); }

/* White logo + white footer icons turn navy-black */
[data-theme="light"] img[src*="migsflow-logo(2)"] { filter: brightness(0); }
[data-theme="light"] .footer__link img { filter: brightness(0); opacity: 0.7; }

/* Stars: soft blue specks instead of white glows */

/* Blue panels keep white text */
[data-theme="light"] .cta__card,
[data-theme="light"] .cta__title,
[data-theme="light"] .cta__subtext,
[data-theme="light"] .cta__eyebrow,
[data-theme="light"] .footer__bubble,
[data-theme="light"] .footer__bubble span { color: #fff; }
[data-theme="light"] .footer__bubble { box-shadow: 0 24px 50px rgba(30, 64, 175, 0.25), 0 0 60px var(--accent-glow); }

/* Softer, bluer shadows than the dark theme's black ones */
[data-theme="light"] .footer__social-btn { background: #fff; box-shadow: 0 8px 18px rgba(30, 64, 175, 0.10); }

/* ---- Forms, pills and boxes that use a dark tint ---- */
[data-theme="light"] .contact__simple-input,
[data-theme="light"] .contact__simple-textarea,
[data-theme="light"] .quiz__input,
[data-theme="light"] .quiz__textarea,
[data-theme="light"] .quiz__select,
[data-theme="light"] .quiz__option,
[data-theme="light"] .quiz__progress-wrap {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.16);
}
[data-theme="light"] .quiz__option:hover { border-color: var(--accent-border); }
/* Only the unchecked boxes turn white, so the blue checked state still shows */
[data-theme="light"] .quiz__option input[type="radio"]:not(:checked),
[data-theme="light"] .quiz__option input[type="checkbox"]:not(:checked) { background: #fff; border-color: rgba(15, 23, 42, 0.35); }
[data-theme="light"] .hero__badge,
[data-theme="light"] .about__pill,
[data-theme="light"] .pricing-hero__pill,
[data-theme="light"] .how__pill,
[data-theme="light"] .quote__pill { background: rgba(255, 255, 255, 0.85); }
[data-theme="light"] ::placeholder { color: #5f6b7d; }

/* Redesign page: question labels were a pale cyan made for black */
[data-theme="light"] .page-redesign .quiz__question-label { color: var(--accent); }
/* Enterprise heads-up note: yellow text on white is unreadable */
[data-theme="light"] .quiz__enterprise-note { background: #fff8e1; border-color: rgba(180, 120, 0, 0.35); }
[data-theme="light"] .quiz__enterprise-note strong { color: #8a5a00; }

/* The round logo badge on the contact page stays dark, so its logo stays white */
[data-theme="light"] .contact__logo-wrap img[src*="migsflow-logo(2)"] { filter: none; }

/* "View Work" next to the play button */
[data-theme="light"] .hero__btn--ghost { color: var(--text-primary); }

/* Phone menu: white panel, light rows */
@media (max-width: 900px) {
  [data-theme="light"] .nav__links {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 24px 50px rgba(30, 64, 175, 0.18);
  }
  [data-theme="light"] .nav__link { background: #f3f7ff; color: var(--text-primary); }
  [data-theme="light"] .nav__link:hover { background: #e6efff; }
}

/* Pop-ups (the $80 special and the 4-per-week notice) stay as dark
   brand cards in both themes: put the dark palette back inside them */
[data-theme="light"] .promo__card,
[data-theme="light"] .waitlist__card {
  color-scheme: dark;
  --accent: #18c9ff;
  --accent-gradient: linear-gradient(135deg, #18c9ff 0%, #0b3cff 100%);
  --accent-border: rgba(24, 201, 255, 0.25);
  --text-primary: rgba(255, 255, 255, 0.95);
  --text: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.78);
  --muted: rgba(255, 255, 255, 0.832);
  --text-muted: rgba(255, 255, 255, 0.854);
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-subtle: rgba(255, 255, 255, 0.45);
  --text-ghost: rgba(255, 255, 255, 0.408);
  --surface-card: #080a14;
  --surface-glass: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.276);
  --line-strong: rgba(255, 255, 255, 0.18);
  --line-subtle: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* =========================================================
   LIGHT MODE PERSONALITY
   Bright, but not flat white: glowing blue/cyan/lavender light behind
   the page (same spots as the dark theme's glows), gradient rings like
   the proposals, visible sparkles, and cards in a mix of soft tints.
   ========================================================= */
[data-theme="light"] body,
[data-theme="light"] body.pricing-page {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2318c9ff'/%3E%3Cstop offset='1' stop-color='%230b3cff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='url%28%23g%29' stroke-width='2'%3E%3Ccircle cx='300' cy='300' r='290' opacity='.09'/%3E%3Ccircle cx='300' cy='300' r='225' opacity='.13'/%3E%3Ccircle cx='300' cy='300' r='160' opacity='.18'/%3E%3C/g%3E%3C/svg%3E") no-repeat calc(100% + 220px) -160px / 640px 640px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2318c9ff'/%3E%3Cstop offset='1' stop-color='%230b3cff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='url%28%23g%29' stroke-width='2'%3E%3Ccircle cx='300' cy='300' r='290' opacity='.09'/%3E%3Ccircle cx='300' cy='300' r='225' opacity='.13'/%3E%3Ccircle cx='300' cy='300' r='160' opacity='.18'/%3E%3C/g%3E%3C/svg%3E") no-repeat -260px 1650px / 560px 560px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2318c9ff'/%3E%3Cstop offset='1' stop-color='%230b3cff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='url%28%23g%29' stroke-width='2'%3E%3Ccircle cx='300' cy='300' r='290' opacity='.09'/%3E%3Ccircle cx='300' cy='300' r='225' opacity='.13'/%3E%3Ccircle cx='300' cy='300' r='160' opacity='.18'/%3E%3C/g%3E%3C/svg%3E") no-repeat calc(100% + 240px) 3300px / 600px 600px,
    radial-gradient(520px 760px at 108% 4%, rgba(0, 119, 255, 0.30), rgba(0, 119, 255, 0) 64%),
    radial-gradient(160px 130px at 104% 10%, rgba(24, 201, 255, 0.35), rgba(24, 201, 255, 0) 64%),
    radial-gradient(520px 760px at -4% 15%, rgba(24, 201, 255, 0.26), rgba(24, 201, 255, 0) 64%),
    radial-gradient(520px 520px at 104% 30%, rgba(124, 108, 255, 0.20), rgba(124, 108, 255, 0) 70%),
    radial-gradient(520px 520px at 2% 42%, rgba(0, 119, 255, 0.20), rgba(0, 119, 255, 0) 70%),
    radial-gradient(520px 520px at 100% 60%, rgba(24, 201, 255, 0.24), rgba(24, 201, 255, 0) 70%),
    radial-gradient(520px 520px at 0% 72%, rgba(124, 108, 255, 0.18), rgba(124, 108, 255, 0) 70%),
    radial-gradient(520px 520px at 100% 86%, rgba(0, 119, 255, 0.20), rgba(0, 119, 255, 0) 70%),
    radial-gradient(520px 520px at 8% 95%, rgba(24, 201, 255, 0.22), rgba(24, 201, 255, 0) 70%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 50%, #e8f0ff 100%);
  color: var(--text);
}
@media (max-width: 600px) {
  [data-theme="light"] body,
  [data-theme="light"] body.pricing-page {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2318c9ff'/%3E%3Cstop offset='1' stop-color='%230b3cff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='url%28%23g%29' stroke-width='2'%3E%3Ccircle cx='300' cy='300' r='290' opacity='.09'/%3E%3Ccircle cx='300' cy='300' r='225' opacity='.13'/%3E%3Ccircle cx='300' cy='300' r='160' opacity='.18'/%3E%3C/g%3E%3C/svg%3E") no-repeat calc(100% + 170px) -110px / 380px 380px,
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2318c9ff'/%3E%3Cstop offset='1' stop-color='%230b3cff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='url%28%23g%29' stroke-width='2'%3E%3Ccircle cx='300' cy='300' r='290' opacity='.09'/%3E%3Ccircle cx='300' cy='300' r='225' opacity='.13'/%3E%3Ccircle cx='300' cy='300' r='160' opacity='.18'/%3E%3C/g%3E%3C/svg%3E") no-repeat -200px 2400px / 380px 380px,
      radial-gradient(700px 700px at 150% 6%, rgba(0, 119, 255, 0.30), rgba(0, 119, 255, 0) 62%),
      radial-gradient(600px 700px at -20% 22%, rgba(24, 201, 255, 0.26), rgba(24, 201, 255, 0) 62%),
      radial-gradient(600px 700px at 120% 38%, rgba(124, 108, 255, 0.20), rgba(124, 108, 255, 0) 62%),
      radial-gradient(600px 700px at -20% 55%, rgba(0, 119, 255, 0.20), rgba(0, 119, 255, 0) 62%),
      radial-gradient(600px 700px at 120% 72%, rgba(24, 201, 255, 0.24), rgba(24, 201, 255, 0) 62%),
      radial-gradient(600px 700px at -20% 88%, rgba(124, 108, 255, 0.18), rgba(124, 108, 255, 0) 62%),
      linear-gradient(180deg, #f8fbff 0%, #eef4ff 50%, #e8f0ff 100%);
  }
}

/* Sparkles: brand-blue twinkles with a glow, easy to spot on light */
[data-theme="light"] .star {
  width: 4px;
  height: 4px;
  background: #3d8bff;
  box-shadow: 0 0 6px rgba(61, 139, 255, 0.9), 0 0 14px rgba(24, 201, 255, 0.7), 0 0 26px rgba(124, 108, 255, 0.45);
  animation-name: starFlickerLight;
}
@keyframes starFlickerLight {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.5); }
}

/* Card tints: a rotating mix of mist blue, sky cyan and periwinkle */
[data-theme="light"] {
  --tint-a: linear-gradient(160deg, #ffffff 0%, #e9f1ff 100%);
  --tint-b: linear-gradient(160deg, #f7fdff 0%, #dcf3ff 100%);
  --tint-c: linear-gradient(160deg, #fbfaff 0%, #e6e6ff 100%);
  --soft-shadow: 0 18px 40px -14px rgba(30, 64, 175, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}
[data-theme="light"] .testimonials__card,
[data-theme="light"] .why__card,
[data-theme="light"] .process__card,
[data-theme="light"] .card,
[data-theme="light"] .wp-plan,
[data-theme="light"] .wp-review,
[data-theme="light"] .a11y__contact,
[data-theme="light"] .wp-total,
[data-theme="light"] .wp-toc,
[data-theme="light"] .page-redesign .quiz__intro,
[data-theme="light"] .showcase__info,
[data-theme="light"] .pricing-addons {
  background: var(--tint-a);
  border-color: rgba(29, 99, 237, 0.22);
  box-shadow: var(--soft-shadow);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
[data-theme="light"] .testimonials__card:nth-child(3n+2),
[data-theme="light"] .why__card:nth-child(3n+2),
[data-theme="light"] .process__card:nth-of-type(3n+2),
[data-theme="light"] .card:nth-child(3n+2),
[data-theme="light"] .wp-plan:nth-child(3n+2),
[data-theme="light"] .wp-review:nth-child(3n+2) { background: var(--tint-b); }
[data-theme="light"] .testimonials__card:nth-child(3n),
[data-theme="light"] .why__card:nth-child(3n),
[data-theme="light"] .process__card:nth-of-type(3n),
[data-theme="light"] .card:nth-child(3n),
[data-theme="light"] .wp-plan:nth-child(3n),
[data-theme="light"] .wp-review:nth-child(3n) { background: var(--tint-c); }

/* Testimonials: the old black drop shadow showed as a grey band once the
   strip clipped it; use the soft blue shadow instead */
[data-theme="light"] .testimonials__card { box-shadow: 0 10px 24px -12px rgba(30, 64, 175, 0.30), 0 0 18px rgba(24, 201, 255, 0.12); }

/* Other soft shadows instead of black ones */
[data-theme="light"] .devices__device--laptop,
[data-theme="light"] .devices__device--phone { filter: drop-shadow(0 26px 34px rgba(30, 64, 175, 0.25)); }
[data-theme="light"] .hero__badge,
[data-theme="light"] .hero__play,
[data-theme="light"] .why__icon,
[data-theme="light"] .to-top { box-shadow: 0 10px 22px -8px rgba(30, 64, 175, 0.35); }
[data-theme="light"] .cta__card { box-shadow: 0 30px 60px -20px rgba(11, 60, 255, 0.45); }

/* ---- Where the switch lives ----
   Always the round button in the header bar. On phones/tablets the bar
   reads: logo … switch, menu button (Contact lives inside the menu). */
.theme-toggle--menu { display: none !important; }

@media (max-width: 900px) {
  .theme-toggle--bar { order: 2; margin-left: auto; width: 44px; height: 44px; }
  .nav__toggle { order: 3; margin-left: 8px; }
}
/* Very small phones: slightly smaller logo so Contact always fits */
@media (max-width: 360px) {
  .brand img { max-width: 118px; }
  .nav__cta { padding: 8px 10px; gap: 6px; }
}
@media (max-width: 900px) {
  [data-theme="light"] .nav__extra-social a { background: #fff; }
}
