/**
 * public/assets/css/tokens.css
 * Package: 04 - UI/UX
 *
 * Design tokens (DESIGN_SYSTEM.md). Every color has a light AND dark value
 * defined up front — no retrofitting dark mode later (§6 Acceptance
 * Criteria). Mode switching via [data-theme] on <html>, set server-side
 * from a `theme` cookie (see app/Core/Http/ThemeController.php) so there is
 * no flash-of-wrong-theme on first paint (§5).
 */

:root,
[data-theme="light"] {
  /* Rebrand — Pet Shop Figma identity (orange / near-black / cream),
     replacing the previous green/gold palette. Structure (light+dark
     pair, prefers-color-scheme fallback) is unchanged — only values
     moved (§6 Acceptance Criteria still holds: nothing retrofitted). */
  --color-bg: #FFF8F1;
  --color-surface: #FFFFFF;
  --color-surface-alt: #FEEEE0;
  --color-border: #F3E1CE;
  --color-text-primary: #221A14;
  --color-text-secondary: #7A6B5E;
  --color-primary: #F1793B;
  --color-primary-hover: #DD6425;
  --color-on-primary: #FFFFFF;
  --color-accent: #201914;
  --color-on-accent: #FFFFFF;
  --color-success: #2E7D32;
  --color-warning: #ED6C02;
  --color-danger: #C62828;
  --color-info: #0277BD;

  --shadow-sm: 0 1px 2px rgba(32,20,10,.07);
  --shadow-md: 0 4px 14px rgba(32,20,10,.12);
  --shadow-lg: 0 14px 36px rgba(32,20,10,.18);
}

[data-theme="dark"] {
  --color-bg: #17120E;
  --color-surface: #221B15;
  --color-surface-alt: #2C231B;
  --color-border: #3B2F25;
  --color-text-primary: #FBF3EA;
  --color-text-secondary: #C2AF9F;
  --color-primary: #F68F5C;
  --color-primary-hover: #FAA877;
  --color-on-primary: #201409;
  --color-accent: #F3E7D9;
  --color-on-accent: #201914;
  --color-success: #66BB6A;
  --color-warning: #FFA726;
  --color-danger: #EF5350;
  --color-info: #4FC3F7;

  /* Dark surfaces need stronger shadow opacity to read correctly (§4). */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 4px 12px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
}

/* Respect prefers-color-scheme when no explicit `theme` cookie/toggle has
   been set yet — ThemeController writes data-theme explicitly once the
   visitor picks (or once LocalizationMiddleware/bootstrap defaults it). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #17120E;
    --color-surface: #221B15;
    --color-surface-alt: #2C231B;
    --color-border: #3B2F25;
    --color-text-primary: #FBF3EA;
    --color-text-secondary: #C2AF9F;
    --color-primary: #F68F5C;
    --color-primary-hover: #FAA877;
    --color-on-primary: #201409;
    --color-accent: #F3E7D9;
    --color-on-accent: #201914;
    --color-success: #66BB6A;
    --color-warning: #FFA726;
    --color-danger: #EF5350;
    --color-info: #4FC3F7;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
    --shadow-md: 0 4px 12px rgba(0,0,0,.45);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
  }
}

:root {
  /* Typography (§2). Arabic gets IBM Plex Sans Arabic, matching Zorro's
     established DataVista typography standard; Latin gets Inter. Equal
     line-height treatment for both scripts (Constitution §11). */
  --font-latin: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'IBM Plex Sans Arabic', Tahoma, sans-serif;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;

  --leading-body: 1.5;
  --leading-heading: 1.2;

  /* Spacing scale, 4px base unit (§3). */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radii (§4). */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;
}

/* Desktop typography bump (SCREENS_AND_STATES.md §1 breakpoints: `md` = 768px). */
@media (min-width: 768px) {
  :root {
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 28px;
    --text-3xl: 36px;
  }
}
