/* ============================================================
   EuroFunded.eu — main.css
   Design System complet — variables, reset, composants de base
   ============================================================ */

/* ============================================================
   1. POLICES AUTO-HÉBERGÉES (Poppins + Inter) — cf. fonts.css
   ============================================================ */
@import url('/frontend/css/fonts.css');

/* Drapeaux emoji : Windows n'a pas de police pour les indicateurs régionaux (🇫🇷…)
   et affiche « FR », « BE »… à la place. Cette police auto-hébergée corrige le rendu
   sur Windows/Chrome/Edge (mobile natif était déjà OK). unicode-range la limite AUX
   drapeaux (U+1F1E6–U+1F1FF) : le texte normal reste en Poppins/Inter. */
@font-face {
  font-family: 'Twemoji Country Flags';
  src: url('/assets/fonts/TwemojiCountryFlags.woff2') format('woff2');
  unicode-range: U+1F1E6-1F1FF;
  font-display: swap;
}

/* ============================================================
   2. VARIABLES CSS — SOURCE DE VÉRITÉ DU DESIGN
   ============================================================ */
:root {

  /* --- Couleurs principales --- */
  --blue-primary:    #2563EB;
  --blue-hover:      #1D4ED8;
  --blue-light:      #EFF6FF;
  --blue-border:     #BFDBFE;
  --blue-muted:      #93C5FD;

  /* --- Couleurs texte --- */
  --text-primary:    #0F172A;
  --text-secondary:  #334155;
  --text-muted:      #64748B;
  --text-hint:       #94A3B8;
  --text-white:      #FFFFFF;

  /* --- Fonds --- */
  --bg-page:         #F8FAFC;
  --bg-card:         #FFFFFF;
  --bg-sidebar:      #0F172A;
  --bg-sidebar-alt:  #1E293B;

  /* --- Bordures --- */
  --border-light:    #E2E8F0;
  --border-medium:   #CBD5E1;
  --border-focus:    #2563EB;

  /* --- Sémantiques --- */
  --success:         #16A34A;
  --success-bg:      #DCFCE7;
  --success-border:  #BBF7D0;
  --warning:         #D97706;
  --warning-bg:      #FEF3C7;
  --warning-border:  #FDE68A;
  --danger:          #DC2626;
  --danger-bg:       #FEE2E2;
  --danger-border:   #FECACA;
  --info:            #0EA5E9;
  --info-bg:         #E0F2FE;
  --info-border:     #BAE6FD;

  /* --- Catégories projets --- */
  --cat-immobilier:  #475569;
  --cat-agriculture: #16A34A;
  --cat-energie:     #CA8A04;
  --cat-techno:      #2563EB;
  --cat-sante:       #DB2777;
  --cat-education:   #7C3AED;
  --cat-commerce:    #EA580C;
  --cat-industrie:   #64748B;
  --cat-art:         #C026D3;

  /* --- Typographie --- */
  --font-heading:    'Poppins', 'Twemoji Country Flags', Arial, sans-serif;
  --font-body:       'Inter', 'Twemoji Country Flags', Arial, sans-serif;

  /* --- Tailles de police --- */
  --text-xs:         0.6875rem;  /* 11px */
  --text-sm:         0.75rem;    /* 12px */
  --text-base:       0.875rem;   /* 14px */
  --text-md:         1rem;       /* 16px */
  --text-lg:         1.125rem;   /* 18px */
  --text-xl:         1.25rem;    /* 20px */
  --text-2xl:        1.75rem;    /* 28px */
  --text-3xl:        2.25rem;    /* 36px */
  --text-4xl:        3rem;       /* 48px */

  /* --- Espacements --- */
  --space-1:         4px;
  --space-2:         8px;
  --space-3:         12px;
  --space-4:         16px;
  --space-5:         20px;
  --space-6:         24px;
  --space-8:         32px;
  --space-10:        40px;
  --space-12:        48px;
  --space-16:        64px;

  /* --- Rayons --- */
  --radius-sm:       4px;
  --radius-md:       8px;
  --radius-lg:       12px;
  --radius-xl:       16px;
  --radius-full:     9999px;

  /* --- Ombres --- */
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:       0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:       0 4px 20px rgba(0,0,0,0.1);
  --shadow-xl:       0 20px 60px rgba(0,0,0,0.15);
  --shadow-dropdown: 0 4px 12px rgba(0,0,0,0.1);

  /* --- Transitions --- */
  --transition:      200ms ease;
  --transition-slow: 400ms ease;

  /* --- Layout --- */
  --sidebar-width:   240px;
  --header-height:   64px;
  --header-mobile:   56px;
  --max-width:       1280px;
}

/* ============================================================
   3. RESET CSS
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--text-secondary);
  background-color: var(--bg-page);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.3;
}

/* ============================================================
   4. TYPOGRAPHIE
   ============================================================ */
.h1-hero {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-primary);
}

.h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-primary);
}

.h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.h4 {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-secondary);
}

.text-body { font-size: var(--text-md); color: var(--text-secondary); }
.text-sm   { font-size: var(--text-base); color: var(--text-muted); }
.text-xs   { font-size: var(--text-sm); color: var(--text-hint); }
.text-micro{ font-size: var(--text-xs); color: var(--text-hint); }

.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-blue      { color: var(--blue-primary) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-white     { color: var(--text-white) !important; }

.font-light    { font-weight: 300; }
.font-regular  { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

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

@media (min-width: 640px) {
  .container { padding: 0 var(--space-6); }
}

@media (min-width: 1024px) {
  .container { padding: 0 var(--space-8); }
}

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

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

/* Grid système responsive */
.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { display: flex; flex-direction: column; }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }
.gap-4         { gap: var(--space-4); }
.gap-6         { gap: var(--space-6); }

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

.btn-primary {
  background: var(--blue-primary);
  color: #FFFFFF;
  border-color: var(--blue-primary);
}
.btn-primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-secondary:hover {
  background: var(--bg-page);
  border-color: var(--border-medium);
}

.btn-ghost {
  background: transparent;
  color: var(--blue-primary);
  border-color: transparent;
  padding: 8px var(--space-4);
}
.btn-ghost:hover {
  background: var(--blue-light);
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}

.btn-success {
  background: var(--success);
  color: #FFFFFF;
  border-color: var(--success);
}
.btn-success:hover {
  background: #15803D;
  border-color: #15803D;
}

.btn-outline-primary {
  background: transparent;
  color: var(--blue-primary);
  border-color: var(--blue-primary);
}
.btn-outline-primary:hover {
  background: var(--blue-light);
}

.btn-sm {
  padding: 6px var(--space-3);
  font-size: var(--text-sm);
}

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

.btn-full { width: 100%; }

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

/* ============================================================
   7. CARTES
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-body {
  padding: var(--space-4);
}

.card-header {
  padding: var(--space-4) var(--space-4) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Carte KPI dashboard */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: all var(--transition);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-primary);
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-trend {
  font-size: var(--text-sm);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.flat { color: var(--text-muted); }

/* ============================================================
   8. FORMULAIRES
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-hint);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-error {
  font-size: var(--text-sm);
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Champ téléphone avec drapeau */
.phone-input-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.phone-input-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.phone-country-select {
  flex-shrink: 0;
  padding: 10px 12px;
  background: var(--bg-page);
  border: none;
  border-right: 1px solid var(--border-light);
  font-size: var(--text-base);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 90px;
  appearance: none;
  -webkit-appearance: none;
}

.phone-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: var(--bg-card);
  font-size: var(--text-base);
  color: var(--text-primary);
}

.phone-input:focus { box-shadow: none; }

/* Jauge force mot de passe */
.password-strength {
  margin-top: var(--space-2);
}

.password-strength-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px;
}

.password-strength-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 300ms ease, background-color 300ms ease;
  width: 0%;
}

.strength-weak   .password-strength-fill { width: 33%; background: var(--danger); }
.strength-medium .password-strength-fill { width: 66%; background: var(--warning); }
.strength-strong .password-strength-fill { width: 100%; background: var(--success); }

.password-strength-text {
  font-size: var(--text-sm);
}
.strength-weak   .password-strength-text { color: var(--danger); }
.strength-medium .password-strength-text { color: var(--warning); }
.strength-strong .password-strength-text { color: var(--success); }

/* Code 6 chiffres */
.code-inputs {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.code-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.code-input:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.code-input.filled {
  border-color: var(--blue-primary);
  background: var(--blue-light);
}

/* Toggle switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border-medium);
  border-radius: var(--radius-full);
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle.active {
  background: var(--blue-primary);
}

.toggle.active::after {
  transform: translateX(20px);
}

/* Checkbox custom */
.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue-primary);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================================
   9. BADGES & STATUTS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge-blue     { background: var(--blue-light);    color: var(--blue-primary); border: 1px solid var(--blue-border); }
.badge-success  { background: var(--success-bg);    color: var(--success);      border: 1px solid var(--success-border); }
.badge-warning  { background: var(--warning-bg);    color: var(--warning);      border: 1px solid var(--warning-border); }
.badge-danger   { background: var(--danger-bg);     color: var(--danger);       border: 1px solid var(--danger-border); }
.badge-info     { background: var(--info-bg);       color: var(--info);         border: 1px solid var(--info-border); }
.badge-neutral  { background: #F1F5F9;              color: var(--text-muted);   border: 1px solid var(--border-light); }
.badge-verified { background: var(--blue-light);    color: var(--blue-primary); border: 1px solid var(--blue-border); }

/* Badges catégories */
.badge-immobilier { background: #F1F5F9; color: var(--cat-immobilier); }
.badge-agriculture{ background: #DCFCE7; color: var(--cat-agriculture); }
.badge-energie    { background: #FEF3C7; color: var(--cat-energie); }
.badge-techno     { background: var(--blue-light); color: var(--cat-techno); }
.badge-sante      { background: #FCE7F3; color: var(--cat-sante); }
.badge-education  { background: #EDE9FE; color: var(--cat-education); }
.badge-commerce   { background: #FFEDD5; color: var(--cat-commerce); }
.badge-industrie  { background: #F1F5F9; color: var(--cat-industrie); }
.badge-art        { background: #FDF4FF; color: var(--cat-art); }

/* Badge langue originale du contenu */
.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: #F0F9FF;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
}

/* Point de statut */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); }
.status-dot.pending { background: var(--warning); }
.status-dot.offline { background: var(--text-hint); }
.status-dot.error   { background: var(--danger); }

/* ============================================================
   10. BARRE DE PROGRESSION
   ============================================================ */
.progress {
  position: relative;
  width: 100%;
  height: 7px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-lg {
  height: 10px;
}

/* Barre de progression — dégradé bleu animé (sheen mouvant) + remplissage à
   l'insertion. Le remplissage 0 -> largeur cible joue automatiquement sur tout
   élément injecté (tables, cartes, détail) via le keyframe ef-progress-fill ;
   l'animation transition:width gère aussi les mises à jour ultérieures. */
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  background-color: #2563EB;
  /* Enseigne de barbier : 2 bleus en rayures diagonales qui défilent */
  background-image: repeating-linear-gradient(45deg,
      #1D4ED8 0, #1D4ED8 10px,
      #5AA9FF 10px, #5AA9FF 20px);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.35);
  transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1);
  animation: ef-progress-fill 1000ms cubic-bezier(0.4, 0, 0.2, 1),
             ef-barber 2.2s linear infinite;
}

.progress-fill.success {
  background-color: #16A34A;
  background-image: repeating-linear-gradient(45deg, #15803D 0, #15803D 10px, #4ADE80 10px, #4ADE80 20px);
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.35);
}
.progress-fill.warning {
  background-color: #F59E0B;
  background-image: repeating-linear-gradient(45deg, #B45309 0, #B45309 10px, #FBBF24 10px, #FBBF24 20px);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.35);
}

/* Remplissage 0 -> largeur cible (la largeur cible vient du style inline width:X%). */
@keyframes ef-progress-fill {
  from { width: 0; }
}
/* Défilement diagonal continu des rayures (effet enseigne de barbier) */
@keyframes ef-barber {
  to { background-position: 28.28px 0; }
}

/* Loader global (barre haut de page, même style barbier) */
#ef-page-loader {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 99999;
  background-color: #2563EB;
  background-image: repeating-linear-gradient(45deg,
      #1D4ED8 0, #1D4ED8 10px, #5AA9FF 10px, #5AA9FF 20px);
  animation: ef-barber 1.1s linear infinite;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill { animation: none; transition: none; }
}

/* ============================================================
   11. NAVIGATION PRINCIPALE (HEADER PUBLIC)
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.navbar-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.navbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.navbar-logo img {
  height: 36px;
  width: auto;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  justify-content: center;
}

.navbar-link {
  padding: 6px var(--space-3);
  font-size: var(--text-base);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  font-weight: 400;
  white-space: nowrap;
}

.navbar-link:hover {
  color: var(--text-primary);
  background: var(--bg-page);
}

.navbar-link.active {
  color: var(--blue-primary);
  font-weight: 500;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Sélecteur de langue */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px var(--space-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-size: var(--text-base);
  color: var(--text-muted);
  background: transparent;
}

.lang-selector:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* Menu burger mobile */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

@media (max-width: 1024px) {
  .navbar-links { display: none; }
  .burger { display: flex; }
}

/* ============================================================
   HEADER DESKTOP — THÈME SOMBRE PREMIUM
   Site public uniquement (cible .navbar ; le dashboard utilise
   .dashboard-topbar et n'est donc pas affecté). Desktop ≥ 1025px.
   ============================================================ */
.nav-logo-dark { display: none; }

@media (min-width: 1025px) {
  .navbar {
    background: #0F172A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 30px -16px rgba(0, 0, 0, 0.7);
  }
  /* fin liseré dégradé bleu en haut du header */
  .navbar::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #1D4ED8 0%, #3B82F6 38%, #60A5FA 68%, rgba(96, 165, 250, 0) 100%);
  }

  /* logo : bascule sur la version fond sombre (texte blanc) */
  .navbar .nav-logo-light { display: none; }
  .navbar .nav-logo-dark { display: inline-block; }

  /* liens */
  .navbar .navbar-link {
    position: relative;
    color: #CBD5E1;
    font-weight: 500;
  }
  .navbar .navbar-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
  }
  .navbar .navbar-link.active {
    color: #FFFFFF;
    font-weight: 600;
    background: transparent;
  }
  /* soulignement bleu sous l'onglet actif */
  .navbar .navbar-link.active::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #3B82F6, #60A5FA);
  }

  /* sélecteur de langue */
  .navbar .lang-selector {
    border-color: rgba(255, 255, 255, 0.14);
    color: #CBD5E1;
    background: rgba(255, 255, 255, 0.04);
  }
  .navbar .lang-selector:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.09);
  }

  /* « Se connecter » (ghost clair) */
  .navbar .btn-secondary {
    background: transparent;
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  .navbar .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.34);
    color: #FFFFFF;
  }

  /* « Créer un compte » / « Mon espace » : bleu plein + halo */
  .navbar .btn-primary {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  }
  .navbar .btn-primary:hover {
    box-shadow: 0 9px 26px rgba(37, 99, 235, 0.62);
    transform: translateY(-1px);
  }

  /* burger (si jamais visible) en clair */
  .navbar .burger span { background: #E2E8F0; }
}

/* Menu mobile drawer */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 320px;
  height: 100vh;
  background: var(--bg-card);
  z-index: 200;
  padding: var(--space-6);
  transition: right var(--transition-slow);
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-8);
}

.mobile-menu-link {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-md);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
  background: var(--blue-light);
  color: var(--blue-primary);
}

/* ============================================================
   12. SIDEBAR DASHBOARD
   ============================================================ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
}

.sidebar-logo img {
  height: 34px;
  width: auto;
}

.sidebar-nav {
  padding: var(--space-4) var(--space-3);
  flex: 1;
}

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-4) var(--space-3) var(--space-2);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.6);
  font-size: 0.8125rem;
  font-weight: 400;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.9);
}

.sidebar-item.active {
  background: rgba(37,99,235,0.15);
  color: var(--blue-primary);
  font-weight: 500;
  border-left: 3px solid var(--blue-primary);
  padding-left: calc(var(--space-3) - 3px);
}

.sidebar-item i {
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  background: var(--blue-primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* Dashboard main content */
.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* overflow:hidden retiré — bloquait le scroll horizontal des tables sur iOS */
}

/* Dashboard topbar */
.dashboard-topbar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search-input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: all var(--transition);
}

.topbar-search-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  outline: none;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
  font-size: 16px;
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.topbar-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
}

.topbar-icon-btn:hover {
  background: var(--bg-page);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.topbar-icon-btn i { font-size: 20px; }

.topbar-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  border: 1px solid transparent;
}

.topbar-user:hover {
  background: var(--bg-page);
  border-color: var(--border-light);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--text-base);
  flex-shrink: 0;
}

.topbar-user-info {
  display: flex;
  flex-direction: column;
}

.topbar-user-name {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.topbar-user-badge {
  font-size: 11px;
  color: var(--blue-primary);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Dashboard content area */
.dashboard-content {
  padding: var(--space-6);
  flex: 1;
}

/* ============================================================
   13. NAVIGATION MOBILE BOTTOM (DASHBOARD)
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  z-index: 100;
}

.bottom-nav-items {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-hint);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.bottom-nav-item i { font-size: 20px; }

.bottom-nav-item.active {
  color: var(--blue-primary);
}

.bottom-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 14px);
  min-width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-card);
}

/* bottom-nav supprimée — navigation mobile uniquement via hamburger + sidebar */
.bottom-nav { display: none !important; }

@media (max-width: 768px) {
  /* sidebar reste accessible via hamburger — transform géré dans dashboard.css */
}

/* ============================================================
   14. TABLES
   ============================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: var(--text-base);
}

.table thead {
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-light);
}

.table th {
  padding: 10px var(--space-4);
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table td {
  padding: 14px var(--space-4);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover td {
  background: var(--bg-page);
}

/* ============================================================
   15. MODALES
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-page);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ============================================================
   16. NOTIFICATIONS TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 360px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: slideInRight 300ms ease forwards;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   17. BANNIÈRE COOKIES RGPD
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--bg-sidebar);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: var(--space-4) var(--space-6);
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform var(--transition-slow);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  min-width: 280px;
  font-size: var(--text-base);
  color: rgba(255,255,255,0.7);
}

.cookie-text a {
  color: var(--blue-muted);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ============================================================
   18. ANIMATION SOUMISSION PROJET
   ============================================================ */
.submit-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-8);
  text-align: center;
  gap: var(--space-4);
}

.submit-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  font-size: 40px;
  animation: popIn 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.submit-success-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-primary);
  animation: fadeInUp 400ms ease 200ms both;
}

.submit-success-subtitle {
  color: var(--text-muted);
  font-size: var(--text-md);
  animation: fadeInUp 400ms ease 300ms both;
}

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

/* ============================================================
   19. UTILITAIRES
   ============================================================ */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

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

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

.w-full  { width: 100%; }
.h-full  { height: 100%; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-6) 0;
}

.overlay-blur {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ============================================================
   20. RESPONSIVE — AJUSTEMENTS MOBILES
   ============================================================ */
@media (max-width: 640px) {
  :root {
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.375rem;
  }

  .navbar-inner {
    padding: 0 var(--space-4);
  }

  .dashboard-content {
    padding: var(--space-4);
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    position: fixed;
    bottom: 0;
    margin: 0;
  }

  .code-input {
    width: 40px;
    height: 48px;
    font-size: 1.25rem;
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-actions .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .navbar { height: var(--header-mobile); }
}

/* ============================================================
   DRAPEAUX EMOJI — force la police de drapeaux dans les form controls
   (les <select>/<option> n'héritent pas toujours la font-family du body).
   Sélecteurs : langue (header/mobile), indicatif téléphone, pays de résidence.
   ============================================================ */
select, option,
.lang-flag, .lang-option-mobile,
#phoneFlag, .phone-country, .phone-country-select {
  font-family: 'Twemoji Country Flags', var(--font-body);
}
