/* ==========================================================================
   Why Private Cloud microsite (Exaion) — dark mode
   --------------------------------------------------------------------------
   Loaded on every page alongside styles.css. Applies once the page's <html>
   element carries the "theme-dark" class, at which point every token the
   base stylesheet is built on gets redefined here, so the whole page
   restyles without touching any markup.

   Dark is the default: each page's no-flash inline script (see below) adds
   "theme-dark" unless the visitor has explicitly switched to light before,
   so styles.css's original light palette is now the opt-out, not the base
   experience.

   The background becomes the footer's dark navy, headings and body copy
   switch to white / near-white, and the blue and cyan accents brighten a
   notch so they still pop against the darker canvas.

   Lead-capture forms (fields, the submit button, the promo card that wraps
   them, the consent line) are deliberately pinned back to their original
   light appearance — see section 3 — so a form island always reads as a
   normal, trustworthy web form regardless of theme.

   The toggle switch itself (button + icon) lives in section 4; the click
   handling that flips the "theme-dark" class and remembers the choice is in
   assets/js/nav.js, with a small no-flash inline script in each page's
   <head> that applies the stored choice before first paint.

   Structure:
     1. Dark tokens (overrides :root from styles.css)
     2. Surface-level component touch-ups (header, logo, selection)
     3. Forms — pinned back to the light theme on purpose
     4. Theme toggle switch
   ========================================================================== */


/* 1. Dark tokens =========================================================
   Same token names as styles.css, so every rule built on them (cards,
   buttons, tables, the quiz, the accordion, footer text, etc.) picks these
   up automatically — nothing else in this file has to touch them again. */

html.theme-dark {
  /* Surfaces — base is the footer's dark navy */
  --bg-base:        #10121f;
  --bg-subtle:      #171a2c;
  --bg-tint:        #141726;
  --surface-alt:    #01c7ed14;
  --surface:        #1a1d31;
  --border-subtle:  rgba(255, 255, 255, 0.09);
  --border-input:   rgba(255, 255, 255, 0.16);
  --border-strong:  rgba(255, 255, 255, 0.28);

  /* Text — white / near-white, with blue and cyan carrying the accents */
  --text-primary:   #f4f6fb;
  --heading:        #ffffff;
  --text-secondary: #cdd3e3;
  --text-muted:     #a7afc4;
  --text-dim:       #8890a8;
  --text-dimmest:   #6b7389;
  --text-on-accent: #ffffff;

  /* Accent — indigo-blue, brightened for contrast on a dark canvas */
  --blue:           #0064E0;
  --blue-strong:    #7db2ff;
  --blue-tint:      rgba(77, 141, 255, 0.18);

  /* Accent — cyan */
  --accent:          #22d3f2;
  --accent-strong:   #58e0f7;
  --accent-surface:  rgba(34, 211, 242, 0.12);
  --accent-border:   rgba(34, 211, 242, 0.32);
  --accent-text:     #a9ecf9;

  /* Report / promo band */
  --promo-text:    #dfe2ff;
  --promo-eyebrow: #c4c8ff;

  /* Semantic */
  --positive:      #34d399;
  --positive-bg:   rgba(52, 211, 153, 0.12);
  --positive-rule: rgba(52, 211, 153, 0.35);
  --negative:      #f5a524;
  --negative-bg:   rgba(245, 165, 36, 0.12);
  --negative-rule: rgba(245, 165, 36, 0.35);

  /* Footer — one shade above the page background so it still reads as a
     distinct band, even though both are now the same family of dark navy */
  --footer-head: #ffffff;
  --footer-link: #b7c0d6;
  --footer-dim:  #8890a8;

  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg:   0 20px 50px rgba(0, 0, 0, 0.5);
}


/* 2. Surface-level touch-ups ============================================= */

html.theme-dark .site-header {
  background: rgba(16, 18, 31, 0.86);
  border-bottom-color: var(--border-subtle);
}

/* Swap in the white-on-transparent logo instead of filtering the navy one —
   keeps the cyan underline intact rather than flattening it to white. */
html.theme-dark .wordmark__logo--light {
  display: none;
}

html.theme-dark .wordmark__logo--dark {
  display: block;
}

html.theme-dark ::selection { background: var(--blue-tint); }

html.theme-dark .hero__visual,
html.theme-dark .hero__video {
  border-color: var(--border-subtle);
}


/* 3. Forms — pinned back to the light theme ==============================
   Intentional: form fields, the submit button and the card that wraps the
   lead-capture forms keep their original light styling in dark mode, so
   they still read as a normal, trustworthy form. Values below are copied
   verbatim from styles.css rather than left on tokens, so they can't drift
   if the dark tokens above ever change. */

html.theme-dark .field,
html.theme-dark .field--light {
  background: #ffffff;
  border-color: #cfd6e4;
  color: #0e1730;
}

html.theme-dark .field::placeholder {
  color: #9aa3ba;
}

html.theme-dark .btn--submit {
  background: #0064e0;
  color: #ffffff;
}

html.theme-dark .btn--submit:hover {
  background: #2b4350;
  color: #ffffff;
}

html.theme-dark .form__success {
  color: #15a34a;
}

html.theme-dark .promo__card {
  background: #ffffff;
  color: #0e1730;
  border-color: #e5e9f2;
}

html.theme-dark .promo__card p {
  color: #5f6a84;
}

html.theme-dark .promo__card .promo__card__title {
  color: #0e1730;
}

html.theme-dark .promo__success {
  color: #0064e0;
}

html.theme-dark .promo__card.gradient {
  background: #fff var(--gradient-tint-card);
}

html.theme-dark .consent-text {
  color: #6b7280;
}

html.theme-dark .consent-text a {
  color: inherit;
}

/* Fit-check quiz + qualifier form — light islands on the dark page, so they
   read like the white promo forms on the other pages. Re-declaring the light
   palette on each subtree flips every control inside to light-on-white
   without per-element overrides. The result content between them stays on
   the dark theme like the rest of the site's content sections. */
html.theme-dark #quiz,
html.theme-dark #qualifier {
  --bg-subtle:      #f5f7fb;
  --surface:        #ffffff;
  --border-subtle:  #e5e9f2;
  --border-input:   #cfd6e4;
  --border-strong:  #b7c0d4;

  --text-primary:   #0e1730;
  --heading:        #16203a;
  --text-secondary: #272525;
  --text-muted:     #5f6a84;
  --text-dim:       #5f6a84;
  --text-dimmest:   #9aa3ba;

  --accent:         #01c7ed;
  --accent-strong:  #00a6c9;
  --accent-surface: #eafaff;
  --accent-border:  #bde7f2;
  --accent-text:    #12506b;

  --positive:       #15a34a;

  color: var(--text-primary);
  --shadow-sm:   0 1px 2px rgba(16, 23, 48, 0.06);
  --shadow-card: 0 6px 20px rgba(16, 23, 48, 0.06);
  --shadow-lg:   0 20px 50px rgba(16, 23, 48, 0.14);
}


/* 4. Language switch (EN / FR) ========================================== */

.lang-switch {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  background: var(--bg-subtle);
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.lang-switch__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 7px 10px;
  color: var(--text-secondary);
  font-family: inherit;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a.lang-switch__opt:hover {
  color: var(--blue);
  background: var(--bg-base);
}

.lang-switch__opt.is-active {
  background: var(--blue);
  color: #fff;
}

.lang-switch__opt:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .lang-switch {
    align-self: flex-start;
    margin-top: 4px;
  }
}
