/* Contentum light theme. Load after cx.css, app.css, contentum.css, bold.css and helpline.css.
   Dark remains the default. Light is applied only when <html data-theme="light"> is set
   by the head boot script or the header switcher. Tokens are remapped where they exist;
   a short override block covers hardcoded dark colours that would fail WCAG AA. */

/* ---------- variable remaps ---------- */
[data-theme="light"] {
  color-scheme: light;

  /* cx.css */
  --cx-ink: #f3f1ea;
  --cx-ink2: #ffffff;
  --cx-ink3: #ebe8e0;
  --cx-line: #d4d0c6;
  --cx-cream: #0a0a0b;
  --cx-text: #1a1a1c;
  --cx-muted: #5c5a55;
  --cx-dim: #5c5a55;
  --cx-signal: #e5484d;
  --cx-signal-deep: #b8262b;

  /* app.css (pricing, check, and other app pages) */
  --bg: #f3f1ea;
  --bg2: #ebe8e0;
  --panel: #ffffff;
  --ink: #0a0a0b;
  --muted: #5c5a55;
  --hair: rgba(10, 10, 11, .12);
  --hair2: rgba(10, 10, 11, .24);
  --cyan: #e5484d;
  --cyan2: #b8262b;
  --blue: #b8262b;
  --soft: #5c5a55;
  --ink2: #1a1a1c;
  --on: #0a0a0b;
  --ok: #0b7a4b;
  --warn: #a14a00;
  --bad: #b8262b;
  --tA: #b8262b;
  --tB: #8a2a2e;
  --tC: #5c5a55;
  --tP: #4a4844;
  --tM: #8a5a00;
  --tT: #0a0a0b;

  /* needs.css / contentum.css (Human First home and related pages) */
  --paper: #f3f1ea;
  --surface: #ffffff;
  --ground: #f3f1ea;
  --ground2: #ebe8e0;
  --dim: #5c5a55;
  --line: rgba(10, 10, 11, .12);
  --line2: rgba(10, 10, 11, .08);
  --signal: #e5484d;
  --signal-ink: #b8262b;
  --signal-soft: rgba(229, 72, 77, .1);
  --cream2: #b8262b;
  --band-bg: #ebe8e0;
  --band2: #ffffff;
  --band-fg: #0a0a0b;
  --band-muted: #5c5a55;

  /* payment page inline tokens */
  --ink: #0a0a0b;
  --text: #1a1a1c;
}

/* ---------- page surfaces ---------- */
[data-theme="light"],
[data-theme="light"] body {
  background: #f3f1ea;
  color: #0a0a0b;
}
[data-theme="light"] body.cx-page,
[data-theme="light"] .cx-page {
  background: var(--cx-ink);
  color: var(--cx-text);
}

/* ---------- header switcher ---------- */
.cx-theme {
  box-sizing: border-box;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--cx-line, #26262b);
  border-radius: 0;
  background: transparent;
  color: var(--cx-cream, #f3f1ea);
  cursor: pointer;
}
.cx-theme:hover {
  border-color: var(--cx-signal, #e5484d);
  color: var(--cx-signal-deep, #b8262b);
}
.cx-theme:focus-visible {
  outline: 2px solid var(--cx-signal, #e5484d);
  outline-offset: 3px;
}
.cx-theme svg { display: none; }
html:not([data-theme="light"]) .cx-theme .cx-theme-sun,
[data-theme="dark"] .cx-theme .cx-theme-sun { display: block; }
[data-theme="light"] .cx-theme .cx-theme-moon { display: block; }
@media (max-width: 1180px) {
  .cx-theme { width: 40px; height: 40px; }
}

/* ---------- text contrast: signal red is only 3.46:1 on cream, so text uses deep red ---------- */
[data-theme="light"] .cx-wm i,
[data-theme="light"] .cx-nav > a:hover,
[data-theme="light"] .cx-ddb:hover,
[data-theme="light"] .cx-dd.is-open .cx-ddb,
[data-theme="light"] .cx-nav > a[aria-current],
[data-theme="light"] .cx-dd.is-on .cx-ddb,
[data-theme="light"] .cx-ddp a:hover,
[data-theme="light"] .cx-ddp a[aria-current],
[data-theme="light"] .cx-tg:hover,
[data-theme="light"] .cx-mpanel a[aria-current],
[data-theme="light"] .cx-k,
[data-theme="light"] .cx-live,
[data-theme="light"] .cx-link,
[data-theme="light"] .cx-list a:hover,
[data-theme="light"] .cx-chip[aria-pressed="true"],
[data-theme="light"] .cx-chip:hover,
[data-theme="light"] .cx-ghost:hover,
[data-theme="light"] .brand .wm i,
[data-theme="light"] .wm i,
[data-theme="light"] h1 .hl,
[data-theme="light"] h2 .hl,
[data-theme="light"] .punch .hl,
[data-theme="light"] .btn:not(.primary) {
  color: var(--cx-signal-deep);
}
[data-theme="light"] .cx-nav > a[aria-current],
[data-theme="light"] .cx-dd.is-on .cx-ddb {
  border-bottom-color: var(--cx-signal-deep);
}
[data-theme="light"] .cx-link { color: var(--cx-signal-deep) !important; }
[data-theme="light"] .cx-ghost:hover { color: var(--cx-signal-deep) !important; border-color: var(--cx-signal-deep); }

/* Large Anton display type may keep the bright brand red (3.46:1 meets AA large). */
[data-theme="light"] .cx-h1 em { color: var(--cx-signal); }

/* Primary buttons: ink on bright red is 5.06:1 (white on #e5484d is only 3.91:1). */
[data-theme="light"] .cx-wa,
[data-theme="light"] .cx-mhl,
[data-theme="light"] .cx-btn {
  color: #0a0a0b !important;
}
[data-theme="light"] .cx-wa:hover,
[data-theme="light"] .cx-btn:hover {
  background: var(--cx-signal-deep);
  color: #ffffff !important;
}

/* Footer Helpline band and red bands: deep red + white is 6.27:1, needed for 16px copy. */
[data-theme="light"] .cx-fhl,
[data-theme="light"] .cx-band-red {
  background: var(--cx-signal-deep);
  color: #ffffff;
}
[data-theme="light"] .cx-fhl a,
[data-theme="light"] .cx-band-red,
[data-theme="light"] .cx-band-red .cx-k,
[data-theme="light"] .cx-band-red .cx-h2 { color: #ffffff !important; }
[data-theme="light"] .cx-fhl-k i { background: #ffffff; }

/* Cream offer strip becomes a white card once --cx-cream is remapped to ink. */
[data-theme="light"] .cx-offer {
  background: #ffffff;
  color: #0a0a0b;
  border: 1px solid var(--cx-line);
}
[data-theme="light"] .cx-offer b.cx-o1,
[data-theme="light"] .cx-offer p strong { color: #0a0a0b; }
[data-theme="light"] .cx-offer .cx-ghost {
  border-color: #0a0a0b;
  color: #0a0a0b !important;
}

/* ---------- app.css hardcoded leftovers ---------- */
[data-theme="light"] .top { background: rgba(243, 241, 234, .94); }
[data-theme="light"] .card p,
[data-theme="light"] .ticks li,
[data-theme="light"] .steps p,
[data-theme="light"] .vs ul,
[data-theme="light"] .partner,
[data-theme="light"] .defs,
[data-theme="light"] .why,
[data-theme="light"] blockquote,
[data-theme="light"] .legal p,
[data-theme="light"] .pcard p,
[data-theme="light"] .mx-legend,
[data-theme="light"] .faq details p { color: #5c5a55; }

[data-theme="light"] a:hover { color: #0a0a0b; }
[data-theme="light"] .btn:hover { border-color: var(--cx-signal-deep); color: #ffffff; background: var(--cx-signal-deep); }
[data-theme="light"] .sig.tC { color: #ffffff; }

[data-theme="light"] .mx-tools .ghost,
[data-theme="light"] .cttools .ghost { background: rgba(255, 255, 255, .9); }
[data-theme="light"] .mx-tip,
[data-theme="light"] .ctpicker,
[data-theme="light"] .ctlayers,
[data-theme="light"] .ctpanel,
[data-theme="light"] .cttag,
[data-theme="light"] .ctpopular a { background: #ffffff; color: #0a0a0b; }
[data-theme="light"] .ctmap {
  background: radial-gradient(110% 85% at 55% 55%, #ffffff 0%, #ebe8e0 55%, var(--bg) 100%);
}
[data-theme="light"] .kglobe-fig {
  background: radial-gradient(ellipse at 50% 45%, #ffffff 0, #ebe8e0 70%);
}
[data-theme="light"] .kpage .gbtn,
[data-theme="light"] .kpage .gtag,
[data-theme="light"] .kpl { background: #ffffff; color: #0a0a0b; }
[data-theme="light"] .kpage .gtag.on,
[data-theme="light"] .kpage .gtag.on span,
[data-theme="light"] .kpl b,
[data-theme="light"] .kb-big b,
[data-theme="light"] .kb-big span,
[data-theme="light"] .kb-st[aria-pressed="true"] span,
[data-theme="light"] .kt-k,
[data-theme="light"] .kt-i:hover b,
[data-theme="light"] .kt-big b,
[data-theme="light"] .kview .gbtn[aria-pressed="true"],
[data-theme="light"] .khot,
[data-theme="light"] .kc-name a,
[data-theme="light"] .kc-big b,
[data-theme="light"] .klist td.kv b { color: #0a0a0b; }
[data-theme="light"] .kpage .kview .gbtn[aria-pressed="true"],
[data-theme="light"] .kpage .kt-k {
  background: #0a0a0b;
  color: #f3f1ea;
  border-color: #0a0a0b;
}
[data-theme="light"] .ktick { background: #ebe8e0; }
[data-theme="light"] .fl { background: #d4d0c6; }
[data-theme="light"] .ktile.on { background: #ffffff; }
[data-theme="light"] .kpage .kcard {
  background: linear-gradient(180deg, #ffffff 0, #f3f1ea 100%);
}
[data-theme="light"] .kpage .kb-main {
  background: linear-gradient(135deg, #ffffff 0, #ebe8e0 100%) !important;
  box-shadow: inset 3px 0 0 #0a0a0b;
}

/* Status greens and oranges were tuned for dark panels; darken them on cream. */
[data-theme="light"] .kchk.ok,
[data-theme="light"] .kc-chk.ok i { color: #0b7a4b; }
[data-theme="light"] .kchk.ok { border-color: #0b7a4b; }
[data-theme="light"] .kc-chk.ok i { background: #0b7a4b; }
[data-theme="light"] .kchk.warn,
[data-theme="light"] .kc-chk.warn i { color: #8a5a00; }
[data-theme="light"] .kchk.warn { border-color: #8a5a00; }
[data-theme="light"] .kc-chk.warn i { background: #8a5a00; }
[data-theme="light"] .kchk.bad,
[data-theme="light"] .kc-chk.bad i { color: #b8262b; }
[data-theme="light"] .kchk.bad { border-color: #b8262b; }
[data-theme="light"] .kc-chk.bad i { background: #b8262b; }
[data-theme="light"] .kc-chk i { background: #5c5a55; }

/* ---------- Human First leftovers ---------- */
[data-theme="light"] .lang option,
[data-theme="light"] .sel option,
[data-theme="light"] .cx-lang select option {
  background: #ffffff;
  color: #0a0a0b;
}
[data-theme="light"] .mnav > nav {
  background: #f3f1ea;
}
[data-theme="light"] .heropanel,
[data-theme="light"] .toc,
[data-theme="light"] .hf-person,
[data-theme="light"] .band-d {
  background: #ffffff;
}
[data-theme="light"] .band-c {
  background:
    radial-gradient(900px 420px at 8% 0%, rgba(229, 72, 77, .1), transparent 58%),
    radial-gradient(800px 380px at 100% 100%, rgba(229, 72, 77, .06), transparent 55%),
    #f3f1ea;
}
[data-theme="light"] .tg-copy textarea {
  background: #ffffff;
  color: #0a0a0b;
  border-color: var(--cx-line);
}

/* payment page (standalone, no app chrome) */
[data-theme="light"] body .wrap { color: #1a1a1c; }
[data-theme="light"] .brand,
[data-theme="light"] h1,
[data-theme="light"] .card h2 { color: #0a0a0b; }
[data-theme="light"] .lead { color: #1a1a1c; }
[data-theme="light"] .card {
  background: #ffffff;
  border-color: #d4d0c6;
}
[data-theme="light"] .card p,
[data-theme="light"] .note,
[data-theme="light"] .foot,
[data-theme="light"] .brand small { color: #5c5a55; }
[data-theme="light"] .btn { color: #0a0a0b; }
[data-theme="light"] .btn.ghost {
  background: transparent;
  color: #0a0a0b;
  border-color: #d4d0c6;
}
[data-theme="light"] .btn.ghost:hover { border-color: #0a0a0b; }
[data-theme="light"] .foot a { color: #5c5a55; }
[data-theme="light"] .foot a:hover { color: #0a0a0b; }
[data-theme="light"] .foot { border-top-color: #d4d0c6; }

/* Select and form controls inherited from dark backgrounds */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  color: inherit;
}
[data-theme="light"] ::placeholder { color: #5c5a55; }

[data-theme="light"] .brand .cx-theme,
.brand .cx-theme { margin-inline-start: auto; color: inherit; border-color: var(--line, #d4d0c6); }

/* Hardcoded light-on-dark body copy in app.css */
[data-theme="light"] .lede,
[data-theme="light"] .lede.small { color: #1a1a1c; }
[data-theme="light"] .svc p,
[data-theme="light"] .ctlead,
[data-theme="light"] .ctcats,
[data-theme="light"] .ctmap .fchips button,
[data-theme="light"] .ctdossier .sum,
[data-theme="light"] .ctl,
[data-theme="light"] .ctl.c.big b { color: #5c5a55; }

/* Home "In the queue" card uses inline background:var(--cx-cream) as a light panel.
   After the token remap that fill would become ink black with dark text. Do not use
   this selector on the tender chart, which also uses --cx-cream as a bar colour. */
[data-theme="light"] aside.cx-card[style*="background:var(--cx-cream)"] {
  background: #ffffff !important;
  color: #0a0a0b !important;
}
[data-theme="light"] aside.cx-card[style*="background:var(--cx-cream)"] .cx-h3 {
  color: #0a0a0b !important;
}
[data-theme="light"] aside.cx-card[style*="background:var(--cx-cream)"] .cx-k {
  color: var(--cx-signal-deep) !important;
}
[data-theme="light"] aside.cx-card[style*="background:var(--cx-cream)"] .cx-steps,
[data-theme="light"] aside.cx-card[style*="background:var(--cx-cream)"] p {
  color: #1a1a1c !important;
}

/* Keep primary button labels at AA (cx.css uses color:#fff !important). */
html[data-theme="light"] a.cx-wa,
html[data-theme="light"] a.cx-mhl,
html[data-theme="light"] a.cx-btn,
html[data-theme="light"] .cx-wa,
html[data-theme="light"] .cx-btn {
  color: #0a0a0b !important;
}
html[data-theme="light"] a.cx-wa:hover,
html[data-theme="light"] a.cx-btn:hover {
  background: var(--cx-signal-deep);
  color: #ffffff !important;
}
