/* TenaZ design tokens. Owner: design agent. Light theme only.
   Every original name is kept; values are tuned and new tokens are added below them.
   Contrast figures (WCAG 2.x) are verified by design/contrast-check.mjs — see design/brief.md.
   RULE: --tz-gold / --accent is decoration only (hairlines, rings, icons on navy). It is NEVER text on a light surface.
         For gold-toned TEXT use --text-gold (light surfaces) or --text-gold-on-navy (navy surfaces). */
:root {
  /* ---- Brand ---- */
  --tz-navy: #012D67; --tz-navy-deep: #011F49; --tz-blue: #016FB8; --tz-blue-mid: #014C8C;
  --tz-gold: #C79F3F; --tz-gold-warm: #D2B35E; --tz-gold-light: #DECA7E; --tz-champagne: #EBE5A0; --tz-bronze: #A47742;
  --tz-white: #FFFFFF; --tz-silver: #94969A;

  /* ---- Surfaces ---- */
  --bg: #F5F6F9; --surface: #FFFFFF; --surface-2: #EFF3F9; --surface-navy: var(--tz-navy);
  --surface-navy-raised: rgba(255,255,255,.07);      /* card sitting on the navy hero */
  --surface-sunk: #E9EEF6;                            /* input wells, ring track on light */
  --scrim: rgba(1,31,73,.52);                         /* behind sheets and dialogs */

  /* ---- Text ---- */
  --text: #0B1B33; --text-muted: #55607A; --text-on-navy: #FFFFFF; --text-on-navy-muted: #C9D4E6;
  --text-gold: #7A5A14;                               /* gold-toned text on white/bg: 6.3:1 */
  --text-gold-on-navy: #DECA7E;                       /* gold-toned text on navy: 8.3:1 */
  --text-disabled: #6B7588;                           /* still 4.5:1 on white so disabled labels stay readable */

  /* ---- Lines ---- */
  --border: #DCE2EC; --border-strong: #8793A8;        /* strong = 3:1 on white, for input outlines */
  --accent: var(--tz-gold); --link: #01629F;          /* link darkened a touch: AA on --bg and --info-bg */
  --hairline: 1px solid var(--border);
  --hairline-gold: 1px solid rgba(199,159,63,.60);
  --hairline-on-navy: 1px solid rgba(255,255,255,.16);

  /* ---- Status (text colour + tinted background + border). Text passes AA on its own -bg. ---- */
  --ok: #17663F; --ok-bg: #E6F4EC; --ok-border: #A9D6BC;
  --warn: #8A5200; --warn-bg: #FFF3DC; --warn-border: #EBCB8A;
  --stop: #A3211A; --stop-bg: #FCE8E6; --stop-border: #F0B4AE;
  --info: #014C8C; --info-bg: #E8F1FA; --info-border: #B5D2EC;

  /* ---- Shape ---- */
  --radius-s: 8px; --radius-m: 14px; --radius-l: 22px; --radius-pill: 999px;
  --radius-sheet: 24px 24px 0 0;

  /* ---- Space (4-pt grid). Rhythm: 16 inside cards, 24 between cards, 32–48 between sections. ---- */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --space-7: 48px; --space-8: 64px;
  --gutter: 16px;                                     /* page side padding at 360 px */
  --content-max: 34rem;                               /* column never wider than this on tablets */

  /* ---- Elevation: soft, navy-tinted, never grey. Prefer a hairline + shadow-1 over heavy shadows. ---- */
  --shadow-0: 0 0 0 1px rgba(1,45,103,.06);
  --shadow-1: 0 1px 2px rgba(1,45,103,.05), 0 4px 14px rgba(1,45,103,.06);
  --shadow-2: 0 10px 32px rgba(1,31,73,.16);
  --shadow-3: 0 20px 48px rgba(1,31,73,.24);
  --shadow-nav: 0 -1px 0 rgba(1,45,103,.08), 0 -8px 24px rgba(1,31,73,.06);
  --shadow-sheet: 0 -12px 40px rgba(1,31,73,.22);

  /* ---- Gradients ---- */
  --tz-navy-grad: linear-gradient(165deg, #013A80 0%, #012D67 42%, #011F49 100%);
  --tz-gold-grad: linear-gradient(120deg, #A47742 0%, #C79F3F 28%, #DECA7E 50%, #C79F3F 72%, #A47742 100%);
  --tz-gold-line: linear-gradient(90deg, rgba(199,159,63,0) 0%, #C79F3F 18%, #DECA7E 50%, #C79F3F 82%, rgba(199,159,63,0) 100%);

  /* ---- Type: Lato 400 / 700 / 900 only. Contrast comes from weight and size, not colour. ---- */
  --font: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: .8125rem; --fs-s: .9375rem; --fs-m: 1rem; --fs-l: 1.1875rem; --fs-xl: 1.5rem; --fs-xxl: 2rem;
  --fs-display: 2.5rem;                               /* the one big number on a screen (score, kg) */
  --fw-regular: 400; --fw-bold: 700; --fw-black: 900;
  --lh-tight: 1.12; --lh-snug: 1.3; --lh-body: 1.5;
  --ls-tight: -.015em;                                /* display + xxl headings */
  --ls-caps: .09em;                                   /* small uppercase eyebrow labels */

  /* ---- Controls ---- */
  --tap: 44px; --nav-h: 64px;
  --control-h: 48px;                                  /* buttons and inputs: use as MIN-height, never height */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px #016FB8;
  --focus-ring-on-navy: 0 0 0 2px #012D67, 0 0 0 4px #DECA7E;

  /* ---- Progress visuals ---- */
  --ring-track: #E3E8F1; --ring-fill: var(--tz-gold);
  --ring-track-on-navy: rgba(255,255,255,.16); --ring-fill-on-navy: var(--tz-gold-warm);
  --ring-stroke: 8;                                   /* SVG stroke width for a 120 px ring; use round caps */
  --chart-line: var(--tz-navy); --chart-grid: #E3E8F1; --chart-goal: var(--tz-gold);

  /* ---- Motion ---- */
  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-in: cubic-bezier(.4,0,1,1);
  --dur-1: 150ms; --dur-2: 200ms; --dur-3: 250ms;
  --dur-ring: 600ms;                                  /* the only long animation: ring fill on load */

  /* ---- Layers ---- */
  --z-base: 0; --z-sticky: 20; --z-nav: 50; --z-scrim: 90; --z-sheet: 100; --z-toast: 200;
}

/* Motion is switched off in ONE place: every transition/animation that uses the duration tokens obeys this. */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 1ms; --dur-2: 1ms; --dur-3: 1ms; --dur-ring: 1ms; }
}
