/* ════════════════════════════════════════════════════════════════════════════════
   🏛️ CIVIC OS UNIFIED DESIGN SYSTEM
   Source unique de vérité pour tout l'écosystème Peuple1
   Consolidation de 3 systèmes CSS en 1 base universelle
   ════════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════════
   🎨 DESIGN TOKENS - SOURCE DE VÉRITÉ
   ════════════════════════════════════════════════════════════════════════════════ */

:root {
  /* ═══ COULEURS MODULES (Source de vérité officielle) ═══ */
  --biq-primary: #DC2626;              /* Rouge investigation */
  --gn-primary: #3B82F6;               /* Bleu protection */  
  --rdkq-primary: #DC143C;             /* Rouge crimson république */
  --monark-primary: #8B5A3C;           /* Brun royal constitutionnel */
  --sheriff-primary: #6B7280;          /* Gris justice */
  --hub-primary: #4F46E5;              /* Indigo central */
  
  /* ═══ SYSTÈME DE THÈMES DYNAMIQUES ═══ */
  /* La variable --theme-primary est changée automatiquement selon le module */
  --theme-primary: var(--hub-primary);
  --theme-primary-dark: color-mix(in srgb, var(--theme-primary) 80%, black);
  --theme-primary-light: color-mix(in srgb, var(--theme-primary) 20%, white);
  --theme-accent: var(--theme-primary);
  --theme-glow: color-mix(in srgb, var(--theme-primary) 50%, transparent);
  
  /* ═══ PALETTE SYSTÈME UNIVERSELLE ═══ */
  --civic-gold: #D4AF37;               /* Or pour éléments premium */
  --civic-gold-light: #F4E4A6;         
  --civic-silver: #E0E0E0;             /* Argent pour métaux */
  
  /* Couleurs sémantiques */
  --civic-success: #10B981;            /* Vert succès */
  --civic-warning: #F59E0B;            /* Orange avertissement */
  --civic-error: #EF4444;              /* Rouge erreur */
  --civic-info: #06B6D4;               /* Cyan information */
  
  /* ═══ BACKGROUNDS ET SURFACES ═══ */
  --civic-bg-main: #0B1220;            /* Background principal sombre */
  --civic-bg-surface: rgba(255, 255, 255, 0.05);
  --civic-bg-elevated: rgba(255, 255, 255, 0.12);
  --civic-bg-card: rgba(255, 255, 255, 0.1);
  --civic-bg-card-hover: rgba(255, 255, 255, 0.15);
  --civic-bg-navbar: rgba(11, 18, 32, 0.9);
  
  /* Background gradients dynamiques basés sur le thème */
  --civic-bg-gradient: linear-gradient(135deg,
    color-mix(in srgb, var(--theme-primary) 8%, black) 0%,
    var(--civic-bg-main) 40%,
    color-mix(in srgb, var(--theme-primary) 6%, black) 100%);
    
  --civic-bg-gradient-hero: linear-gradient(135deg,
    var(--civic-bg-main) 0%,
    color-mix(in srgb, var(--theme-primary) 15%, var(--civic-bg-main)) 50%,
    var(--civic-bg-main) 100%);
  
  /* ═══ GLASSMORPHISM UNIFIÉ ═══ */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-bg-strong: rgba(255, 255, 255, 0.15);
  --glass-bg-subtle: rgba(255, 255, 255, 0.08);
  
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-border-strong: rgba(255, 255, 255, 0.3);
  --glass-border-theme: color-mix(in srgb, var(--theme-primary) 40%, transparent);
  
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  --glass-shadow-theme: 0 8px 32px color-mix(in srgb, var(--theme-primary) 30%, transparent);
  --glass-shadow-strong: 0 16px 64px rgba(31, 38, 135, 0.5);
  
  --glass-blur: blur(10px);
  --glass-blur-strong: blur(16px);
  --glass-blur-subtle: blur(6px);
  
  /* ═══ TYPOGRAPHY SYSTÈME ═══ */
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Cinzel', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Échelle typographique harmonique */
  --text-xs: 0.75rem;       /* 12px */
  --text-sm: 0.875rem;      /* 14px */
  --text-base: 1rem;        /* 16px */
  --text-lg: 1.125rem;      /* 18px */
  --text-xl: 1.25rem;       /* 20px */
  --text-2xl: 1.5rem;       /* 24px */
  --text-3xl: 1.875rem;     /* 30px */
  --text-4xl: 2.25rem;      /* 36px */
  --text-5xl: 3rem;         /* 48px */
  --text-6xl: 3.75rem;      /* 60px */
  --text-7xl: 4.5rem;       /* 72px */
  
  /* Poids de police */
  --weight-light: 300;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 900;
  
  /* Couleurs de texte */
  --text-primary: #F8FAFC;      /* Blanc principal */
  --text-secondary: #CBD5E1;    /* Gris clair */
  --text-muted: #64748B;        /* Gris moyen */
  --text-disabled: #475569;     /* Gris foncé */
  --text-inverse: #0F172A;      /* Texte sombre */
  --text-theme: var(--theme-primary);
  --text-accent: color-mix(in srgb, var(--theme-primary) 80%, white);
  
  /* ═══ SPACING SYSTÈME (4px base) ═══ */
  --space-0: 0;
  --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 */
  
  /* Spacing sémantique */
  --space-xs: var(--space-1);
  --space-sm: var(--space-2);
  --space-md: var(--space-4);
  --space-lg: var(--space-6);
  --space-xl: var(--space-8);
  --space-2xl: var(--space-12);
  --space-3xl: var(--space-16);
  
  /* ═══ BORDER RADIUS ═══ */
  --radius-none: 0;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;
  
  /* ═══ ANIMATIONS ═══ */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --easing-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* ═══ BREAKPOINTS ═══ */
  --bp-mobile: 576px;
  --bp-tablet: 768px;
  --bp-desktop: 1024px;
  --bp-wide: 1200px;
  
  /* ═══ EFFECTS SPÉCIAUX ═══ */
  --glow-theme: 0 0 20px color-mix(in srgb, var(--theme-primary) 50%, transparent);
  --glow-gold: 0 0 20px color-mix(in srgb, var(--civic-gold) 50%, transparent);
  
  /* Shadows étagées */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎯 THÈMES MODULES - OVERRIDE AUTOMATIQUE
   ════════════════════════════════════════════════════════════════════════════════ */

/* BIQ - Rouge investigation */
[data-module="biq"] {
  --theme-primary: var(--biq-primary);
}

/* Garde Nationale - Bleu protection */
[data-module="garde-nationale"] {
  --theme-primary: var(--gn-primary);
}

/* République du Kwébec - Rouge crimson */
[data-module="rdkq"] {
  --theme-primary: var(--rdkq-primary);
}

/* MonarkQuebec - Brun royal */
[data-module="monark"] {
  --theme-primary: var(--monark-primary);
}

/* Sheriff - Gris justice */
[data-module="sheriff"] {
  --theme-primary: var(--sheriff-primary);
}

/* Hub Central - Indigo */
[data-module="hub"] {
  --theme-primary: var(--hub-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🔧 RESET ET BASE
   ════════════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--civic-bg-gradient);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🧩 COMPOSANTS SYSTÈME UNIFIÉS
   ════════════════════════════════════════════════════════════════════════════════ */

/* === CONTAINERS === */
.civic-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.civic-container-fluid {
  width: 100%;
  padding: 0 var(--space-md);
}

/* === GLASSMORPHISM CARDS === */
.civic-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
}

.civic-card:hover {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border-theme);
  box-shadow: var(--glass-shadow-theme);
  transform: translateY(-2px);
}

.civic-card-subtle {
  background: var(--glass-bg-subtle);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

/* === BOUTONS === */
.civic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  text-decoration: none;
  
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  color: var(--text-primary);
  
  transition: all var(--transition-normal);
  cursor: pointer;
  user-select: none;
}

.civic-btn:hover {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border-theme);
  box-shadow: var(--glow-theme);
  transform: translateY(-1px);
}

.civic-btn-primary {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
  border-color: var(--theme-primary);
  color: white;
}

.civic-btn-primary:hover {
  box-shadow: var(--glow-theme), var(--shadow-lg);
  transform: translateY(-2px);
}

.civic-btn-outline {
  background: transparent;
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

.civic-btn-outline:hover {
  background: var(--theme-primary);
  color: white;
}

/* === NAVIGATION === */
.civic-navbar {
  background: var(--civic-bg-navbar);
  backdrop-filter: var(--glass-blur-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--space-4) 0;
}

.civic-navbar-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--theme-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.civic-navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-6);
}

.civic-navbar-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: var(--weight-medium);
  transition: color var(--transition-fast);
}

.civic-navbar-link:hover,
.civic-navbar-link.active {
  color: var(--theme-primary);
}

/* === HERO SECTIONS === */
.civic-hero {
  background: var(--civic-bg-gradient-hero);
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.civic-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  margin: 0 0 var(--space-lg) 0;
  background: linear-gradient(135deg, var(--text-primary), var(--text-accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.civic-hero p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin: 0 0 var(--space-2xl) 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === GRID ET LAYOUT === */
.civic-grid {
  display: grid;
  gap: var(--space-lg);
}

.civic-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.civic-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.civic-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* === UTILITIES === */
.civic-text-center { text-align: center; }
.civic-text-left { text-align: left; }
.civic-text-right { text-align: right; }

.civic-text-primary { color: var(--text-primary); }
.civic-text-secondary { color: var(--text-secondary); }
.civic-text-muted { color: var(--text-muted); }
.civic-text-theme { color: var(--theme-primary); }

.civic-bg-glass { background: var(--glass-bg); }
.civic-bg-glass-strong { background: var(--glass-bg-strong); }

.civic-shadow-sm { box-shadow: var(--shadow-sm); }
.civic-shadow-md { box-shadow: var(--shadow-md); }
.civic-shadow-lg { box-shadow: var(--shadow-lg); }

.civic-rounded-sm { border-radius: var(--radius-sm); }
.civic-rounded-md { border-radius: var(--radius-md); }
.civic-rounded-lg { border-radius: var(--radius-lg); }
.civic-rounded-full { border-radius: var(--radius-full); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .civic-hero h1 {
    font-size: var(--text-4xl);
  }
  
  .civic-navbar-nav {
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .civic-grid-2,
  .civic-grid-3,
  .civic-grid-4 {
    grid-template-columns: 1fr;
  }
  
  .civic-container {
    padding: 0 var(--space-sm);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎆 ANIMATIONS ET EFFETS SPÉCIAUX
   ════════════════════════════════════════════════════════════════════════════════ */

/* Animation d'entrée pour les cartes */
@keyframes civic-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.civic-animate-in {
  animation: civic-fadeInUp 0.6s ease-out;
}

/* Effet de hover global */
.civic-hover-lift {
  transition: transform var(--transition-normal);
}

.civic-hover-lift:hover {
  transform: translateY(-4px);
}

/* Glow effects */
.civic-glow-theme {
  box-shadow: var(--glow-theme);
}

.civic-glow-gold {
  box-shadow: var(--glow-gold);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🔧 COMPATIBILITÉ ET FALLBACKS
   ════════════════════════════════════════════════════════════════════════════════ */

/* Fallback pour les navigateurs ne supportant pas backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
  .civic-card,
  .civic-btn,
  .civic-navbar {
    background: rgba(255, 255, 255, 0.2);
  }
}

/* Fallback pour color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
  :root {
    --theme-primary-dark: var(--theme-primary);
    --theme-primary-light: var(--theme-primary);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   📝 FIN DU SYSTÈME UNIFIÉ
   Version: 1.0.0 - Consolidation DNA Extract
   Date: 5 mai 2026
   ════════════════════════════════════════════════════════════════════════════════ */