/*
  Trilene design tokens. The ONLY place where colours, fonts, radii and spacing are defined.
  Components and pages use the semantic tokens (--color-*, --font-*, --space-*), never the raw
  palette and never hard-coded values. A new look and feel = change this file (see
  docs/design-system.md). Source: Trilene brand guidelines v1, look v2 (BRAND.md, 9 Oct 2026:
  white grounds, soft corner washes) and the wireframes (Design canvas, Sign Up v0.6).
*/

:root {
  /* Brand palette: five steps per hue. Medium is the working colour, dark carries text. */
  --tr-blue-lighter: #C1DAE6;
  --tr-blue-light: #86C4E1;
  --tr-blue-medium: #419CC6;
  --tr-blue-dark: #227E97;
  --tr-blue-darker: #144C52;

  --tr-green-lighter: #DAE3B8;
  --tr-green-light: #C9DB82;
  --tr-green-medium: #B4CC54;
  --tr-green-dark: #669735;
  --tr-green-darker: #367326;

  --tr-purple-lighter: #E2DCEF;
  --tr-purple-light: #BDABE2;
  --tr-purple-medium: #8E67DF;
  --tr-purple-dark: #6D4CB3;
  --tr-purple-darker: #553D85;

  --tr-neutral-lighter: #F7F4EC;
  --tr-neutral-light: #E6E3DB;
  --tr-neutral-medium: #ADAFA1;
  --tr-neutral-dark: #495D63;
  --tr-neutral-darker: #303E4B;

  /* Semantic colours: reserved for states, never decoration. */
  --tr-yellow: #EABA3A;
  --tr-orange: #E38E41;
  --tr-red: #DB5149;

  --tr-white: #FFFFFF;

  /* Superellipse palette for the pharmacy screens (Figma "Flow Sofie", dashboard 226:1610; decision
     Pieter, 18 Nov 2026). Used through the .theme-pharmacy block below, never directly in pages. */
  --tr-teal-ink: #003B41;        /* text */
  --tr-teal-ink-muted: #406F74;  /* secondary text; darker than Figma's #4E8085 for 4.5:1 on the mint grounds */
  --tr-teal-mist: #F4F9F8;       /* page ground, chips */
  --tr-teal-panel: #DFEDEE;      /* large panels ("Actieve opdrachten"), card borders */
  --tr-teal-header: #E6F4F1;     /* header ground */
  --tr-cyan: #96E6FF;            /* underline of the active tab */
  --tr-pink: #B85B84;            /* opdracht type survey */
  --tr-green-wash: #F0F5DD;      /* ground behind "op schema" / "net gestart" */
  --tr-orange-wash: #FDE4CC;     /* ground behind "achterop" */

  /* Surfaces and text. Look v2: white grounds, no beige (Neutral Lighter is for PDFs only). */
  --color-bg: var(--tr-white);
  --color-surface: var(--tr-white);
  --color-surface-muted: color-mix(in srgb, var(--tr-neutral-light) 25%, var(--tr-white));
  --color-tile: var(--tr-neutral-light);
  --color-border: var(--tr-neutral-light);
  --color-border-strong: var(--tr-neutral-medium);
  --color-text: var(--tr-neutral-darker);
  --color-text-muted: var(--tr-neutral-dark);
  --color-text-inverse: #FDFDFB;
  --color-focus: var(--tr-blue-medium);

  /* Primary action colour: teal, the anchor of the brand */
  --color-primary: var(--tr-blue-dark);
  --color-primary-strong: var(--tr-blue-darker);
  --color-primary-soft: var(--tr-blue-lighter);
  --color-primary-outline: rgba(20, 76, 82, 0.45);

  /* Colour by meaning: green = pharmacies, blue = pharma, purple = participants */
  --color-pharmacy: var(--tr-green-medium);
  --color-pharmacy-strong: var(--tr-green-darker);
  --color-pharmacy-soft: var(--tr-green-lighter);
  --color-pharmacy-outline: var(--tr-green-light);
  /* Text on --color-pharmacy-soft: Green Darker is just under 4.5:1 there, so one step darker. */
  --color-pharmacy-on-soft: #2C5E1F;
  --color-pharma: var(--tr-blue-medium);
  --color-pharma-strong: var(--tr-blue-darker);
  --color-pharma-soft: var(--tr-blue-lighter);
  --color-pharma-outline: var(--tr-blue-light);
  --color-participant: var(--tr-purple-medium);
  --color-participant-strong: var(--tr-purple-darker);
  --color-participant-soft: var(--tr-purple-lighter);
  --color-participant-outline: var(--tr-purple-light);

  /* Colour per role in the header (shell rule 5): label next to the logo and the active tab.
     Pharmacy = green, pharma = blue, Trilene admin = dark teal. Buttons stay teal (action). */
  --color-role-pharmacy-bg: var(--color-pharmacy-soft);
  --color-role-pharmacy-text: var(--color-pharmacy-on-soft);
  --color-role-pharma-bg: var(--tr-blue-lighter);
  --color-role-pharma-text: var(--tr-blue-darker);
  --color-role-admin-bg: var(--tr-blue-darker);
  --color-role-admin-text: var(--tr-white);

  /* Corner washes (look v2): soft pastel fading in from a corner. CSS stand-in for the
     pre-rendered wash images, as on the wireframes. Colour by meaning. */
  --wash-pharmacy: radial-gradient(110% 70% at 0% 0%, var(--tr-green-lighter) 0%, color-mix(in srgb, var(--tr-green-lighter) 0%, transparent) 65%);
  --wash-participant: radial-gradient(60% 60% at 100% 100%, var(--tr-purple-lighter) 0%, color-mix(in srgb, var(--tr-purple-lighter) 0%, transparent) 70%);
  --wash-pharma: radial-gradient(110% 70% at 100% 0%, var(--tr-blue-lighter) 0%, color-mix(in srgb, var(--tr-blue-lighter) 0%, transparent) 65%);

  /* Brand gradient for icon strokes on tiles (green, purple, blue). */
  --icon-gradient-1: var(--tr-green-medium);
  --icon-gradient-2: var(--tr-purple-medium);
  --icon-gradient-3: var(--tr-blue-medium);

  /* Brand gradient as a surface (the "key message" treatment of look v2), used once: the login
     panel. Turned 315deg so green sits in the bottom-right corner, away from the text; the scrim
     keeps white text above 4.5:1 on the purple and blue parts (decision Pieter, 12 Nov 2026). */
  --gradient-brand: linear-gradient(315deg, var(--tr-green-medium) 0%, var(--tr-purple-medium) 55%, var(--tr-blue-medium) 100%);
  --gradient-brand-scrim: color-mix(in srgb, var(--tr-blue-darker) 45%, transparent);

  /* States */
  --color-success: var(--tr-green-darker);
  --color-warning: var(--tr-orange);
  --color-warning-text: #8A4A12;
  --color-danger: var(--tr-red);
  --color-danger-text: #AB4C4A;
  --color-danger-soft: #FBEDEC;

  /* Typography: Inter for headings and body, Source Sans 3 for labels. Headings are Inter SemiBold
     with tight tracking, like the headlines in the decks (font option E, decision Pieter, 12 Nov 2026;
     it replaces Bitter Medium). */
  --font-body: 'Inter', 'Inter 28pt', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: var(--font-body);
  --font-label: 'Source Sans 3', 'Source Sans Pro', system-ui, sans-serif;
  --font-weight-display: 600;
  --tracking-display: -0.025em;  /* page titles (h1) */
  --tracking-heading: -0.015em;  /* section and card titles (h2, h3) */

  --text-xs: 0.8125rem;   /* 13px */
  --text-sm: 0.875rem;    /* 14px */
  --text-md: 0.9375rem;   /* 15px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.375rem;    /* 22px */
  --text-2xl: 1.875rem;   /* 30px */
  --text-3xl: 2.375rem;   /* 38px */
  --text-4xl: 2.75rem;    /* 44px */

  /* Spacing (4px grid) */
  --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-16: 64px;

  /* Shape */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(48, 62, 75, 0.05), 0 14px 34px -20px rgba(48, 62, 75, 0.22);

  /* Layout */
  --content-max-width: 1200px;
  --header-height: 72px;
  --input-height: 48px;
  --touch-target: 44px;
  --touch-target-large: 58px;

  /* Opdrachten (Superellipse, decision Pieter 18 Nov 2026). In :root, not only in .theme-pharmacy,
     so the card also renders in the admin preview. */
  /* Large panels such as "Actieve opdrachten" on the dashboard, and the stat tiles. */
  --color-panel: var(--tr-teal-panel);
  /* The page behind a side panel (TrDrawer), dimmed in deep teal as in the Superellipse screens. */
  --color-backdrop: color-mix(in srgb, var(--tr-blue-darker) 75%, transparent);
  --color-tile-teal: color-mix(in srgb, var(--tr-blue-dark) 10%, var(--tr-white));
  /* Type of opdracht: screening purple, survey pink. */
  --color-kind-screening: var(--tr-purple-dark);
  --color-kind-screening-soft: var(--tr-purple-lighter);
  /* Text a quarter darker than Figma's #B85B84: that pink is 3.4:1 on its soft ground, this 5.6:1. */
  --color-kind-survey: color-mix(in srgb, var(--tr-pink) 75%, black);
  --color-kind-survey-soft: color-mix(in srgb, var(--tr-pink) 20%, var(--tr-white));
  /* An invitation to do more, pink as in Superellipse ("Je kan nog 1 opdracht toevoegen" on the
     dashboard). The button is the darker pink: white on Figma's #B85B84 is only 4.3:1. */
  --color-accent: color-mix(in srgb, var(--tr-pink) 75%, black);
  --color-accent-hover: color-mix(in srgb, var(--tr-pink) 60%, black);
  --color-accent-soft: color-mix(in srgb, var(--tr-pink) 14%, var(--tr-white));
  /* The fee on menu cards: light cyan with teal text. */
  --color-fee-soft: var(--tr-cyan);
  --color-fee-text: var(--tr-teal-ink);
  /* The fee tag on dashboard cards: primary teal with white text. */
  --color-fee-strong: var(--tr-blue-dark);
  /* Progress of an opdracht: on track (green) or behind (orange); text in the darker step for contrast. */
  --color-progress-ok: var(--tr-green-medium);
  --color-progress-ok-soft: var(--tr-green-wash);
  --color-progress-ok-text: var(--color-pharmacy-on-soft);
  --color-progress-behind: var(--tr-orange);
  --color-progress-behind-soft: var(--tr-orange-wash);
  --color-progress-behind-text: var(--color-warning-text);
  /* Text on the solid status pills ("op schema", "achterop"): teal ink, not Figma's white, which
     stays under 3:1 on the green and the orange. */
  --color-progress-pill-text: var(--tr-teal-ink);
}

/*
  Pharmacy theme: the Superellipse look for everything a signed-in apotheker sees, the onboarding
  included (decision Pieter, 18 Nov 2026). MainLayout puts .theme-pharmacy on the app wrapper for
  the Apotheker role; admin, pharma and the login page keep the look above. Inter stays the only
  typeface (no Bitter). Components keep using the semantic tokens; only their values change here.
*/
.theme-pharmacy {
  --color-bg: var(--tr-teal-mist);
  --color-surface-muted: var(--tr-teal-mist);
  --color-border: var(--tr-teal-panel);
  --color-text: var(--tr-teal-ink);
  --color-text-muted: var(--tr-teal-ink-muted);
  --shadow-card: 0 0 20px 0 rgba(0, 59, 65, 0.12);
  --font-label: var(--font-body); /* Inter only, labels and eyebrows too */

  /* Header: soft teal ground with two light washes, the active tab bold with a cyan underline. */
  --color-header-bg: var(--tr-teal-header);
  --color-header-wash: radial-gradient(45% 160% at 80% 0%, color-mix(in srgb, var(--tr-blue-lighter) 70%, transparent) 0%, transparent 70%),
                       radial-gradient(30% 140% at 0% 0%, color-mix(in srgb, var(--tr-white) 70%, transparent) 0%, transparent 70%);
  --color-nav-active-line: var(--tr-cyan);
}
