/* ============================================================
   Government Razor Frontend — Design Tokens
   Drop this at the top of your site's CSS bundle.
   All other component styles reference these variables.
   ============================================================ */

:root {
  /* ---------- BRAND & NEUTRALS ---------- */
  --gov-primary:       #0F4C81;
  --gov-primary-700:   #0B3A63;
  --gov-primary-100:   #E8F1F9;
  --gov-secondary:     #1A6E5C;

  --gov-ink:           #1B1F23;
  --gov-ink-2:         #3D444B;
  --gov-ink-3:         #6A737D;

  --gov-bg:            #FBFBFC;
  --gov-surface:       #FFFFFF;
  --gov-surface-alt:   #F4F5F7;

  --gov-border:        #DEE2E6;
  --gov-border-strong: #B6BCC4;
  --gov-focus-ring:    #1F7DCC;

  /* ---------- FUNCTIONAL ---------- */
  --success:        #1A7F37;
  --success-border: #6FCF97;
  --success-tint:   #E6F4EA;

  --warning:        #9A6700;
  --warning-border: #E0B341;
  --warning-tint:   #FFF8E1;

  --danger:         #B42318;
  --danger-border:  #F0A39C;
  --danger-tint:    #FEF1F0;

  --info:           #0B5FA3;
  --info-border:    #7FB3DC;
  --info-tint:      #E8F1F9;

  /* ---------- TYPOGRAPHY ---------- */
  --font-sans-en: "Inter", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans-ar: "IBM Plex Sans Arabic", "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  1.875rem;
  --text-3xl:  2.25rem;
  --text-4xl:  3rem;

  --leading-tight:  1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* ---------- SPACING (4px base) ---------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* ---------- BORDER & RADIUS ---------- */
  --border-thin:   1px;
  --border-medium: 2px;
  --border-thick:  4px;

  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-pill: 999px;

  /* ---------- SHADOWS (sparingly) ---------- */
  --shadow-sm:    0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.06);
  --shadow-md:    0 4px 8px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-lg:    0 12px 24px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.06);
  --shadow-focus: 0 0 0 3px rgba(31, 125, 204, 0.35);

  /* ---------- MOTION ---------- */
  --ease-standard:    cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized:  cubic-bezier(0.3, 0, 0, 1);
  --duration-instant: 100ms;
  --duration-fast:    150ms;
  --duration-medium:  250ms;
  --duration-slow:    350ms;

  /* ---------- LAYOUT ---------- */
  --z-base:     0;
  --z-sticky:   10;
  --z-dropdown: 100;
  --z-overlay:  500;
  --z-modal:    501;
  --z-toast:    600;
  --z-tooltip:  700;

  --container-max: 1280px;
  --content-max:   720px;
  --prose-max:     68ch;
}

/* ---------- DIRECTION-AWARE FONT SWITCHING ---------- */
html { font-family: var(--font-sans-en); }
html[dir="rtl"] { font-family: var(--font-sans-ar); }
html[dir="rtl"] body { line-height: var(--leading-relaxed); }

/* ---------- RESET BASELINE ---------- */
body {
  background: var(--gov-bg);
  color: var(--gov-ink);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11", "cv05";
}
html[dir="rtl"] body { font-feature-settings: normal; }

/* ---------- GLOBAL FOCUS RING ---------- */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--gov-focus-ring);
  outline-offset: 2px;
  border-radius: inherit;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- VISUALLY HIDDEN (screen-reader only) ---------- */
.visually-hidden,
.visually-hidden:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
