/**
 * 🏛️ SIA NOTARIAT - Design System Premium Souverain
 * Charte: "Arbre de la Confiance Juridique"
 * Version: 1.0
 * Date: 2025-01-27
 */

/* ============================================
   🎨 PALETTE OFFICIELLE SIA - UNIQUE ET EXCLUSIVE
   ============================================ */
:root {
  /* === PALETTE OFFICIELLE UNIQUE === */
  /* Aucune autre couleur n'est autorisée */
  --sia-primary: #0B1C2D;      /* Bleu nuit profond - couleur principale */
  --sia-secondary: #E6EBF0;    /* Ivoire bleuté - couleur secondaire */
  --sia-accent: #5B6F8A;       /* Bleu acier - couleur d'accent */
  
  /* === COULEURS PRIMAIRES (mappées sur la palette officielle) === */
  /* Bleu Nuit - Institutionnel profond */
  --color-night-blue: #0B1C2D;
  --color-night-blue-dark: #0B1C2D;
  --color-night-blue-light: #5B6F8A;
  
  /* Bleu Souverain - Autorité digitale */
  --color-sovereign-blue: #0B1C2D;
  --color-sovereign-blue-dark: #0B1C2D;
  --color-sovereign-blue-light: #5B6F8A;
  
  /* === COULEURS NEUTRES (mappées sur la palette officielle) === */
  /* Ivoire - Fonds nobles */
  --color-ivory: #E6EBF0;
  --color-ivory-dark: #E6EBF0;
  --color-ivory-light: #E6EBF0;
  
  /* Gris Pierre - Textes secondaires (utilise bleu acier) */
  --color-stone-gray: #5B6F8A;
  --color-stone-gray-dark: #0B1C2D;
  --color-stone-gray-light: #5B6F8A;
  
  /* Argent - Neutre, séparation (utilise bleu acier) */
  --color-silver: #5B6F8A;
  --color-silver-dark: #0B1C2D;
  --color-silver-light: #5B6F8A;
  
  /* Blanc Pur */
  --color-white: #FFFFFF;
  --color-white-off: #E6EBF0;
  
  /* === COULEURS SÉMANTIQUES (adaptées avec la palette officielle uniquement) === */
  /* Success - Validation */
  --color-success: #5B6F8A;
  --color-success-bg: #E6EBF0;
  --color-success-border: #5B6F8A;
  
  /* Warning - Vigilance */
  --color-warning: #5B6F8A;
  --color-warning-bg: #E6EBF0;
  --color-warning-border: #5B6F8A;
  
  /* Error - Refus */
  --color-error: #0B1C2D;
  --color-error-bg: #E6EBF0;
  --color-error-border: #0B1C2D;
  
  /* Info - Information */
  --color-info: #5B6F8A;
  --color-info-bg: #E6EBF0;
  --color-info-border: #5B6F8A;
  
  /* Cryptographique - Preuve (utilise bleu acier) */
  --color-crypto: #5B6F8A;
  --color-crypto-bg: #E6EBF0;
  --color-crypto-glow: #5B6F8A;
  
  /* === DÉGRADÉS (supprimés - aucun dégradé décoratif autorisé) === */
  /* Les dégradés décoratifs sont interdits selon la charte */
  --gradient-noble: #E6EBF0;
  --gradient-blue-depth: #0B1C2D;
  --gradient-hero: #0B1C2D;
  
  /* === TYPOGRAPHIE === */
  /* Familles */
  --font-serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-sans: 'Inter', 'Public Sans', -apple-system, BlinkMacSystemFont, 
               'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
  
  /* Tailles */
  --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.5rem;        /* 56px */
  
  /* Poids */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Interlignage */
  --leading-tight: 1.2;
  --leading-normal: 1.4;
  --leading-relaxed: 1.6;
  --leading-loose: 1.8;
  
  /* === ESPACEMENTS === */
  --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 */
  
  /* === RAYONS === */
  --radius-xs: 0.125rem;     /* 2px */
  --radius-sm: 0.25rem;      /* 4px */
  --radius-md: 0.5rem;       /* 8px */
  --radius-lg: 0.75rem;      /* 12px */
  --radius-xl: 1rem;         /* 16px */
  --radius-2xl: 1.5rem;      /* 24px */
  --radius-3xl: 2rem;        /* 32px */
  --radius-full: 9999px;
  
  /* === OMBRES === */
  --shadow-xs: 0 1px 2px rgba(11, 28, 45, 0.05);
  --shadow-sm: 0 2px 4px rgba(11, 28, 45, 0.1);
  --shadow-md: 0 4px 8px rgba(11, 28, 45, 0.15);
  --shadow-lg: 0 8px 16px rgba(11, 28, 45, 0.2);
  --shadow-xl: 0 16px 32px rgba(11, 28, 45, 0.25);
  --shadow-2xl: 0 24px 48px rgba(11, 28, 45, 0.3);
  --shadow-accent: 0 4px 16px rgba(91, 111, 138, 0.3);
  --shadow-accent-lg: 0 8px 32px rgba(91, 111, 138, 0.4);
  --shadow-crypto: 0 0 20px rgba(91, 111, 138, 0.3);
  
  /* === TRANSITIONS === */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* === BREAKPOINTS === */
  --breakpoint-xs: 0px;
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* === Z-INDEX === */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================
   🎨 MODE SOMBRE (Optionnel) - Palette officielle
   ============================================ */
[data-theme="dark"] {
  --bg-primary: var(--sia-primary);
  --bg-secondary: var(--sia-primary);
  --text-primary: var(--sia-secondary);
  --text-secondary: var(--sia-accent);
  --accent: var(--sia-accent);
}

/* ============================================
   🔤 RÉINITIALISATION & BASE
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--sia-primary);
  background: var(--sia-secondary);
}

/* ============================================
   📝 TYPOGRAPHIE
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--sia-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-6xl);
  font-family: var(--font-serif);
  font-weight: var(--font-bold);
}

h2 {
  font-size: var(--text-5xl);
  font-family: var(--font-serif);
  font-weight: var(--font-bold);
}

h3 {
  font-size: var(--text-4xl);
  font-weight: var(--font-semibold);
}

h4 {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

h6 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--sia-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-weight: var(--font-medium);
}

a:hover {
  color: var(--sia-primary);
  text-decoration: underline;
}

/* Lien cryptographique */
a.crypto-link {
  color: var(--sia-accent);
  position: relative;
}

a.crypto-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--sia-accent);
  transition: width var(--transition-base);
}

a.crypto-link:hover::after {
  width: 100%;
}

/* ============================================
   🔘 BOUTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Bouton Primaire - Bleu nuit profond */
.btn-primary {
  background: var(--sia-primary);
  color: var(--sia-secondary);
  border-color: var(--sia-primary);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
  background: var(--sia-primary);
  opacity: 0.9;
}

/* Bouton Secondaire - Ivoire bleuté */
.btn-secondary {
  background: var(--sia-secondary);
  color: var(--sia-primary);
  border-color: var(--sia-accent);
}

.btn-secondary:hover {
  background: var(--sia-accent);
  color: var(--sia-secondary);
  box-shadow: var(--shadow-md);
}

/* Bouton Ghost */
.btn-ghost {
  background: transparent;
  color: var(--sia-primary);
  border-color: var(--sia-primary);
}

.btn-ghost:hover {
  background: var(--sia-primary);
  color: var(--sia-secondary);
}

/* Bouton Crypto */
.btn-crypto {
  background: var(--sia-accent);
  color: var(--sia-secondary);
  border-color: var(--sia-accent);
  box-shadow: var(--shadow-crypto);
}

.btn-crypto:hover {
  box-shadow: var(--shadow-crypto);
  opacity: 0.9;
}

/* Tailles */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* ============================================
   📦 CARDS
   ============================================ */
.card {
  background: var(--sia-secondary);
  border: 1px solid var(--sia-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--sia-primary);
  transform: translateY(-2px);
}

.card-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-ivory-dark);
}

.card-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
  color: var(--sia-primary);
  font-family: var(--font-serif);
}

.card-body {
  margin-bottom: var(--space-4);
  color: var(--sia-primary);
}

.card-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-ivory-dark);
}

/* Card Premium - Accent */
.card-premium {
  border-color: var(--sia-accent);
  background: var(--sia-secondary);
  position: relative;
  overflow: hidden;
}

.card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--sia-accent);
}

/* ============================================
   📝 FORMULAIRES
   ============================================ */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-night-blue);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--color-night-blue);
  background: var(--color-ivory);
  border: 2px solid var(--color-silver);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--sia-primary);
  box-shadow: 0 0 0 4px rgba(11, 28, 45, 0.1);
  background: var(--sia-secondary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-help {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-stone-gray);
}

.form-error {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-error);
}

/* ============================================
   🏷️ BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-premium {
  background: var(--sia-accent);
  color: var(--sia-secondary);
}

.badge-crypto {
  background: var(--sia-accent);
  color: var(--sia-secondary);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* ============================================
   📊 ALERTS
   ============================================ */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 2px solid;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.alert-success {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.alert-error {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
}

.alert-info {
  background: var(--color-info-bg);
  border-color: var(--color-info);
  color: var(--color-info);
}

/* ============================================
   📐 LAYOUT & CONTAINERS
   ============================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }
.container-xl { max-width: 1280px; }
.container-2xl { max-width: 1536px; }

.section {
  padding: var(--space-16) 0;
}

.section-tight {
  padding: var(--space-8) 0;
}

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

.text-night { color: var(--sia-primary); }
.text-accent { color: var(--sia-accent); }
.text-crypto { color: var(--sia-accent); }
.text-muted { color: var(--sia-accent); }

.bg-primary { background: var(--sia-primary); }
.bg-secondary { background: var(--sia-secondary); }
.bg-accent { background: var(--sia-accent); }

.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

.font-bold { font-weight: var(--font-bold); }
.font-semibold { font-weight: var(--font-semibold); }

/* ============================================
   📱 RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  
  .section { padding: var(--space-8) 0; }
  
  .card { padding: var(--space-4); }
  
  .btn { width: 100%; }
}

/* ============================================
   ✨ ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes accentPulse {
  0%, 100% {
    box-shadow: var(--shadow-accent);
  }
  50% {
    box-shadow: var(--shadow-accent-lg);
  }
}

@keyframes cryptoGlow {
  0%, 100% {
    filter: drop-shadow(0 0 5px rgba(91, 111, 138, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(91, 111, 138, 0.8));
  }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out; }
.animate-slide-up { animation: slideUp 0.5s ease-out; }
.animate-accent-pulse { animation: accentPulse 2s ease-in-out infinite; }
.animate-crypto-glow { animation: cryptoGlow 2s ease-in-out infinite; }

/* ============================================
   🏛️ MARQUEUR NOTARIAL
   ============================================ */
.notarial-accent {
  position: relative;
}

.notarial-accent::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sia-accent);
  border-radius: var(--radius-full);
}

/* ============================================
   🔒 SÉCURITÉ CRYPTOGRAPHIQUE
   ============================================ */
.crypto-seal {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-crypto-bg);
  border: 2px solid var(--color-crypto);
  border-radius: var(--radius-full);
  color: var(--color-crypto);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  font-family: var(--font-mono);
}

/* ============================================
   🌳 ARBRE DE LA CONFIANCE
   ============================================ */
.trust-tree {
  display: inline-block;
  width: 60px;
  height: 60px;
  background: var(--sia-accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-crypto);
}

.trust-tree-icon {
  width: 40px;
  height: 40px;
  color: var(--color-white);
}

