/* =====================================================================
   ReQuestroom design tokens
   Source: docs/graphic-chart.pdf (brand colors sampled from the PDF)
   plus the prototype screens in the mid presentation (pp. 26-28).
   Only variables live here. Components are in app.css / admin.css.
   Contrast ratios are checked by tests/contrast.py (WCAG 2.2 AA).
   ===================================================================== */

:root {
  /* ---- Brand palette (exact values from the graphic chart) ---------- */
  --c-pink: #EBB7C3;        /* header, hero, restroom wall            */
  --c-pink-deep: #E88CA1;   /* fills only: fails as text on white      */
  --c-mint: #9FD3CF;        /* tiled floor, Toilets page background    */
  --c-sky: #B9E5F8;         /* light blue, Water page background       */
  --c-blue: #83C5D6;        /* fills only: fails as text on white      */
  --c-cream: #EDEDE2;       /* band between wall and floor, chips      */
  --c-peach: #FDD0B4;       /* warm accent                             */
  --c-ink: #2B2B2B;         /* text, outlines, primary buttons         */
  --c-white: #FFFFFF;
  --c-teal-dark: #345452;   /* dark teal, status "OK" text             */
  --c-brick: #962D1E;       /* brick red, alerts and "out of service"  */

  /* ---- Derived tints (lighter/darker steps of the palette) ---------- */
  --c-pink-50: #F8E6EA;
  --c-mint-50: #E3F2F1;
  --c-sky-50: #E6F5FC;
  --c-brick-700: #7A2418;   /* hover/pressed state of brick            */
  --c-ink-muted: #4A4943;   /* secondary text: 7.6:1 on cream, 8.9 on white */
  --c-ink-80: #3D3D3D;      /* hover state of ink buttons              */

  /* ---- Semantic colors -------------------------------------------- */
  --color-text: var(--c-ink);
  --color-text-muted: var(--c-ink-muted);   /* only on white or cream */
  --color-surface: var(--c-white);
  --color-surface-alt: var(--c-cream);
  --color-border: var(--c-ink);
  --color-header: var(--c-pink);
  --color-focus: var(--c-ink);
  --color-link: var(--c-ink);
  --color-danger: var(--c-brick);
  --color-danger-hover: var(--c-brick-700);

  /* Facility status: always paired with an icon and a word, never color alone */
  --status-ok-bg: var(--c-mint-50);
  --status-ok-fg: var(--c-teal-dark);       /* 7.2:1 */
  --status-issue-bg: var(--c-peach);
  --status-issue-fg: var(--c-brick);        /* 5.5:1 */
  --status-out-bg: var(--c-brick);
  --status-out-fg: var(--c-white);          /* 7.8:1 */
  --status-closed-bg: var(--c-cream);
  --status-closed-fg: var(--c-ink);         /* 12.0:1 */

  /* Occupancy (crowdsourced) */
  --occ-free-bg: var(--c-mint-50);
  --occ-free-fg: var(--c-teal-dark);
  --occ-busy-bg: var(--c-peach);
  --occ-busy-fg: var(--c-ink);
  --occ-full-bg: var(--c-pink-deep);
  --occ-full-fg: var(--c-ink);              /* 5.9:1 */

  /* Floor-rule badges */
  --gender-women-bg: var(--c-pink-50);
  --gender-men-bg: var(--c-sky-50);
  --gender-all-bg: var(--c-cream);
  --gender-fg: var(--c-ink);

  /* Page kind: switched by body[data-kind] in app.css */
  --kind-floor: var(--c-mint);
  --kind-accent: var(--c-pink);

  /* Tiled floor pattern (from the chart) */
  --grid-line: rgba(43, 43, 43, 0.16);
  --grid-size: 40px;

  /* ---- Typography --------------------------------------------------- */
  /* Archivo Black stands in for NF Pagkaki (Canva-only font), Montserrat
     is the chart's body font. Both are self-hosted (SIL OFL). */
  --font-display: "Archivo Black", "Arial Black", "Helvetica Neue", system-ui, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;

  --fs-xs: 0.8125rem;   /* 13px: badges, meta. Never smaller. */
  --fs-sm: 0.875rem;    /* 14px */
  --fs-md: 1rem;        /* 16px: body, inputs (prevents iOS zoom) */
  --fs-lg: 1.125rem;    /* 18px */
  --fs-xl: 1.375rem;    /* 22px */
  --fs-2xl: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
  --fs-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-body: 1.5;

  /* ---- Spacing (4px base, used in 8px steps for layout) ------------- */
  --sp-1: 0.25rem;  /* 4  */
  --sp-2: 0.5rem;   /* 8  */
  --sp-3: 0.75rem;  /* 12 */
  --sp-4: 1rem;     /* 16 */
  --sp-5: 1.5rem;   /* 24 */
  --sp-6: 2rem;     /* 32 */
  --sp-7: 3rem;     /* 48 */
  --gutter: var(--sp-4);

  /* ---- Shape ---------------------------------------------------------- */
  --border-w: 1.5px;
  --border: var(--border-w) solid var(--color-border);
  --radius-sm: 10px;    /* inputs */
  --radius-md: 16px;    /* small cards, tiles */
  --radius-lg: 24px;    /* cards, sheets (chart cards are ~24px) */
  --radius-pill: 999px; /* buttons, chips, badges */

  /* Offset shadow, as on the prototype pills ("No toilet paper") */
  --shadow-press: 0 3px 0 var(--c-ink);
  --shadow-press-active: 0 1px 0 var(--c-ink);
  /* Soft shadow for floating elements over the map */
  --shadow-float: 0 6px 24px rgba(43, 43, 43, 0.18);

  /* ---- Interaction ---------------------------------------------------- */
  --tap: 48px;          /* minimum target (WCAG 2.5.8 asks 24, brief asks 44) */
  --tap-sm: 44px;
  --focus-ring: 0 0 0 3px var(--c-white), 0 0 0 6px var(--color-focus);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 220ms;

  /* ---- Layout --------------------------------------------------------- */
  --header-h: 60px;
  --panel-w: 400px;
  --content-max: 720px;

  /* Leaflet panes use z-index 200-700 and controls 800-1000.
     Order: map < list panel < map overlay buttons (Map/List switch must stay
     reachable over the list) < action bar < facility sheet < header < toasts. */
  --z-panel: 1005;
  --z-map-ui: 1008;
  --z-bar: 1010;
  --z-sheet: 1030;
  --z-header: 1040;
  --z-toast: 1100;
}
