/* ==========================================================================
   Elite Panel Solutions - DESIGN TOKENS  (the ONLY file to edit to re-theme)
   Components reference these variables only. Never hard-code hex values in CSS.

   APPROVED WCAG 2.2 AA PAIRINGS. Ratios below are generated by tools/contrast_check.py
   (rounded down). After changing ANY colour, run:  python3 tools/contrast_check.py
   Text needs 4.5:1; borders, focus rings and icons (non-text) need 3:1.

   Light theme (default)
     text                 on surface        17.8:1  (min 4.5)  body text
     text                 on surface-alt    16.3:1  (min 4.5)  body text on alternate sections
     text-muted           on surface         7.5:1  (min 4.5)  secondary text
     text-muted           on surface-alt     6.9:1  (min 4.5)  secondary text on alternate sections
     text-on-primary      on primary         5.2:1  (min 4.5)  primary buttons, active tabs
     text-on-primary-dark on primary-dark    8.5:1  (min 4.5)  button hover
     primary              on surface         5.2:1  (min 4.5)  links, eyebrow text, icons
     primary              on surface-alt     4.8:1  (min 4.5)  links on alternate sections
     primary-dark         on surface         8.5:1  (min 4.5)  info alerts
     text-on-accent       on accent          6.3:1  (min 4.5)  accent buttons, badges, cart counter
     text-inverse         on surface-dark   18.3:1  (min 4.5)  dark sections, trust bar, footer, toast
     text-inverse         on primary-dark    8.5:1  (min 4.5)  hexagon icons (gradient end)
     text-inverse         on primary         5.2:1  (min 3)  hexagon icons (gradient start, non-text)
     primary-light        on surface-dark    7.8:1  (min 4.5)  links in footer, cookie banner and toast
     secondary            on surface-dark    5.9:1  (min 4.5)  footer legal text
     success              on surface         5.2:1  (min 4.5)  success text/pills
     warning              on surface         5.9:1  (min 4.5)  warning text/pills
     danger               on surface         6.5:1  (min 4.5)  error text/pills
     text-inverse         on danger          6.5:1  (min 4.5)  danger buttons
     border-strong        on surface         3.6:1  (min 3)  input borders (non-text)
     focus                on surface         5.8:1  (min 3)  focus ring (non-text)
     focus                on surface-dark    3.1:1  (min 3)  focus ring on dark sections
   Dark theme (.theme-dark, applied over the light tokens)
     text                 on surface        16.7:1  (min 4.5)  body text
     text                 on surface-alt    14.9:1  (min 4.5)  body text
     text-muted           on surface         8.7:1  (min 4.5)  secondary text
     text-muted           on surface-alt     7.8:1  (min 4.5)  secondary text
     text-on-primary      on primary         8.0:1  (min 4.5)  buttons in dark sections
     text-on-primary-dark on primary-dark   10.2:1  (min 4.5)  button hover in dark sections
     primary              on surface         7.8:1  (min 4.5)  links, eyebrow text in dark sections
     primary              on surface-alt     6.9:1  (min 4.5)  links
     text-on-accent       on accent          6.3:1  (min 4.5)  accent buttons
     text-on-accent       on primary-light  12.8:1  (min 4.5)  accent button hover
     border-strong        on surface         4.0:1  (min 3)  borders (non-text)
     focus                on surface         9.9:1  (min 3)  focus ring
     text                 on surface-dark   17.7:1  (min 4.5)  text on the darkest surface

     success / warning / danger on surface           6.2 / 8.1 / 6.1:1  status text      (AA ok)
   Verify any change with:  php bin/contrast.php   (checks every pairing below against WCAG 2.2 AA)
   NOT APPROVED: --color-accent or --color-secondary as TEXT on light surfaces (decorative fills only);
                 --color-primary-light as text on light surfaces (use it on dark surfaces only).
   ========================================================================== */

:root {
  /* Brand roles (sampled from the logo: sky blue, cyan, silver-grey, carbon charcoal) */
  --color-primary: #0b6fb8;
  --color-primary-dark: #084e86;
  --color-primary-light: #4fb3e8;
  --color-accent: #00a3c4;
  --color-secondary: #8a949e;

  /* Surfaces and text */
  --color-surface: #ffffff;
  --color-surface-alt: #f2f5f8;
  --color-surface-dark: #11151a;
  --color-text: #121820;
  --color-text-muted: #4a5561;
  --color-text-inverse: #ffffff;
  --color-text-on-accent: #0b1117;
  --color-text-on-primary: #ffffff;
  --color-text-on-primary-dark: #ffffff;

  /* Lines and states */
  --color-border: #c9d1d9;
  --color-border-strong: #7b8794;
  --color-success: #1e7b45;
  --color-warning: #8a5a00;
  --color-danger: #b3261e;
  --color-focus: #1a5fd0;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 5rem;

  /* Radius and shadow */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.12);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.18);

  /* Typography (fonts are self-hosted via /assets/fonts, font-display: swap) */
  --font-heading: "Exo 2", "Saira", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.8vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.4rem + 2.2vw, 2.75rem);
  --text-4xl: clamp(2.25rem, 1.5rem + 3.6vw, 3.75rem);
  --line-height-body: 1.6;
  --line-height-heading: 1.15;

  /* Layout. NB: CSS cannot read custom properties inside @media; these are the
     canonical values - use the same numbers in media queries, and read via JS if needed. */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --container-max: 1200px;
  --header-height: 4.5rem;

  /* Motion */
  --motion-fast: 150ms;
  --motion-base: 300ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

/* Dark / carbon-charcoal variant: reassigns tokens only */
.theme-dark {
  --color-primary: #4fb3e8;
  --color-primary-dark: #7cc8f0;
  --color-primary-light: #a9dcf6;
  --color-surface: #11151a;
  --color-surface-alt: #1a2027;
  --color-surface-dark: #0a0d11;
  --color-text: #f2f5f8;
  --color-text-muted: #aab4bf;
  --color-text-inverse: #ffffff;
  --color-text-on-primary: #0b1117;
  --color-text-on-primary-dark: #0b1117;
  --color-border: #2e3844;
  --color-border-strong: #6b7785;
  --color-focus: #7cc8f0;
  --color-success: #3fa96b;
  --color-warning: #e0a030;
  --color-danger: #ef6b64;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.6);
  color-scheme: dark;
  background-color: var(--color-surface);
  color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-base: 0ms;
  }
}
