/* Encall's colours for the website, light and dark, curated as a pair. Both
   stylesheets (site.css for the main pages, legal.css for the plain pages)
   read these tokens and set no text or surface colour of their own.

   The light palette is the default. The dark palette applies when the visitor
   chooses Dark (data-theme="dark", set by theme.js from local storage), or
   when the device is dark and the visitor has not chosen Light. CSS cannot
   share one block between a selector and a media query, so the dark palette
   is written twice; scripts/contrast-check.mjs fails if the two copies differ,
   and computes every text and control pair below in both palettes.

   The navy bands (the hero, How it works, the register forms, the footer, the
   menu sheet, the cookie notice) are dark in both modes: their --band tokens
   do not change. */
:root{
  /* brand colours, the same in both modes */
  --navy:#0D1B2A; --navy-deep:#081321; --bone:#F5F1E6;
  --gold:#C9A84C; --teal:#1FA9B8; --teal-deep:#0F6874;
  --linen:#FAF6EF; --linen-2:#F3EDE1; --teal-tint:#DDEEF1;

  /* the page and its surfaces, lowest to highest */
  --bg:var(--teal-tint);
  --bg-plain:var(--linen);
  --surface:#FFFFFF;
  --surface-2:var(--linen);
  --surface-3:var(--linen-2);
  /* text */
  --fg:#1C2530;
  --fg-strong:var(--navy);
  --fg-muted:#46525F;
  /* gold and teal as text: deeper on light surfaces, where the brand gold and teal fall short */
  --accent-text:#7A5F10;
  --teal-text:var(--teal-deep);
  --line:rgba(13,27,42,.14);
  /* the edge of an input, an outline button or a choice: 3:1 on every surface */
  --control-border:#7B858F;
  /* Clients: gold buttons with navy text and a deeper gold rim, so the button
     stands at 3:1 on a light page. Helpers: teal-deep with white. */
  --on-gold:var(--navy);
  --gold-edge:#8A6A12;
  --helper-fill:var(--teal-deep);
  --on-helper:#FFFFFF;
  --helper-edge:var(--teal-deep);
  /* soft fills behind numbers and on hover */
  --tint-gold:rgba(201,168,76,.16);
  --tint-teal:rgba(31,169,184,.13);
  /* the keyboard ring is solid; the halo round a focused field is the Client accent */
  --focus-ring:var(--navy);
  --focus-halo:rgba(201,168,76,.32);
  /* the page's own ring, for a light card inside a navy band (the header menus) */
  --ring-on-surface:var(--navy);
  /* the Blu chat button is navy; on a dark page its gold rim keeps it apart */
  --launcher-edge:var(--navy);
  /* the frosted header once the page scrolls, solid enough to keep its text at 4.5:1 */
  --glass:rgba(250,246,239,.92);
  --glass-fg:var(--navy);
  --glass-word:var(--teal-deep);
  /* notes on the draft legal pages */
  --note-warn-bg:#FFF7E0;
  /* photographs and the hero video sit a little darker on a dark page */
  --media-filter:none;
  --elev-card:inset 0 1px 0 0 rgba(255,255,255,.9),0 1px 2px rgba(13,27,42,.04),0 6px 16px -6px rgba(13,27,42,.08),0 18px 36px -18px rgba(13,27,42,.14);
  --flower:var(--flower-teal);

  /* the navy bands, dark in both modes */
  --band:var(--navy);
  --band-deep:var(--navy-deep);
  --on-band:var(--bone);
  --on-band-muted:rgba(245,241,230,.74);
  --on-band-gold:var(--gold);
  --on-band-teal:#5CC6D2;
  --on-band-error:#F2A6A6;
  --line-band:rgba(245,241,230,.16);
  --control-on-band:rgba(245,241,230,.45);
  --field-on-band:rgba(8,19,33,.55);
  --placeholder-on-band:rgba(245,241,230,.74);
  /* glass and scrims over the navy bands and over photographs; the contrast check
     reads these over a white photograph, the worst case */
  --glass-band:rgba(8,19,33,.92);
  --scrim-photo-top:rgba(8,19,33,.8);
  --scrim-hero-top:rgba(8,19,33,.62);
  --scrim-plate:rgba(8,19,33,.38);
  --scrim-caption:rgba(8,19,33,.85);
  --scrim-form:rgba(8,19,33,.83);
  color-scheme:light;
}

/* Dark, chosen in the footer */
:root[data-theme="dark"]{
  --bg:var(--navy-deep);
  --bg-plain:var(--navy-deep);
  --surface:var(--navy);
  --surface-2:#13253A;
  --surface-3:#182D44;
  --fg:var(--bone);
  --fg-strong:var(--bone);
  --fg-muted:rgba(245,241,230,.74);
  --accent-text:var(--gold);
  --teal-text:var(--teal);
  --line:rgba(245,241,230,.16);
  --control-border:#8796A6;
  --gold-edge:var(--gold);
  --helper-edge:var(--teal);
  --tint-gold:rgba(201,168,76,.16);
  --tint-teal:rgba(31,169,184,.1);
  --focus-ring:var(--gold);
  --ring-on-surface:var(--gold);
  --launcher-edge:var(--gold);
  --glass:rgba(8,19,33,.9);
  --glass-fg:var(--bone);
  --glass-word:#5CC6D2;
  --note-warn-bg:#2B2512;
  --media-filter:brightness(.84) saturate(.92);
  --elev-card:inset 0 1px 0 0 rgba(245,241,230,.08),0 1px 0 rgba(0,0,0,.3),0 18px 36px -18px rgba(0,0,0,.7);
  --flower:var(--flower-bone);
  color-scheme:dark;
}

/* Dark, following the device (Match device, the default) */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:var(--navy-deep);
    --bg-plain:var(--navy-deep);
    --surface:var(--navy);
    --surface-2:#13253A;
    --surface-3:#182D44;
    --fg:var(--bone);
    --fg-strong:var(--bone);
    --fg-muted:rgba(245,241,230,.74);
    --accent-text:var(--gold);
    --teal-text:var(--teal);
    --line:rgba(245,241,230,.16);
    --control-border:#8796A6;
    --gold-edge:var(--gold);
    --helper-edge:var(--teal);
    --tint-gold:rgba(201,168,76,.16);
    --tint-teal:rgba(31,169,184,.1);
    --focus-ring:var(--gold);
    --ring-on-surface:var(--gold);
    --launcher-edge:var(--gold);
    --glass:rgba(8,19,33,.9);
    --glass-fg:var(--bone);
    --glass-word:#5CC6D2;
    --note-warn-bg:#2B2512;
    --media-filter:brightness(.84) saturate(.92);
    --elev-card:inset 0 1px 0 0 rgba(245,241,230,.08),0 1px 0 rgba(0,0,0,.3),0 18px 36px -18px rgba(0,0,0,.7);
    --flower:var(--flower-bone);
    color-scheme:dark;
  }
}

/* The keyboard ring, on every page */
:focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}

/* ---------- Appearance: Light, Dark or Match device (footer of every page) ----------
   Hidden until theme.js has run, since without it the choice could not apply. */
.theme-pick{border:0;margin:0;padding:0;min-width:0}
.theme-pick[hidden]{display:none}
.theme-pick legend{font-family:var(--heading,'Manrope',sans-serif);font-weight:600;font-size:14px;color:var(--on-band);margin-bottom:.55rem;padding:0}
/* One compact segmented control on every screen. Each choice keeps a 48px tap area: the 4px transparent
   border is part of it, and the background is clipped inside it, so the visible pill is 40px tall. */
.theme-pick .opts{display:inline-flex;max-width:100%;border:1px solid var(--control-on-band);border-radius:999px}
.theme-pick label{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:48px;padding:0 .9rem;border:4px solid transparent;border-radius:999px;background-clip:padding-box;color:var(--on-band);font-family:var(--display,'Manrope',sans-serif);font-size:13.5px;font-weight:600;white-space:nowrap;cursor:pointer}
.theme-pick input{position:absolute;width:1px;height:1px;margin:0;opacity:0;overflow:hidden}
.theme-pick label:has(input:checked){background-color:var(--gold);color:var(--on-gold)}
.theme-pick label:has(input:focus-visible){outline:2px solid var(--gold);outline-offset:-2px}
/* at 200% zoom on a phone the three choices wrap instead of running off the screen */
@media(max-width:300px){.theme-pick .opts{flex-wrap:wrap;border-radius:26px}}
