/* Caring360 design tokens (DESIGN_SYSTEM.md, decisions D17 to D19). The ONLY file with colours, sizes, spacing, radii,
   shadows, motion and fonts. Every other stylesheet uses these variables. Light is the default; dark applies only when the
   visitor picked it with the toggle (html[data-theme="dark"]). Never keyed on the system setting.
   Every text and background pair below was checked for WCAG AA (4.5:1) with the contrast script (numbers in
   DESIGN_SYSTEM.md). */

/* Self-hosted fonts (latin). Poppins for headings and numbers, Atkinson Hyperlegible for body text. SIL OFL. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/poppins-latin-500.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/poppins-latin-600.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/poppins-latin-700.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/poppins-latin-800.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-latin-400.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-latin-700.woff2) format('woff2'); }

:root {
  /* ---- Brand (from the Caring360 logo) ---- */
  --teal-dark: #024545;      /* sidebar, major headings */
  --teal-deep: #013333;      /* sidebar hover and edges */
  --teal: #0E7C7B;           /* buttons, links, progress bars */
  --teal-hover: #0A6463;
  --teal-bg: #E3F1F0;        /* current-stage pill, selected rows, soft teal fills */
  --teal-ink: #0A5E5D;       /* teal words on teal-bg */
  --coral: #FC523C;          /* goals and important highlights only (fills, bars, dots). Never errors. */
  --coral-ink: #C7321F;      /* coral words on white */
  --coral-bg: #FFE9E5;
  --coral-ink-2: #AD2A19;    /* coral words on coral-bg */
  --mint: #AFD5D2;           /* completed stages (fills) */
  --mint-fill: #4E968F;      /* M2: done segments, bars and sparks (3:1 against the card) */
  --badge-ink: #2B0A05;      /* B2: dark words on the coral bell badge */
  --mint-bg: #E6F3F1;        /* success messages, done pills */
  --mint-ink: #1E6656;       /* words on mint-bg */
  --on-teal: #FFFFFF;
  --on-coral: #FFFFFF;       /* only for big numbers or bold 18px+ on --coral (3:1 large text) */
  --white: #FFFFFF;

  /* ---- Surfaces and text ---- */
  --bg: #F3F8F7;             /* pale teal page background */
  --surface: #FFFFFF;        /* cards */
  --surface-2: #EDF5F4;      /* soft fills inside cards, table head, hover */
  --line: #DCE7E5;           /* hairline */
  --line-strong: #A9C2BF;    /* input borders, dividers that must be seen */
  --input-line: #6F8F8C;     /* form control border: 3:1 against white (WCAG 1.4.11) */
  --ink: #0F2A2A;
  --ink-2: #46605F;

  /* ---- States: always words plus colour (plus an icon where it matters), never colour alone ---- */
  --amber: #8F5600;          /* warning words (D17 #B86E00 is used as the fill; it fails 4.5:1 for text) */
  --amber-fill: #B86E00;
  --amber-bg: #FFF4DE;
  --red: #C62828;            /* ONLY overdue, stopped, critical */
  --red-bg: #FDECEC;
  --red-ink: #A81F1F;        /* red words on red-bg */
  --red-line: #D64545;
  --grey: #4F5E5D;           /* paused words */
  --grey-bg: #EEF2F2;
  --slate: #34546B;          /* waiting on someone else */
  --slate-bg: #E7EEF3;

  /* ---- Sidebar ---- */
  --side-bg: var(--teal-dark);
  --side-ink: #FFFFFF;
  --side-ink-2: #CFE5E3;
  --side-hover: rgba(255, 255, 255, .08);
  --side-active-bg: #DDF0EE;  /* the pale pill on the active item */
  --side-active-ink: #024545;
  --side-line: rgba(255, 255, 255, .16);

  /* ---- Legacy names (the "Today" pages still use them until WP-C and WP-D rebuild those pages). New code uses the names
     above. Each maps onto the new palette so old screens take the new look. ---- */
  --navy: var(--teal-dark);
  --navy-deep: var(--teal-deep);
  --blue: var(--teal);
  --blue-hover: var(--teal-hover);
  --accent: var(--mint);
  --leaf: var(--mint);
  --on-navy: #FFFFFF;
  --on-navy-2: var(--side-ink-2);
  --on-navy-hover: var(--side-hover);
  --on-navy-line: var(--side-line);
  --on-blue: var(--on-teal);
  --page: var(--bg);
  --late: var(--red);       --late-bg: var(--red-bg);   --late-line: var(--red-line);
  --today: var(--amber);    --today-bg: var(--amber-bg); --today-line: var(--amber-fill); --today-chip: #FFD38A;
  --ok: var(--mint-ink);    --ok-bg: var(--mint-bg);    --ok-line: #237362;  --on-ok: #FFFFFF;
  --paused: var(--grey);    --paused-bg: var(--grey-bg);
  --wait: var(--slate);     --wait-bg: var(--slate-bg);
  --warn: var(--amber);     --warn-bg: var(--amber-bg); --warn-line: var(--amber-fill);

  /* ---- Type ---- */
  --font-head: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Atkinson Hyperlegible', 'Segoe UI', Verdana, sans-serif;
  --fs-min: 16px;            /* floor: nothing smaller anywhere */
  --fs-body: 18px;
  --fs-lead: 20px;
  --fs-h3: 21px;
  --fs-job: 23px;
  --fs-h2: 26px;
  --fs-q: 30px;
  --fs-h1: clamp(28px, 3vw, 36px);
  --fs-hero: clamp(30px, 4.2vw, 46px);
  --fs-hero-sm: clamp(28px, 3vw, 36px);
  --fs-num: clamp(36px, 3.6vw, 48px);   /* KPI numbers */
  --fs-num-md: 36px;
  --fs-num-sm: 24px;
  --fs-brand: 24px;
  --lh: 1.5;
  --lh-head: 1.2;

  /* ---- Space (4 px scale) ---- */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* ---- Shape ---- */
  --r-sm: 8px; --r-md: 12px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
  --border: 1px; --border-2: 2px; --rail: 6px;

  /* ---- Targets ---- */
  --tap: 48px;
  --tap-sm: 44px;            /* smallest touch target (icon buttons, pagination) */
  --tap-done: 56px;
  --input-h: 52px;
  --input-sm: 48px;
  --icon: 22px;

  /* ---- Layout ---- */
  --w-page: 1280px;
  --w-list: 960px;
  --w-form: 760px;
  --w-sheet: 620px;
  --side-w: 256px;
  --bar-h: 72px;
  --rail-w: 96px;
  --rail-w-sm: 78px;
  --journey-h: 8px;
  --progress-h: 10px;

  /* ---- Depth ---- */
  --shadow: 0 1px 2px rgba(2, 69, 69, .05), 0 2px 10px rgba(2, 69, 69, .04);
  --shadow-pop: 0 10px 30px rgba(2, 51, 51, .16), 0 2px 6px rgba(2, 51, 51, .08);
  --shadow-sheet: 0 -8px 40px rgba(1, 40, 40, .26);
  --scrim: rgba(1, 34, 34, .5);
  --focus-ring: var(--teal);
  --focus: 0 0 0 2px var(--surface), 0 0 0 5px var(--focus-ring);

  /* ---- Motion (motion explains a change; reduced-motion turns it off) ---- */
  --t-fast: .15s;
  --t-med: .25s;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;   /* native date pickers and scrollbars follow the toggle */
  --teal-dark: #9FD9D3;      /* headings on dark surfaces */
  --teal-deep: #021A1A;
  --teal: #3FB8B5;
  --teal-hover: #63CAC7;
  --teal-bg: #133B3A;
  --teal-ink: #9FE0DC;
  --coral: #FF6B55;
  --coral-ink: #FF9A8A;
  --coral-bg: #3D1C17;
  --coral-ink-2: #FFB0A3;
  --mint: #2F6F68;
  --mint-fill: #4FA79F;
  --mint-bg: #12302C;
  --mint-ink: #9ADFC9;
  --on-teal: #031E1E;
  --on-coral: #1E0805;
  --bg: #071A1A;
  --surface: #0D2625;
  --surface-2: #133231;
  --line: #22403F;
  --line-strong: #3C5F5D;
  --input-line: #6E9290;
  --ink: #E6F2F1;
  --ink-2: #A9C4C2;
  --amber: #F2B655;
  --amber-fill: #D89A35;
  --amber-bg: #33250C;
  --red: #FF8A80;
  --red-bg: #3A1514;
  --red-ink: #FFA59D;
  --red-line: #F0645A;
  --grey: #B3C2C1;
  --grey-bg: #1B2E2D;
  --slate: #A9C6DC;
  --slate-bg: #172938;
  --side-bg: #042A2A;
  --side-ink-2: #B9D6D3;
  --side-active-bg: #CBEAE6;
  --side-active-ink: #022E2E;
  --today-chip: #E8B04F;
  --ok-line: #4FB89A;
  --on-ok: #04201A;
  --shadow: 0 1px 0 rgba(0, 0, 0, .35);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .5);
  --scrim: rgba(0, 0, 0, .62);
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0s; --t-med: 0s; }
}
