/* =====================================================================
   Shared design tokens — the SINGLE source of truth for values that are
   identical across every portal (patient site, auth pages, clinic admin).

   Loaded FIRST by every layout/head, before pages.css / clinic.css.
   Anything portal-specific (type-size scale, radii sm–xl, transitions)
   or theme-specific (admin dark-mode overrides) deliberately stays in
   pages.css / clinic-tokens.css — only put a token here if both portals
   share the exact same value.
   ===================================================================== */
:root {
  /* Page background — change THIS one line to recolour every portal's
     main canvas. (Admin dark mode overrides --page-bg in clinic-tokens.css.) */
  --page-bg: #FDFBF8;

  /* Muted-text scale (admin dark mode overrides these in clinic-tokens.css) */
  --text-secondary: #6f6f6a;
  /* Darkened from #9a9a95 → #6a6a61 to meet WCAG 2.1 AA contrast (4.5:1) on the
     near-white app background AND on tinted table cells (#eef6f4, 4.97:1); the
     old value scored 2.73:1 (axe "serious"). */
  --text-faint: #6a6a61;
  --color-danger-strong: #C0392B;  /* strong red — badges (shared by both portals) */

  /* Font weights */
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Display/heading font — Playfair serif, the SINGLE source of truth shared
     by both portals (and mirrored in email.ts for transactional emails, which
     can't read CSS vars). Loaded via the Google Fonts <link> in each layout. */
  --font-display: 'Playfair Display', Georgia, serif;

  /* Body font — Plus Jakarta Sans, the SINGLE source of truth shared by both portals.
     Loaded via the Google Fonts <link> in each layout. */
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --space-xs: 0.25rem;   /*  4px */
  --space-sm: 0.5rem;    /*  8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */

  /* Radius — only the fully-round pill is shared; sm/md/lg/xl differ per portal */
  --radius-full: 9999px;

  /* Z-index scale */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 100;
  --z-header: 200;
  --z-dropdown: 1000;
  --z-modal-backdrop: 9000;
  --z-modal: 9100;
  --z-toast: 10000;

  /* =====================================================================
     Global SSOT Mobile layout variables (Phase 15 Lockdown)
     ===================================================================== */
  --mobile-max-width: 560px;
  --mobile-page-padding: var(--space-lg);      /* 24px horizontal padding */
  --mobile-header-height: 56px;
  --mobile-header-padding-x: var(--space-md);  /* 16px */
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-safe-top: env(safe-area-inset-top, 0px);
  --mobile-radius-circle: 50%;
  --mobile-radius-full: 9999px;
  --mobile-radius-card: 16px;
  --mobile-radius-inner: 12px;
  --mobile-radius-sheet: 20px;
  --mobile-lh-normal: normal;
  --mobile-lh-tight: 1.2;
}

/* Shared visibility utility — used by both portals' JS to toggle elements.
   Single source of truth (was duplicated in pages.css + clinic.css). */
.hidden { display: none !important; }
