/*
   Repair Shop Order Tracker - design tokens (Team 02)
   Load this file FIRST on every page, before components.css and pages.css.
 */

/* 1. Fonts (self-hosted: our CSP blocks external font sites) */
/* font-display: swap = show text in a fallback font straight away, then swap
   to IBM Plex when it has loaded (text is never invisible while loading). */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

/* 2. Design tokens */
:root {
  /* --- Forest-green theme: colours --- */
  --ink: #1A2420; --ink-2: #5B6B63; --ink-3: #7D8A83;
  --surface: #FFFFFF; --canvas: #F5F6F3; --sunken: #EBEFEA;
  --line: #DDE3DD; --line-strong: #C3CCC5;
  --accent: #1F4A36; --accent-hover: #173828; --accent-active: #12301F; --accent-tint: #E7EFEA;
  --on-accent: #F4E7A1; /* text on primary buttons and the RS mark (8.0:1 on --accent) */
  --on-ink: #FFFFFF; /* text on dark --ink / --danger fills (toast, avatar, nav count) */
  --gold: #A8841C; /* small highlights (RS mark underline, medium priority) - not for text */
  --gold-text: #7D6210; /* gold links: 5.8:1 on white, 4.9:1 on --accent-tint */
  --danger: #B42318; --danger-tint: #FBE6E4; --success: #2E7D4F; --success-tint: #E3F2E8;
  --focus: 0 0 0 3px rgba(31, 74, 54, .28);
  --radius: 6px; --radius-sm: 4px;
  --shadow-pop: 0 8px 24px rgba(26, 36, 32, .12), 0 1px 3px rgba(26, 36, 32, .08);
  --shadow-soft: 0 3px 12px rgba(26, 36, 32, .04); /* portal cards */
  --backdrop: rgba(26, 36, 32, .4); /* dialog backdrop */
  --font: "IBM Plex Sans", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  /* status: text / background (all 4.5:1 or more) */
  --st-received: #4A5550;   --st-received-bg: #EDF0EE;  /* grey */
  --st-diagnosing: #8A5300; --st-diagnosing-bg: #FDEFD2; /* amber */
  --st-awaiting: #75600F;   --st-awaiting-bg: #F3EDCB;  /* gold / ochre */
  --st-repair: #175CD3;     --st-repair-bg: #E4EEFC;    /* blue */
  --st-ready: #2B774B;      --st-ready-bg: #E3F2E8;     /* light green, not the primary */
  --st-collected: #3B4A54;  --st-collected-bg: #E6EAED; /* slate */
  --st-stopped: #B42318;    --st-stopped-bg: #FBE6E4;   /* red: returned_unrepaired + cancelled */

  /* --- Component colours, named so components.css never repeats a hex code --- */
  --warranty: #5B3FA8; --warranty-bg: #EFEAFB; /* .warranty badge */
  --priority-high: var(--danger); --priority-medium: var(--gold); --priority-low: var(--line-strong);
  --danger-border: #E9B4AE; /* .btn.danger border */
  --banner-border: #C5D6CB; /* .banner border */
  --toast-ok: #3CCB7F; --toast-err: #F97066; /* toast left edge */
  --toast-sub: #C5CEC8; /* toast second line */
  --table-head: #F8F9F6; /* .tbl th background */
  --card-bg: #FBFCFA; /* .card (customer portal) */
  --radius-lg: 8px; /* dialogs */

  /* Primary buttons */
  --accent-btn: var(--accent);
  --accent-btn-hover: var(--accent-hover);
  --accent-btn-active: var(--accent-active);
  --st-diagnosing-text: var(--st-diagnosing);

  /* --- Added: type scale from section 02 "Typography" (size / weight) --- */
  --fs-display: 32px; /* 600 - rarely used, big page headings */
  --fs-h1: 24px; /* 600 - page title in the top bar */
  --fs-h2: 20px; /* 600 - section headings */
  --fs-lead: 16px; /* 400 - intro sentences */
  --fs-body: 14px; /* 400 - default UI text */
  --fs-meta: 13px; /* 500 - labels, meta lines */
  --fs-small: 12.5px; /* hints, table sub-lines, badges */
}

/* 3. Base elements */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}

/* Form controls don't inherit the page font by default in browsers. */
button, input, select, textarea { font: inherit; color: inherit; }

/* Codes, serials, money and IDs are always monospace. */
code, kbd, .mono { font-family: var(--mono); }

/* Keyboard focus: the accent ring from the guide (--focus).
   :focus-visible = only when using the keyboard, not on every mouse click.
   The transparent outline stays invisible normally, but Windows High Contrast
   mode paints it, so the focus ring never disappears for those users. */
:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus);
}

/* Respect users who ask their OS for less motion (skeleton pulse, toasts). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
