/* =============================================================================
   MFA Distribution Report — CSS Design System
   variables.css — Full custom properties file (Phase 1.5)
   All property values match the MFA brand defined in implementation_plan.md §1.5
   Usage: referenced in both _Layout.cshtml and _AdminLayout.cshtml
   ========================================================================== */

/* ─── Color Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* ====== MFA Brand Palette (single source of truth) ====== */
  --mfa-shell-bg: #102732;         /* Header, footer, login bg, dark branded surfaces */
  --mfa-heading-text: #0C4D6C;     /* Main question text, section headings, high-emphasis labels */
  --mfa-teal: #2081A1;             /* Section title background — teal */
  --mfa-rose: #ED385D;             /* Section title background — rose */
  --mfa-orange: #F48420;           /* Section title background — orange */
  --mfa-green: #46B755;            /* Section title background — green */
  --mfa-grey: #748787;             /* Neutral brand stripe — grey */

  /* ====== Brand Gradients ====== */
  --gradient-brand-smooth: linear-gradient(to right, var(--mfa-green), var(--mfa-orange), var(--mfa-rose), var(--mfa-grey), var(--mfa-teal));
  --gradient-brand-stripe: linear-gradient(to right,
      var(--mfa-green) 0%, var(--mfa-green) 16.66%,
      var(--mfa-orange) 16.66%, var(--mfa-orange) 33.33%,
      var(--mfa-rose) 33.33%, var(--mfa-rose) 50%,
      var(--mfa-grey) 50%, var(--mfa-grey) 66.66%,
      var(--mfa-teal) 66.66%, var(--mfa-teal) 83.33%,
      var(--mfa-heading-text) 83.33%, var(--mfa-heading-text) 100%);

  /* ====== Semantic Palette (derived from MFA brand) ====== */

  /* Primary — from --mfa-heading-text */
  --color-primary: var(--mfa-heading-text);
  --color-primary-dark: var(--mfa-shell-bg);
  --color-primary-light: var(--mfa-teal);
  --color-primary-subtle: #e6f1f7;              /* tint of --mfa-heading-text */
  --color-primary-rgb: 12, 77, 108;             /* rgb of --mfa-heading-text */
  --color-accent-rgb: 70, 183, 85;              /* rgb of --mfa-green */

  /* Secondary — from --mfa-orange */
  --color-secondary: var(--mfa-orange);
  --color-secondary-dark: #c97b10;              /* darker shade of --mfa-orange */
  --color-secondary-light: #fbd08c;             /* tint of --mfa-orange */

  /* Feedback — derived from brand palette */
  --color-success: #1a7f5a;                     /* darker shade of --mfa-green */
  --color-success-light: #d1f0e3;               /* tint of --mfa-green */
  --color-warning: #b45309;                     /* darker shade of --mfa-orange */
  --color-warning-light: #fef3c7;               /* tint of --mfa-orange */
  --color-danger: #b91c1c;                      /* darker shade of --mfa-rose */
  --color-danger-light: #fee2e2;                /* tint of --mfa-rose */
  --color-info: var(--mfa-teal);
  --color-info-light: #e0f2fe;                  /* tint of --mfa-teal */

  /* Neutrals (brand-independent scale) */
  --color-white: #ffffff;
  --color-off-white: #f8f9fa;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: var(--mfa-grey);
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: var(--mfa-shell-bg);
  --color-gray-900: #111827;
  --color-black: #0a0a0a;

  /* Surfaces */
  --color-surface: #ffffff;
  --color-surface-raised: #f8f9fa;
  --color-surface-overlay: rgba(0, 0, 0, 0.04);

  /* Status badges — from brand palette */
  --color-status-new: var(--mfa-heading-text);
  --color-status-reviewed: var(--mfa-green);
  --color-status-archived: var(--mfa-grey);
}

/* ─── Typography Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Font families */
  --font-latin: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Tajawal', 'Arial Unicode MS', sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;

  /* Font sizes (fluid scale) */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-md: 1.125rem;
  /* 18px */
  --text-lg: 1.25rem;
  /* 20px */
  --text-xl: 1.5rem;
  /* 24px */
  --text-2xl: 1.875rem;
  /* 30px */
  --text-3xl: 2.25rem;
  /* 36px */
  --text-4xl: 3rem;
  /* 48px */

  /* Font weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semi: 600;
  --font-bold: 700;
  --font-black: 900;

  /* Line heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Letter spacing */
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;
}

/* ─── Spacing Tokens ─────────────────────────────────────────────────────────── */
:root {
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */
}

/* ─── Border Tokens ──────────────────────────────────────────────────────────── */
:root {
  --border-width: 1px;
  --border-width-2: 2px;
  --border-color: var(--color-gray-200);
  --border-color-focus: var(--color-primary);

  /* Border radii */
  --radius-sm: 0.25rem;
  /* 4px */
  --radius-md: 0.375rem;
  /* 6px */
  --radius-lg: 0.5rem;
  /* 8px */
  --radius-xl: 0.75rem;
  /* 12px */
  --radius-2xl: 1rem;
  /* 16px */
  --radius-full: 9999px;
}

/* ─── Shadow Tokens ─────────────────────────────────────────────────────────── */
:root {
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.07), 0 4px 6px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.07), 0 10px 10px rgba(0, 0, 0, 0.03);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ─── Transition Tokens ────────────────────────────────────────────────────── */
:root {
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Z-Index Scale ──────────────────────────────────────────────────────────── */
:root {
  --z-base: 0;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-toast: 700;
  --z-tooltip: 800;
}

/* ─── Layout Tokens ─────────────────────────────────────────────────────────── */
:root {
  --container-max: 1280px;
  --container-form: 860px;
  /* Max width for the public form */
  --admin-sidebar-w: 260px;
  --admin-header-h: 64px;
  --form-section-gap: var(--space-8);
}

/* ─── Form Tokens ───────────────────────────────────────────────────────────── */
:root {
  --input-height: 44px;
  --input-padding-x: var(--space-4);
  --input-padding-y: var(--space-3);
  --input-border: var(--border-width) solid var(--color-gray-300);
  --input-border-focus: var(--border-width-2) solid var(--color-primary);
  --input-bg: var(--color-white);
  --input-bg-disabled: var(--color-gray-100);
  --input-radius: var(--radius-md);
  --input-shadow-focus: 0 0 0 3px rgba(18, 78, 108, 0.18);
  --label-color: var(--color-gray-700);
  --label-weight: var(--font-medium);
  --required-color: var(--color-danger);
  --help-text-color: var(--color-gray-500);
}

/* ─── Admin Layout Tokens ───────────────────────────────────────────────────── */
:root {
  --admin-bg: #f0f4f8;
  --admin-sidebar-bg: #1a2332;
  --admin-sidebar-text: #c8d4e4;
  --admin-sidebar-hover: #2a3a55;
  --admin-header-bg: var(--color-white);
  --admin-card-bg: var(--color-white);
}

/* ─── Base Resets ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-latin);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--color-gray-800);
  background-color: var(--color-off-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Arabic font override */
:lang(ar) body,
[dir="rtl"] body {
  font-family: var(--font-arabic);
}