/* ============================================================
   MXPracto Design Tokens — Single Source of Truth
   Import BEFORE components_mx.css and admin_theme.css
   ============================================================ */

:root {
  /* ==========================================
     BRAND — Doccure design language (2026-09 pivot, V2 structural)
     Brand blue is the action color; blue→CYAN gradient CTAs carry
     the Doccure signature (NOT green). Hero carries the vertical
     blue→cyan→mint gradient token.
     AA note: #2d67f0 passes 4.5:1 with white text.
     #316dff (light) is decoration/large-text only (4.41:1).
     ========================================== */
  --mx-brand: #2d67f0;
  --mx-brand-dark: #1f50c9;
  --mx-brand-light: #316dff;
  --mx-brand-surface: #e9f0ff;
  --mx-brand-glow: rgba(49, 109, 255, 0.12);

  --mx-primary: #2d67f0;
  --mx-primary-dark: #1f50c9;
  --mx-primary-darker: #1a44d6;
  --mx-primary-light: #316dff;
  --mx-primary-surface: #e9f0ff;
  --mx-primary-glow: rgba(49, 109, 255, 0.15);

  /* ==========================================
     SEMANTIC — Success / Danger / Warning (Doccure pivot, AA-verified)
     Vibrant hues for badges/large UI; -dark variants are the AA text pair.
     ========================================== */
  --mx-success: #04bd6c;
  --mx-success-dark: #00882d;
  --mx-success-surface: #E6FBF1;
  --mx-success-btn: #008a3e;

  --mx-danger: #ff0000;
  --mx-danger-dark: #cc0000;
  --mx-danger-surface: #FFEBEB;

  --mx-warning: #ffca18;
  --mx-warning-dark: #946200;
  --mx-warning-surface: #FFF7DB;
  --mx-star: #ffca18;

  /* ==========================================
     NEUTRAL SCALE — Surface, border, ink
     ========================================== */
  --mx-white: #FFFFFF;
  --mx-white-a06: rgba(255, 255, 255, 0.06);
  --mx-white-a08: rgba(255, 255, 255, 0.08);
  --mx-white-a10: rgba(255, 255, 255, 0.10);
  --mx-white-a15: rgba(255, 255, 255, 0.15);
  --mx-white-a20: rgba(255, 255, 255, 0.20);
  --mx-white-a22: rgba(255, 255, 255, 0.22);
  --mx-white-a35: rgba(255, 255, 255, 0.35);
  --mx-white-a50: rgba(255, 255, 255, 0.50);
  --mx-white-a60: rgba(255, 255, 255, 0.60);
  --mx-white-a80: rgba(255, 255, 255, 0.80);
  --mx-white-a85: rgba(255, 255, 255, 0.85);
  --mx-white-a95: rgba(255, 255, 255, 0.95);
  --mx-surface: #FFFFFF;
  --mx-surface-alt: #F8FAFC;
  --mx-surface-hover: #F1F5F9;

  --mx-border-light: #F1F5F9;
  --mx-border: #E2E8F0;

  --mx-gray-50: #F8FAFC;
  --mx-gray-100: #F1F5F9;
  --mx-gray-200: #E2E8F0;
  --mx-gray-300: #CBD5E1;
  --mx-gray-400: #94A3B8;
  --mx-gray-500: #64748B;
  --mx-gray-600: #475569;
  --mx-gray-700: #334155;

  --mx-ink-muted: #75757A;
  --mx-ink-soft: #414146;
  --mx-ink-surface: #414146;
  --mx-ink-deep: #0f172a;
  --mx-ink: #414146;

  --mx-muted: var(--mx-ink-muted); /* backward-compat alias */

  --mx-info: #0EA5E9;
  --mx-auth-action: var(--mx-primary);
  --mx-auth-link: var(--mx-primary);
  --mx-auth-muted: var(--mx-ink-muted);

  /* ==========================================
     TYPOGRAPHY
     ========================================== */
  --mx-font: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mx-font-sans: var(--mx-font); /* backward-compat alias */
  --mx-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --mx-text-xs: 13px;
  --mx-text-sm: 13px;
  --mx-text-base: 14px;
  --mx-text-lg: 16px;
  --mx-text-xl: 20px;
  --mx-text-2xl: 24px;
  --mx-text-3xl: 30px;
  /* Doccure V2: section titles are 42px/700 (measured) */
  --mx-title-xl: 42px;

  /* ==========================================
     SPACING — 4px base unit
     ========================================== */
  --mx-space-1: 4px;
  --mx-space-2: 8px;
  --mx-space-3: 12px;
  --mx-space-4: 16px;
  --mx-space-5: 20px;
  --mx-space-6: 24px;
  --mx-space-8: 32px;
  --mx-space-10: 40px;

  /* ==========================================
     BORDER RADIUS
     ========================================== */
  --mx-radius-sm: 6px;
  --mx-radius-md: 10px;
  --mx-radius: 8px;
  --mx-radius-lg: 12px;
  --mx-radius-xl: 16px;
  --mx-radius-card: 12px;
  /* Doccure V2: buttons are 44px pills (measured). Fallbacks keep
     --mx-radius-pill semantic: a pill never becomes a rounded-rect. */
  --mx-radius-btn: 44px;
  --mx-radius-pill: 9999px;

  /* ==========================================
     SHADOWS — Layered depth system
     Two-layer construction (ambient + key) gives the
     premium elevated feel without harshness.
     ========================================== */
  --mx-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --mx-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --mx-shadow: 0 2px 4px rgba(16, 24, 40, 0.04), 0 4px 8px rgba(16, 24, 40, 0.06);
  --mx-shadow-md: 0 4px 8px rgba(16, 24, 40, 0.05), 0 8px 16px rgba(16, 24, 40, 0.07);
  --mx-shadow-lg: 0 8px 16px rgba(16, 24, 40, 0.06), 0 16px 32px rgba(16, 24, 40, 0.08);
  --mx-shadow-xl: 0 12px 24px rgba(16, 24, 40, 0.08), 0 24px 48px rgba(16, 24, 40, 0.10);
  --mx-shadow-2xl: 0 16px 32px rgba(16, 24, 40, 0.10), 0 32px 64px rgba(16, 24, 40, 0.12);
  --mx-shadow-focus: 0 0 0 3px rgba(49, 109, 255, 0.25);
  --mx-shadow-cta: 0 4px 14px rgba(2, 191, 255, 0.25);
  --mx-shadow-cta-hover: 0 6px 18px rgba(2, 191, 255, 0.32);
  --mx-shadow-primary: 0 4px 12px rgba(49, 109, 255, 0.25), 0 8px 24px rgba(49, 109, 255, 0.18);
  --mx-shadow-primary-lg: 0 8px 24px rgba(49, 109, 255, 0.30), 0 16px 40px rgba(49, 109, 255, 0.22);
  --mx-shadow-brand: 0 4px 12px rgba(45, 103, 240, 0.18), 0 8px 24px rgba(45, 103, 240, 0.14);
  --mx-shadow-inset: inset 0 1px 2px rgba(16, 24, 40, 0.06);
  --mx-shadow-ring: 0 0 0 1px rgba(16, 24, 40, 0.06);

  /* ==========================================
     TRANSITIONS
     ========================================== */
  --mx-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --mx-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --mx-ease-brilliant: 600ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ==========================================
     WAVE-1 ADDITIVE EXTENSIONS (2026-09)
     Additive only — nothing above is renamed or removed.
     ========================================== */
  /* Font weights (were hardcoded 500/600/700 across surfaces) */
  --mx-font-weight-regular: 400;
  --mx-font-weight-medium: 500;
  --mx-font-weight-semibold: 600;
  --mx-font-weight-bold: 700;
  --mx-font-weight-extrabold: 800;
  /* Extra spacing steps for section rhythm (48/64 were hardcoded) */
  --mx-space-12: 48px;
  --mx-space-16: 64px;
  /* Semantic status colors — derived from locked palette, no new hex */
  --mx-status-success: var(--mx-success);
  --mx-status-success-bg: var(--mx-success-surface);
  --mx-status-pending: var(--mx-warning);
  --mx-status-pending-bg: var(--mx-warning-surface);
  --mx-status-danger: var(--mx-danger);
  --mx-status-danger-bg: var(--mx-danger-surface);
  --mx-status-info: var(--mx-primary-dark);
  --mx-status-info-bg: var(--mx-primary-surface);
  --mx-status-neutral: var(--mx-gray-600);
  --mx-status-neutral-bg: var(--mx-gray-100);
  --mx-status-brand: var(--mx-brand);
  --mx-status-brand-bg: var(--mx-brand-surface);
  /* Doccure V2: --mx-radius-btn (44px pill) is defined in the radius block above.
     The old 8px re-assert here was silently overriding it in cascade order. */
  --mx-radius-input: 6px;
  --mx-radius-badge: 9999px;
  /* V2.1 CORE (Doccure V2.1 pivot) — additive shared-component tokens.
     Measured from live Doccure reference 2026-09-06:
     primary pill 44px radius / 16px / 500-600 / gradient 90.08deg
     #316dff 0.09% -> #02bfff 70.28%; secondary = solid ink pill
     rgb(15,23,42) 1px self-border 30px radius (reference btn-dark);
     inputs 5px radius, 7px 15px padding, 1px solid #E2E8F0, 38px height.
     NOTE: reference suppresses focus rings (outline:none) — we keep the
     DESIGN.md 2px brand-blue focus-visible contract instead (AA/WCAG). */
  --mx-btn-font-size: 16px;
  --mx-btn-font-weight: var(--mx-font-weight-medium);
  --mx-btn-pad-y: 10px;
  --mx-btn-pad-x: 20px;
  --mx-btn-focus-ring: 0 0 0 2px var(--mx-surface), 0 0 0 4px var(--mx-primary-light);
  --mx-input-pad-y: 9px;
  --mx-input-pad-x: 15px;
  --mx-input-height: 40px;
  /* Motion durations (120-200ms micro-interaction band) */
  --mx-duration-fast: 120ms;
  --mx-duration-base: 160ms;
  --mx-duration-normal: 200ms;
  --mx-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --mx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* Elevation aliases (L1/L2/L3 ladder from master plan) */
  --mx-elevation-1: var(--mx-shadow-xs);
  --mx-elevation-2: var(--mx-shadow-md);
  --mx-elevation-3: var(--mx-shadow-xl);
  /* Page container rhythm */
  --mx-container-max: 1200px;
  --mx-container-pad: 24px;
  /* Global soft neutral page background */
  --mx-page-bg: #F7F9FB;

  /* ==========================================
     DOCCURE EXTENSIONS (2026-09 pivot) — additive only
     V2 (structural rebuild): signature CTA gradient is blue→CYAN
     (#316dff -> #0374b0 at 70% after v21_fixC), 90deg horizontal.
     NOT green. AA: end-stop #0374b0 vs white = 5.09:1 PASS (was
     #02bfff=2.12 FAIL, then #0284c7=4.10 FAIL). Start #316dff = 4.41:1
     (passes AA-large 3.0+ at 14-16px 600-weight). Hero is the vertical
     variant; top dark-blue zone white text = 4.93-5.15:1 PASS.
     ========================================== */
  --mx-secondary: #1FB257;
  --mx-secondary-dark: #17843f;     /* AA text pair on white (4.76:1) */
  --mx-secondary-light: #2fc968;
  --mx-secondary-surface: #E6FBEE;
  --mx-secondary-glow: rgba(31, 178, 87, 0.15);

  --mx-orange: #e04f16;             /* Doccure orange accent */
  --mx-orange-dark: #c24310;        /* AA text pair on white (5.12:1) */
  --mx-orange-surface: #FDEEE4;

  /* Signature CTA gradient — removed in 2026-09 gradient-removal pass.
     Kept as `none` so any stale `var(--mx-gradient*)` lookups resolve
     without breaking (safer than removing the custom property). */
  --mx-gradient: none;
  --mx-gradient-hover: none;
  --mx-gradient-soft: none;
  --mx-gradient-deg: none;

  /* V2 hero gradient — removed in 2026-09 gradient-removal pass.
     Kept as `none` (safer than removing) — see comment above. */
  --mx-gradient-hero: none;

  /* V2 signature card shadows (measured) */
  --mx-shadow-soft: 0 4px 34px rgba(206, 206, 206, 0.25);   /* diffuse card */
  --mx-shadow-widget: 0 7.5px 17.5px rgba(0, 0, 0, 0.05);   /* dashboard widget */
  /* V2.1 CORE: secondary/ink button pill + tint chips/tabs/pager (additive) */
  --mx-ink-btn: var(--mx-ink-deep);        /* solid ink pill fill (ref btn-dark) */
  --mx-ink-btn-hover: #1e293b;             /* hover pair for ink pill */
  --mx-chip-surface: color-mix(in srgb, var(--mx-primary) 8%, var(--mx-surface));
  --mx-chip-surface-hover: color-mix(in srgb, var(--mx-primary) 14%, var(--mx-surface));
  --mx-tab-underline: 2px;
  --mx-pager-bg: var(--mx-surface);
  --mx-pager-bg-hover: var(--mx-primary-surface);
  --mx-empty-icon: var(--mx-gray-300);

  /* Alias so legacy surface CSS can opt into gradient without touching JS */
  --mx-primary-gradient: var(--mx-gradient);

  /* ==========================================
     Z-INDEX SCALE
     ========================================== */
  --mx-z-dropdown: 100;
  --mx-z-sticky: 200;
  --mx-z-navbar: 1030;
  --mx-z-sidebar: 1040;
  --mx-z-modal: 1050;
  --mx-z-tooltip: 1060;
}


/* ===== FA ICON FONT GUARD — never let Hanken Grotesk override icons ===== */
.fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-brands,
i[class^="fa-"], i[class*=" fa-"] {
  font-style: normal !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.fa, .fas, .fa-solid,
i.fa-solid, i.fas {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 900 !important;
}
.far, .fa-regular,
i.fa-regular, i.far {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 400 !important;
}
.fab, .fa-brands,
i.fa-brands, i.fab {
  font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
  font-weight: 400 !important;
}
