/* ============================================================
   IMAAR ASSOCIATES — Design tokens (Session 2)
   Loaded BEFORE style.css. Every new component (components.css,
   shell.css) uses only these variables.

   Naming: tokens use their own prefixes (--color-*, --space-*, --r-*,
   --elev-*, --fs-*) so they never collide with the older variables in
   style.css (--navy, --radius, --shadow…), which stay until the page
   bodies are rebuilt in Sessions 8–9.

   Brand colours are the exact values already used in style.css:
     navy  #1A3C6E   (style.css --navy)
     gold  #C9A84C   (style.css --gold)
   ============================================================ */

:root {
  /* ── Colour: brand ─────────────────────────────────────────── */
  --color-navy:        #1A3C6E;
  --color-navy-deep:   #0D2147;   /* style.css --navy-dark */
  --color-navy-soft:   #EEF2F8;   /* navy tint for selected / hover surfaces */
  --color-gold:        #C9A84C;
  --color-gold-deep:   #866A1C;   /* gold on white text/icons — Session 11b: darkened to pass WCAG AA (4.5:1) */
  --color-gold-soft:   #F8F1DF;   /* gold tint, used sparingly */
  --color-on-gold:     #0D2147;   /* text on a gold button */

  /* ── Colour: surfaces & text ──────────────────────────────── */
  --color-bg:          #F5F7FA;   /* off-white app background (same as style.css --bg, so older page sections don't show seams) */
  --color-surface:     #FFFFFF;
  --color-surface-2:   #F2F3F5;   /* inputs, chips, skeletons */
  --color-text:        #16213A;   /* primary */
  --color-text-2:      #4A5568;   /* secondary */
  --color-text-muted:  #5F6B7A;   /* captions, placeholders — Session 11b: 5.4:1 on white (was #7A8494, 3.8:1) */
  --color-border:      #E7E8EC;   /* hairline, used rarely */
  --color-overlay:     rgba(13, 33, 71, .45);

  /* ── Colour: status ───────────────────────────────────────── */
  --color-success:      #18773F;   /* Session 11b: 5.6:1 on white (WCAG AA) */
  --color-success-soft: #E7F5EC;
  --color-warning:      #975A16;   /* Session 11b: 5.0:1 on its soft background (WCAG AA) */
  --color-warning-soft: #FDF3E1;
  --color-danger:       #C53030;
  --color-danger-soft:  #FCEBEB;
  --color-info:         #2B6CB0;
  --color-info-soft:    #E8F1FB;

  /* ── Radius ───────────────────────────────────────────────── */
  --r-8:    8px;
  --r-12:   12px;
  --r-16:   16px;
  --r-20:   20px;
  --r-pill: 999px;

  /* ── Spacing scale ────────────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  48px;

  /* ── Shadows (very soft) ──────────────────────────────────── */
  --elev-sm: 0 1px 2px rgba(22, 33, 58, .04), 0 2px 8px rgba(22, 33, 58, .05);
  --elev-md: 0 2px 6px rgba(22, 33, 58, .05), 0 10px 28px rgba(22, 33, 58, .08);

  /* ── Typography ───────────────────────────────────────────── */
  /* English: Inter. Urdu: Noto Naskh Arabic — clean and compact enough
     for app UI (Nastaliq's tall ascenders clip in buttons and chips). */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Inter first: it has no Arabic glyphs, so Urdu falls through to Naskh
     while names, prices and numbers stay in Inter (Naskh's Latin is serif). */
  --font-urdu: 'Inter', 'Noto Naskh Arabic', system-ui, sans-serif;
  --font-body: var(--font-sans);

  --fs-display: clamp(28px, 6vw, 40px);
  --fs-h1:      clamp(24px, 4.5vw, 30px);
  --fs-h2:      20px;
  --fs-h3:      17px;
  --fs-body:    15px;
  --fs-small:   13px;
  --fs-caption: 12px;

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;

  --lh-tight: 1.25;
  --lh-snug:  1.4;
  --lh-body:  1.55;

  /* ── Interaction ──────────────────────────────────────────── */
  --tap-min:     44px;                                  /* minimum touch target */
  --focus-ring:  0 0 0 3px rgba(201, 168, 76, .55);     /* gold ring, visible on navy and white */
  --ease:        cubic-bezier(.2, .7, .2, 1);
  --dur-fast:    .15s;
  --dur:         .25s;

  /* ── Shell sizes ──────────────────────────────────────────── */
  --topbar-h:        56px;
  --tabbar-h:        64px;
  --safe-bottom:     env(safe-area-inset-bottom, 0px);
  --content-max:     1100px;   /* lists, dashboards */
  --content-narrow:  680px;    /* forms, booking steps */
}

@media (min-width: 1024px) {
  :root { --topbar-h: 64px; }
}

/* Urdu: swap the body font and give the script more room to breathe. */
html[lang="ur"] {
  --font-body: var(--font-urdu);
  --lh-body:   1.9;
  --lh-snug:   1.75;
  --lh-tight:  1.6;
}

/* ── Focus: visible for keyboard users, invisible for taps ──── */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-8);
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
