/* ==========================================================================
   2nd Opinion — DESIGN TOKENS. The single source of truth for the public site,
   the patient/doctor workspace and the admin console.

   - Raw colour values (hex) live ONLY in this file (a test enforces it).
   - Every other stylesheet references these tokens, so changing a value here
     changes it site-wide.
   - Fonts and colours follow the landing page: Manrope + DM Serif Display on
     the NHS-inspired palette. Primary action colour is blue.
   - Breakpoints (custom properties cannot be used in media queries):
       max-width 1080px  tablet / sidebar collapses
       max-width  780px  phone landscape and small tablets: off-canvas sidebar
       max-width  520px  phone portrait
   ========================================================================== */
:root {
  /* ---- Colour ---- */
  --color-primary: #005EB8;
  --color-primary-strong: #003087;
  --color-primary-hover: #004B93;
  --color-primary-bright: #41B6E6;
  --color-action: #007F3B;
  --color-action-hover: #00662F;

  --color-text: #212B32;
  --color-text-soft: #4C6272;
  --color-text-muted: #5B6B75;
  --color-on-primary: #FFFFFF;

  --color-border: #D8DDE0;
  --color-border-strong: #AEB7BD;
  --color-field-border: #768692;

  --color-canvas: #F0F4F5;
  --color-surface: #FFFFFF;
  --color-accent-surface: #E8F1F8;
  --color-accent-surface-strong: #D8E8F3;
  --color-accent-border: #BFD7EA;
  --color-positive-surface: #E6F2EB;

  --color-warning: #ED8B00;
  --color-warning-surface: #FFF4E5;
  --color-warning-text: #A45D00;
  --color-danger: #D5281B;
  --color-danger-surface: #FBE9E7;
  --color-danger-strong: #A61B13;

  --color-focus: #FFEB3B;
  --color-black: #000000;
  --color-scrim: color-mix(in srgb, var(--color-text) 60%, transparent);

  /* Brand teal: the logo only. Category accents: admin dashboard tiles only. */
  --color-brand-teal: #00A499;
  --color-category-purple: #330072;
  --color-category-pink: #AE2573;

  /* ---- Font families ---- */
  --font-sans: Manrope, ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-mono: ui-monospace, Consolas, monospace;

  /* ---- Type scale (px). Body copy is --fs-sm. Nothing below 12px. ---- */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fs-display: clamp(34px, 4vw, 52px);

  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-heavy: 800;

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-normal: 1.5;

  /* ---- Radius ---- */
  --radius-tag: 4px;
  --radius-control: 6px;
  --radius-card: 10px;
  --radius-panel: 14px;
  --radius-pill: 999px;
  --radius-round: 50%;

  /* ---- Spacing ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;

  /* ---- Elevation ---- */
  --shadow-soft: 0 3px 12px color-mix(in srgb, var(--color-text) 6%, transparent);
  --shadow: 0 18px 50px color-mix(in srgb, var(--color-text) 9%, transparent);
  --shadow-priority: 0 8px 24px color-mix(in srgb, var(--color-primary) 18%, transparent);

  /* ---- Z-index ---- */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 30;
  --z-overlay: 50;
  --z-modal: 100;
  --z-toast: 1000;

  /* ---- Logo sizes ---- */
  --logo-sm: 32px;
  --logo-md: 52px;
  --logo-lg: 68px;

  /* ---- Controls ---- */
  --tap-min: 44px;
  --control-height: 44px;
  --control-height-sm: 36px;

  /* ---- Motion. 160ms ease-out feedback; reveals stay under 300ms. ---- */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur-control: 160ms;
  --dur-reveal: 280ms;

  /* ---- Content gutter. Full-bleed views negate exactly this value. ---- */
  --content-gutter: clamp(22px, 4vw, 62px);

  /* ---- Icons: masks drawn in currentColor by .ico (components.css). ---- */
  --icon-arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --icon-arrow-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E");
  --icon-edit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16v4zM13.5 6.5l4 4'/%3E%3C/svg%3E");
  --icon-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E");
  --icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3.5 6.5l8.5 6.5 8.5-6.5'/%3E%3C/svg%3E");
}
