/* ---------------------------------------------------------------------------
 * Quilt design-system tokens, vendored from quilt-ui (src/ds/tokens.css,
 * commit 06c73f2). Only the :root and body.dark variable blocks are copied,
 * verbatim: they are the contract every Quilt console styles against.
 *
 * To update: copy those two blocks from quilt-ui again. Do not edit values here.
 *
 * Left out on purpose:
 *   - the @font-face rules (they point at self-hosted /fonts/*.woff2 files this
 *     site does not have; _Layout and Login load Poppins from Google Fonts), and
 *   - the `@layer base` element rules, which are written for Tailwind. This site's
 *     Bootstrap CSS is unlayered and would override anything inside a layer, so the
 *     equivalent element rules live unlayered in quilt/site.css.
 * ------------------------------------------------------------------------- */

:root {
  /* --- base palette — sampled from quiltsoftware.com --------------------- */
  --q-midnight: #091134;
  --q-ink: #18214e;
  --q-navy-700: #171f4c;
  --q-panel: #242c56;
  --q-panel-border: #3b4268;
  --q-plum: #894f90;
  --q-plum-600: #77417d;
  --q-plum-300: #b58bb9;
  --q-plum-100: #f0e6f1;
  --q-sky: #86add2;
  /* Tag text. Mirrors --q-plum-600, which already flips for dark; this was a
     hardcoded #3D6A96 in core.tsx and measured 2.80:1 on a dark card. */
  --q-sky-600: #3d6a96;
  --q-sky-200: #c3d5e8;
  --q-sky-100: #eaf1f8;
  --q-surface: #f7f7f7;
  /* --- internal-app palette --------------------------------------------- */
  --q-indigo: #2b3674;
  --q-indigo-600: #242d61;
  --q-indigo-100: #e3e5f0;
  --q-slate-900: #121b2f;
  --q-slate-800: #192539;
  --surface-app: #ebe9f1;
  --q-gridline: #eeeeee;
  --q-gray-400: #bfbfbf;
  --q-gray-600: #6a6f8e;
  --q-white: #ffffff;
  /* --- semantic aliases -------------------------------------------------- */
  --text-heading: var(--q-ink);
  --text-body: #3a4166;
  --text-muted: #5b6480; /* was #818ca5 — 3.37:1 on white */
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #b8beda;
  --surface-page: #ffffff;
  --surface-card: #ffffff;
  --surface-tint: var(--q-surface);
  --success-bg: #e6f5ee;
  --warning-bg: #f5ebdc;
  --danger-bg: #fbeaee;
  --surface-dark: var(--q-midnight);
  --surface-panel: var(--q-panel);
  --accent: var(--q-indigo);
  --accent-hover: var(--q-indigo-600);
  --accent-brand: var(--q-plum);
  --accent-contrast: #ffffff;
  /* The accent as text on the page background; in dark the fill colour is too dim for that. */
  --accent-text: var(--accent);
  --accent-2: var(--q-sky);
  --link: var(--q-plum);
  --link-hover: var(--q-plum-600);
  --focus-ring: var(--q-indigo);
  --border-subtle: #e4e5ec;
  --border-dark: var(--q-panel-border);
  --success: #047845; /* was #00a550 — 3.23:1 on white */
  --success-soft: #44c89c;
  --warning: #8a5c1f; /* was #a9742f — 4.02:1 on white */
  --danger: #b23a52; /* was #e05d75 — 3.50:1 on white */
  --danger-soft: #ed9292;
  /* Tag `outline` sits on white in light mode and goes transparent in dark. */
  --tag-bg: #fff;
  /* Always-dark surface for white-on-dark chrome (toasts, tooltips). Distinct
     from --q-ink, which inverts to near-white in dark mode and would leave
     white text on a white bubble. */
  --surface-inverse: var(--q-ink);

  /* --- typography -------------------------------------------------------- */
  --font-sans: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-sans);
  --font-mono: ui-monospace, Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fs-3xl: 44px;
  --fs-4xl: 64px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-heavy: 800;
  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-body: 1.6;
  --ls-display: -0.02em;
  --ls-caps: 0.08em;

  /* --- spacing / radii --------------------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;
  --r-btn: 10px;
  --grid-cell: 24px;

  /* --- effects ----------------------------------------------------------- */
  --shadow-card: 0 1px 3px rgba(18, 27, 47, 0.06), 0 6px 16px rgba(18, 27, 47, 0.06);
  --shadow-pop: 0 16px 40px rgba(9, 17, 52, 0.16);
  --shadow-btn: 0 2px 8px rgba(43, 54, 116, 0.22);
  --shadow-btn-brand: 0 4px 14px rgba(137, 79, 144, 0.35);
  --stitch: 1.5px dashed;
  --stitch-light: 1.5px dashed rgba(255, 255, 255, 0.4);
  --stitch-dark: 1.5px dashed var(--q-plum-300);
  --ease-brand: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-med: 250ms;
  /* Row hover in DataTable — a token so dark mode can flip it without !important. */
  --row-hover: #f7f7fb;
}

/* --- dark theme ---------------------------------------------------------- */
body.dark {
  --tag-bg: transparent;
  --surface-app: #0a1130;
  --surface-card: #181f45;
  --surface-page: #181f45;
  --q-ink: #f0f2fe;
  --text-heading: #f0f2fe;
  --text-body: #c6cce9;
  --text-muted: #9aa3cf;
  --border-subtle: #2b3462;
  --q-surface: #222a55;
  --q-indigo-100: #2b3462;
  --q-indigo: #98a4ee;
  --accent: #4b5bb4;
  --accent-hover: #5a6ac4;
  --focus-ring: #98a4ee;
  --q-gray-400: #555e8e;
  --q-plum-100: #3a2c50;
  --q-plum-600: #cfa9d5;
  --q-sky-100: #20315b;
  --q-sky-600: #9dc0e4;
  --link: #c9a3cf;
  --link-hover: #ddbee2;
  --success: #3ecf8e;
  --warning: #e0a85c;
  --danger: #f07e93;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);
  --row-hover: #222a55;
  --surface-inverse: #05091f;
  /* Re-declared here: a token defined as var(--q-surface) on :root is resolved there, with the light value. */
  --surface-tint: var(--q-surface);
  --accent-text: #98a4ee;
  --success-bg: #123b30;
  --warning-bg: #3d3020;
  --danger-bg: #43202b;
}
