/* tokens.css — single source of truth for all design values.
   Never hardcode colors/sizes elsewhere; reference these variables.
   Approved decisions: D1 field border, D3 danger color, D6 self-hosted fonts. */
:root {
  /* Color — roles */
  --color-bg: #f3eee2;            /* Soft Ivory: page background */
  --color-surface: #ebe1cc;       /* cards & fields */
  --color-ink: #261829;           /* Midnight Violet: top bar, headings, primary buttons, text */
  --color-ink-on-dark: #f3eee2;   /* text on Midnight Violet (14.57:1) */
  --color-accent: #cdbd9f;        /* Warm Beige: badges, progress fill (on dark only) */
  --color-text: #261829;
  --color-text-muted: #464134;    /* Dry Sage: 8.78:1 on bg, 7.83:1 on surface */
  --color-border: rgba(70, 65, 52, 0.2);  /* soft decorative card border (approved) */
  --color-border-field: #857e6a;  /* D1 approved: interactive boundary, 3.12:1 on surface */
  --color-danger: #8f3a2f;        /* D3 approved: 5.75:1 on surface, 6.45:1 on bg */
  --color-track: rgba(243, 238, 226, 0.2);    /* progress track on dark bar */
  --color-overlay: rgba(38, 24, 41, 0.55);

  /* Typography (D6: self-hosted via fonts.css) */
  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Manrope", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --text-xs: 0.8125rem;                         /* 13px signature (mobile) */
  --text-signature: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);  /* 13–14px */
  --text-sm: 0.9375rem;                         /* 15px labels */
  --text-hint: 0.875rem;                        /* 14px hints & errors */
  --text-base: 1.0625rem;                       /* 17px body & inputs (>=16px: no iOS zoom) */
  --text-lg: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);   /* lede 16–18px */
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);    /* step title 20–24px */
  --text-2xl: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);   /* page title 24–36px */
  --lh-body: 1.8; --lh-heading: 1.35; --lh-tight: 1.2;

  /* Space (4px base) */
  --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;
  --gutter: clamp(16px, 4vw, 32px);
  --container: 880px;

  /* Radius */
  --radius-card: 20px;
  --radius-control: 14px;
  --radius-pill: 999px;

  /* Elevation & motion */
  --shadow-card: 0 1px 2px rgba(38, 24, 41, 0.06), 0 8px 24px rgba(38, 24, 41, 0.06);
  --shadow-modal: 0 24px 64px rgba(38, 24, 41, 0.28);
  --dur-fast: 150ms; --dur-base: 250ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Controls */
  --control-h: 52px;              /* inputs & buttons; >= 44px touch target */
  --focus-ring: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--color-ink);
  --focus-ring-on-dark: 0 0 0 3px var(--color-ink), 0 0 0 5px var(--color-ink-on-dark);

  /* Limits (CONFIG-adjacent; used by UI copy) */
  --wa-limit: 1800;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; }
}
