/* HailCare design tokens: type, space, colour for light and dark mode.
   Load before hailcare-ui.css. Figtree is self-hosted (SIL OFL 1.1).
   DESIGN.md documents every token and when to use it. */

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-var-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* ---- Type ------------------------------------------------------------
     One family. Sizes step up at 768px (see the media query below).
     Nothing is under 14px. */
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-display: 36px;   /* landing heading only: 36, 48, then 60px from 1104px */
  --fs-title: 30px;     /* page H1 */
  --fs-heading: 22px;   /* section H2, form legends */
  --fs-figure-lg: 26px; /* date and pay on the shift page */
  --fs-figure: 20px;    /* date and pay in shift rows */
  --fs-lead: 19px;      /* lead paragraph, row titles */
  --fs-body: 17px;      /* body, inputs, buttons, labels */
  --fs-meta: 15px;      /* secondary lines, help, footer */
  --fs-caption: 14px;   /* status pills, counts */
  --fs-tab: 14px;       /* phone tab-bar labels */

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

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

  /* ---- Space: a 4px base ---------------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;
  --sp-10: 72px;

  /* ---- Motion ----------------------------------------------------------
     One curve that decelerates into place. Colour changes take 300ms,
     movement 500ms, a section scrolling into view 700ms. All of it is
     removed, or reduced to a fade, under prefers-reduced-motion. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-color: 300ms;
  --dur-move: 500ms;
  --dur-reveal: 700ms;

  /* ---- Shape and size ------------------------------------------------- */
  --r-xs: 4px;          /* badges */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --control-h: 52px;    /* inputs and primary buttons */
  --control-h-sm: 44px; /* small buttons, header links */
  --header-h: 64px;
  --tabbar-h: 64px;

  --page: 1040px;       /* header, main and footer */
  --measure: 68ch;      /* longest line of prose */
  --form: 680px;        /* forms and the message thread */
  --narrow: 440px;      /* log in, sign up */
  --panel: 340px;       /* shift page side panel */
  --gutter: 16px;

  /* ---- Colour: light -------------------------------------------------- */
  --brand-signal: #FF6A2B;     /* logo orange, the same in both modes */

  --bg: #F1F5F6;               /* page: a quiet tint, so cards stand on it */
  --card: #FFFFFF;             /* cards: shift cards, panels, lists, form sections */
  --surface: #FFFFFF;          /* inputs, header, tab bar */
  --surface-glass: rgb(255 255 255 / 0.85); /* the floating header and the tab bar, over a blur */
  --panel-bg: #F2F6F7;         /* wells inside a card: notes, empty states */
  --fill: #EDF2F3;             /* neutral chips and hover fills */
  --fill-strong: #E1E9EB;      /* pressed fills */
  --rule: #E1E8EA;             /* hairlines between rows and sections */
  --rule-strong: #C2CFD3;      /* tag outlines */
  --control-border: #758A90;   /* input and secondary-button outlines (3.6:1) */

  --ink: #0B1D22;              /* text, 17.3:1 on --bg */
  --muted: #3F5257;            /* secondary text, 8.2:1 on --bg, 7.6:1 on --panel-bg */

  --primary: #0A5A69;          /* the only action colour, 7.8:1 */
  --primary-hover: #074855;
  --primary-active: #053A45;
  --primary-ink: #FFFFFF;
  --primary-soft: #E3F0F2;     /* info pills, the current nav item, ghost hover */
  --primary-soft-ink: #074855; /* text on --primary-soft, 8.7:1 */

  --attention-bg: #FFF5E4;     /* the "Needs action" panel */
  --attention-rule: #F1DDB8;

  --accent: #FF6A2B;           /* unread counts only */
  --accent-ink: #000000;       /* 7.4:1 on --accent */

  /* Status colours reach 7:1 on their own soft tint and on every panel tint. */
  --success: #08513A;          /* 8.0:1 on --success-soft */
  --success-soft: #DDF3E8;
  --warning: #6E4300;          /* 7.6:1 on --warning-soft, 7.9:1 on --attention-bg */
  --warning-soft: #FFF0D2;
  --danger: #951B24;           /* 7.2:1 on --danger-soft, 7.9:1 on the panel tints */
  --danger-soft: #FDE6E6;

  --focus: #0A5A69;            /* focus ring: 3px, 2px clear of the control */

  /* ---- Depth ------------------------------------------------------------
     Cards rest just off the page; the block a screen is about (the shift
     summary, the request form) and a hovered card stand a little higher.
     Dark mode shows depth by surface colour, so its shadows are off. */
  --shadow-card: 0 1px 2px rgb(11 29 34 / 0.05), 0 2px 8px -2px rgb(11 29 34 / 0.06);
  --shadow-raised: 0 1px 2px rgb(11 29 34 / 0.05), 0 14px 32px -12px rgb(11 29 34 / 0.18);
  --shadow-button: 0 1px 2px rgb(11 29 34 / 0.10);
  --wash: rgb(255 255 255 / 0.9); /* the soft light at the top of the public pages: lighter than the page, so text over it keeps its contrast */
}

@media (min-width: 768px) {
  :root {
    --fs-display: 48px;
    --fs-title: 36px;
    --fs-heading: 24px;
    --fs-figure-lg: 30px;
    --fs-figure: 22px;
    --gutter: 32px;
  }
}

/* From 1104px the page is at its full width, and the landing heading's
   column fits "Find a phlebotomist" at 60px. */
@media (min-width: 1104px) {
  :root { --fs-display: 60px; }
}

/* Dark: neutral blacks and greys, no tint. The accent, status and tinted
   panel colours keep their hue. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #181818;
    --surface: #1F1F1F;
    --surface-glass: rgb(31 31 31 / 0.85);
    --panel-bg: #1F1F1F;
    --fill: #272727;
    --fill-strong: #313131;
    --rule: #313131;
    --rule-strong: #4C4C4C;
    --control-border: #848484;

    --ink: #EFEFEF;
    --muted: #B8B8B8;

    --primary: #8EC5D2;
    --primary-hover: #A9D7E2;
    --primary-active: #C2E4EC;
    --primary-ink: #04262D;
    --primary-soft: #133740;
    --primary-soft-ink: #A9D7E2;

    --attention-bg: #241C0E;
    --attention-rule: #3D3018;

    --accent: #FF7A3D;
    --accent-ink: #1A0700;

    --success: #6EDCAC;
    --success-soft: #0F2E23;
    --warning: #F4BE63;
    --warning-soft: #2E2410;
    --danger: #FF9590;
    --danger-soft: #3A1719;

    --focus: #8EC5D2;

    --shadow-card: none;
    --shadow-raised: none;
    --shadow-button: none;
    --wash: rgb(19 55 64 / 0.6);
  }
}

/* Logo theming for the inline SVG partials (views/partials/brand/). */
.hc-logo { display: block; height: 100%; width: auto; }
.hc-ink { fill: var(--ink); }
.hc-sig { fill: var(--brand-signal); }
