/*
 * Design tokens — docs/design/DESIGN_SYSTEM.md (RF Interline Design System, light only) and
 * docs/06-admin-ui/02-design-tokens.md. The ONLY place colours, fonts, sizes, radii, shadows and
 * motion are defined. Rebranding = editing this file.
 * Fonts: Plus Jakarta Sans + Roboto Mono, loaded from Google Fonts in the layouts (DECISIONS B-119).
 *
 * Layer 1 = design tokens (names follow the design system). Layer 2 = semantic aliases
 * (surface, border, text, result and provenance vocabulary) that components read.
 */
:root {
  /* ---------- Layer 1 · colour ---------- */
  --color-canvas: #F4F2EE;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F0EEE9;
  --color-surface-head: #FBFAF8;
  --color-surface-locked: #FAF8F5;
  --color-surface-selected: #FAF8FF;
  --color-surface-builder: #F6F7FE;
  --color-border: #E4E1DB;
  --color-border-strong: #DAD6CE;
  --color-border-locked: #EDE9E2;
  --color-divider: #F4F2EE;
  --color-divider-card: #F0EEE9;
  --color-ink: #14161A;
  --color-ink-hover: #2A2E36;
  --color-ink-body: #3A3F49;
  --color-ink-secondary: #5C6370;
  --color-ink-muted: #8A909B;
  --color-ink-faint: #A8ADB6;
  --color-ink-weak: #C3C8D0;
  --color-accent: #6C4CF1;
  --color-accent-hover: #4F32C7;
  --color-accent-tint: #F2ECFF;
  --color-accent-tint-strong: #EDE6FF;
  --color-accent-border: #DED2FF;
  --color-lilac: #C9B6FF;
  --color-success: #0E7C56;
  --color-warning: #B26A00;
  --color-error: #C2352B;
  --color-disabled-bg: #E9E6E0;
  --color-disabled-text: #A8ADB6;
  --color-skeleton: #EDEAE4;
  --color-photo-placeholder: #E7E3DC;
  --color-deep-indigo: #2A1D73;

  /* Status tones: fill / border / text (design system 1.1.6) */
  --tone-neutral-bg: #F1EFEA;  --tone-neutral-border: #E0DCD4;  --tone-neutral-text: #5C6370;
  --tone-info-bg: #F2ECFF;     --tone-info-border: #DED2FF;     --tone-info-text: #6C4CF1;
  --tone-success-bg: #E4F3EC;  --tone-success-border: #BFE5D3;  --tone-success-text: #0B6349;
  --tone-warning-bg: #FFF4DC;  --tone-warning-border: #F5DFAE;  --tone-warning-text: #8A5B10;
  --tone-error-bg: #FDEAE7;    --tone-error-border: #F6C9C2;    --tone-error-text: #B3271C;
  --tone-sky-bg: #E4F0FD;      --tone-sky-border: #C6DDF6;      --tone-sky-text: #2C6FB5;
  --tone-error-row: #FFF8F6;   --tone-error-row-hover: #FFF1EE;
  --tone-critical-bg: #B3271C; --tone-critical-border: #7E1A12; --tone-critical-text: #FFFFFF;

  /* Progress fills */
  --bar-info: #6C4CF1; --bar-warning: #E3A12F; --bar-neutral: #C3C8D0;
  --bar-error: #D2493D; --bar-success: #1E9467; --bar-sky: #4C8FD6;

  /* Brand */
  --brand-gradient: linear-gradient(160deg, #7C5CF7, #5B37D6);
  --brand-glow: 0 12px 24px -12px rgba(91, 55, 214, .7);
  --wash-panel: linear-gradient(178deg, #E4D9FF 0%, #EFE8FF 48%, #FBFAFF 100%);
  --wash-header: linear-gradient(180deg, #E7DEFF 0%, #EDE5FF 40%, #F4F0FA 74%, rgba(244, 242, 238, 0) 100%);
  --wash-guest: linear-gradient(180deg, #E4DAFF 0%, #EEE8FF 38%, #F8F6FF 72%, #FCFBFF 100%);
  --wash-card: linear-gradient(168deg, #E9DEFF 0%, #F3EDFF 44%, #FDFCFF 100%);
  --ring-stroke: rgba(108, 76, 241, .28);
  --frosted: rgba(255, 255, 255, .7);
  --frosted-strong: rgba(255, 255, 255, .92);
  --eyebrow-on-lilac: #3C4AA0;

  /* Scrims */
  --overlay-light-hover: rgba(255, 255, 255, .14);
  --scrim-modal: rgba(20, 22, 26, .44);
  --scrim-drawer: rgba(20, 22, 26, .32);

  /* ---------- Layer 1 · typography ---------- */
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700; --weight-extrabold: 800;
  --text-caps: 11.5px;      /* table header caps, +0.05em */
  --text-xs: 12px;          /* meta, badges */
  --text-sm: 12.5px;        /* helper, error, banner */
  --text-base: 13.5px;      /* web UI: buttons, nav, cells */
  --text-body: 14px;        /* secondary body */
  --text-md: 15.5px;        /* card title */
  --text-lg: 19px;          /* modal title */
  --text-xl: 24px;          /* KPI value, state heading */
  --text-2xl: 28px;         /* page title */
  --text-3xl: 34px;         /* login heading */
  --text-hero: 38px;        /* login statement */
  --leading-tight: 1.25; --leading-normal: 1.55;
  --tracking-display: -0.035em; --tracking-title: -0.03em; --tracking-heading: -0.02em;
  --tracking-card: -0.015em; --tracking-caps: 0.05em; --tracking-eyebrow: 0.14em;

  /* ---------- Layer 1 · spacing (4px scale) ---------- */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --space-half: 2px; --space-1h: 6px; --space-2h: 10px; --space-3h: 14px; --space-4h: 18px; --space-6h: 26px; --space-7: 28px;

  /* ---------- Layer 1 · shape, depth, motion ---------- */
  --radius-xs: 6px;         /* checkbox, caption chip */
  --radius-sm: 8px;         /* badge, pagination, small avatar tile */
  --radius-item: 10px;      /* menu item, row-more button */
  --radius-tile: 11px;      /* small tile, chip */
  --radius-nav: 12px;       /* nav item */
  --radius-md: 13px;        /* web button, input, tab */
  --radius-menu: 16px;      /* dropdown menu, banner */
  --radius-lg: 18px;        /* card */
  --radius-modal: 20px;
  --radius-pill: 999px;
  --shadow-sm: none;                                          /* cards carry a border, not a shadow */
  --shadow-md: 0 24px 50px -20px rgba(20, 22, 26, .35);       /* dropdown menu */
  --shadow-lg: 0 40px 80px -30px rgba(20, 22, 26, .5);        /* modal */
  --shadow-drawer: -30px 0 60px -30px rgba(20, 22, 26, .4);
  --shadow-toast: 0 18px 40px -16px rgba(20, 22, 26, .6);
  --shadow-float: 0 10px 22px -14px rgba(48, 26, 102, .45);
  --focus-ring: 0 0 0 4px var(--color-accent-tint-strong);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --duration-fast: .15s; --duration-base: .25s; --duration-slow: .4s;
  --z-sticky: 20; --z-menu: 30; --z-toast: 100;

  /* ---------- Layer 1 · layout ---------- */
  --sidebar-width: 252px; --topbar-height: 66px; --content-max: none;
  --panel-width: 480px; --builder-outline: 340px; --builder-props: 360px;
  --size-btn: 40px; --size-btn-sm: 32px; --size-btn-modal: 42px; --size-btn-login: 52px;
  --size-input: 42px; --size-icon-btn: 36px;
  --size-login-form: 400px; --size-login-panel: 620px;
  --support-bg: var(--color-deep-indigo); --support-fg: #FFFFFF;

  /* ---------- Layer 2 · semantic aliases (what components read) ---------- */
  /* Result vocabulary — identical meaning to the mobile app */
  --result-pass-bg: var(--tone-success-bg);     --result-pass-fg: var(--tone-success-text);
  --result-warning-bg: var(--tone-warning-bg);  --result-warning-fg: var(--tone-warning-text);
  --result-fail-bg: var(--tone-error-bg);       --result-fail-fg: var(--tone-error-text);
  --result-critical-bg: var(--tone-critical-bg); --result-critical-fg: var(--tone-critical-text);
  --result-na-bg: var(--tone-neutral-bg);       --result-na-fg: var(--tone-neutral-text);
  --result-recorded-bg: var(--tone-sky-bg);     --result-recorded-fg: var(--tone-sky-text);

  /* Provenance */
  --prov-official-bg: var(--tone-info-bg); --prov-official-fg: var(--tone-info-text);
  --prov-org-bg: var(--tone-neutral-bg);   --prov-org-fg: var(--tone-neutral-text);

  /* Surfaces */
  --bg-app: var(--color-canvas); --bg-surface: var(--color-surface); --bg-subtle: var(--color-surface-head);
  --bg-sidebar: var(--color-surface);
  --border: var(--color-border); --border-strong: var(--color-border-strong);
  --fg: var(--color-ink); --fg-muted: var(--color-ink-muted); --fg-subtle: var(--color-ink-faint);
}
