:root {
  --primary: #0d6efd;
  --primary-hover: #002b6b;
  --success: #198754;
  --success-hover: #146c43;
  --warning: #ffc107;
  --orange: #fd7e14;
  --orange-hover: #cc6310;
  --danger: #dc3545;
  --danger-hover: #b02a37;
  --purple: #6f42c1;
  --purple-hover: #59339d;
  
  --bg-main: #f4f6f9;
  --bg-card: #ffffff;
  --bg-primary: #f4f6f8;
  --text-primary: #1a1a1a;
  --text-main: #333333;
  --text-muted: #6c757d;
  --border-color: rgba(0, 0, 0, 0.08);
  
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50px;
  
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body.dark-mode {
  --bg-primary: #121212;
  --text-primary: #ffffff;
}

body, 
main, 
section, 
.section {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--bg-main);
  color: var(--text-main);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* Couleurs Utilitaires pour Icônes & Textes */
.text-success { color: var(--success) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: #0dcaf0 !important; }
.text-secondary { color: var(--purple) !important; }

/* ANIMATIONS AU SCROLL (Apparition fluide) */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* EN-TÊTE & NAVIGATION */
header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  border-bottom: 1px solid rgba(13, 110, 253, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

header h1 {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  margin: 0;
  white-space: nowrap;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.3s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

nav a:hover {
  color: var(--primary-hover);
  transform: translateY(-2px);
}

.nav-auth-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-auth-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--primary);
  cursor: pointer;
  padding: 0 5px;
}

/* HERO SECTION ET ÉLÉMENTS FLOTTANTS */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  padding: 110px 0 90px 0;
  text-align: center;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: bold;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 15px;
  line-height: 1.25;
}

.hero p {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
  opacity: 0.95;
}

.hero-caption {
  font-size: 0.88rem;
  margin-top: 18px;
  opacity: 0.9;
  font-weight: 500;
}

.hero-float-img {
  position: absolute;
  top: 50%;
  width: 170px;
  height: 110px;
  object-fit: cover;
  z-index: 2;
  pointer-events: none;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.3));
}

.hero-float-img.float-animated {
  top: 35%;
}

.hero-float-img.float-animated-delay {
  top: 68%;
}

.float-animated {
  animation: floatBounce 3.5s ease-in-out infinite alternate;
}

.float-animated-delay {
  animation: floatBounce 3.5s ease-in-out 1.75s infinite alternate;
  transform: scale(0.92);
}

.hero-float-left { left: 30px; }
.hero-float-right { right: 30px; }

@keyframes floatBounce {
  0% { transform: translateY(-50%) translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-50%) translateY(-15px) rotate(3deg); }
  100% { transform: translateY(-50%) translateY(10px) rotate(-1deg); }
}

/* IMAGE ET CAPTIONS D'ENTREPRISE (SUR / SOUS) */
.about-img-wrapper {
  width: 100%;
  text-align: center;
  margin: 30px 0;
}

.image-caption-top,
.image-caption-bottom {
  display: inline-block;
  padding: 10px 18px;
  margin: 12px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  background: rgba(13, 110, 253, 0.06);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  text-align: left;
  max-width: 900px;
}

.image-caption-top:hover,
.image-caption-bottom:hover {
  background: rgba(13, 110, 253, 0.12);
  transform: translateX(4px);
}

.section-animated-img {
  width: 100%;
  max-width: 950px;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pulse-glow-img {
  animation: sectionPulse 4s ease-in-out infinite alternate, glowPulse 3s ease-in-out infinite alternate;
}

.section-animated-img:hover {
  animation-play-state: paused;
  transform: scale(1.03);
}

@keyframes sectionPulse {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-8px) scale(1.01); }
}

@keyframes glowPulse {
  0% { box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2); }
  100% { box-shadow: 0 15px 35px rgba(13, 110, 253, 0.45); }
}

/* SECTIONS & CARTES */
.section {
  padding: 80px 0;
}

.section h2 {
  color: var(--primary);
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.cards {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.card {
  background: var(--bg-card);
  padding: 30px;
  flex: 1;
  min-width: 260px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.animated-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(13, 110, 253, 0.15);
}

.card h3 {
  color: var(--primary);
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
}

/* LISTE MÉTHODOLOGIE */
.process-list {
  list-style: none;
  padding: 0;
  margin-top: 25px;
}

.process-list li {
  background: var(--bg-card);
  padding: 16px 20px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.process-list li:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}

/* BOUTONS GENERAUX */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: white;
  color: var(--primary);
  padding: 14px 30px;
  margin-top: 20px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: #f0f0f0;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* STATISTIQUES */
.stat-card {
  text-align: center;
  background: var(--bg-card);
  border-top: 4px solid var(--primary);
  padding: 25px 15px;
}

.stat-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: var(--primary);
}

.stat-card h3 {
  font-size: 2.5rem;
  color: var(--primary);
  margin: 5px 0;
  justify-content: center;
}

.stat-card p {
  font-weight: bold;
  color: var(--text-muted);
  margin: 0;
}

.clickable-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(13, 110, 253, 0.15);
}

/* FENÊTRES MODALES & ANNONCES */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px 10px;
}

.modal-content, .auth-modal-content {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin: 30px auto;
  padding: 25px;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: var(--shadow-modal);
  border: 1px solid rgba(13, 110, 253, 0.2);
  box-sizing: border-box;
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.close-modal {
  color: var(--primary);
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
  transition: color 0.2s;
}

.close-modal:hover {
  color: var(--primary-hover);
}

.modal-header-icon {
  font-size: 2.5rem;
  text-align: center;
  color: var(--primary);
  margin-bottom: 5px;
}

.auth-modal-content h3 {
  color: var(--primary);
  text-align: center;
  margin-top: 0;
  font-size: 1.6rem;
}

.modal-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* FORMULAIRES & AUTHENTIFICATION */
.input-group {
  position: relative;
  margin-bottom: 12px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #777;
}

.auth-modal-content input {
  width: 100%;
  padding: 14px 14px 14px 45px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(13, 110, 253, 0.3);
  background: rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-modal-content input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(13, 110, 253, 0.3);
}

.auth-submit-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit-btn:hover {
  background: var(--primary-hover);
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(13, 110, 253, 0.2);
}

.auth-divider span {
  background: rgba(255, 255, 255, 0.95);
  padding: 0 10px;
  position: relative;
  color: #555;
  font-size: 0.85rem;
  font-weight: bold;
}

.social-auth-grid {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.social-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(13, 110, 253, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.3s, transform 0.2s;
}

.social-btn:hover {
  background: rgba(13, 110, 253, 0.1);
  transform: translateY(-2px);
}

.auth-switch-text {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #444;
}

.auth-switch-text a {
  color: var(--primary);
  font-weight: bold;
  text-decoration: none;
}

.auth-switch-text a:hover {
  text-decoration: underline;
}

/* MENU UTILISATEUR CONNECTÉ */
.user-menu-container {
  position: relative;
  display: inline-block;
}

.nav-avatar-btn {
  background: #ffffff;
  color: var(--primary);
  border: 2px solid rgba(13, 110, 253, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, background 0.2s;
}

.nav-avatar-btn:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #ffffff;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 8px 0;
  z-index: 1000;
  flex-direction: column; 
  border: 1px solid var(--border-color);
  animation: modalFadeIn 0.2s ease;
}

.user-dropdown-menu.show {
  display: flex;
}

.user-dropdown-menu .dropdown-link,
.user-dropdown-menu .logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.2s, color 0.2s;
}

.user-dropdown-menu .dropdown-link:hover,
.user-dropdown-menu .logout-btn:hover {
  background-color: #f1f3f5;
  color: var(--primary);
}

.user-dropdown-menu .logout-btn {
  color: var(--danger);
  border-top: 1px solid #eaeaea;
  margin-top: 4px;
  padding-top: 12px;
}

.user-dropdown-menu .logout-btn:hover {
  background-color: #fff5f5;
  color: var(--danger);
}

/* TOAST NOTIFICATIONS */
#toastContainer {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: 90%;
  pointer-events: none;
}

.custom-toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 5px solid var(--primary);
  padding: 15px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  font-size: 0.95rem;
  color: var(--text-main);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  border: 1px solid rgba(13, 110, 253, 0.15);
}

.custom-toast.success { border-left-color: var(--success); }
.custom-toast.error { border-left-color: var(--danger); }
.custom-toast.warning { border-left-color: var(--warning); }

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

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* FOOTER COMPONENT */
.modern-footer {
  background: rgba(0, 43, 107, 0.08); 
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 60px 0 20px 0;
  color: var(--text-main);
  margin-top: 60px;
  border-top: 1px solid rgba(13, 110, 253, 0.1);
  opacity: 0;
  transform: translateY(40px);
  animation: fallbackReveal 0.8s ease-out 2s forwards; 
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.modern-footer.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  animation: none; 
}

@keyframes fallbackReveal {
  to { opacity: 1; transform: translateY(0); }
}

.footer-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 40px;
}

.footer-section {
  flex: 1;
  min-width: 0;
}

.footer-section h4 {
  color: var(--primary-hover);
  font-size: 1.2rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-section p {
  color: #555;
  line-height: 1.6;
  font-size: 0.95rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li { margin-bottom: 12px; }

.footer-links a {
  color: #555;
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s, transform 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(5px); 
}

.social-icons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(13, 110, 253, 0.1);
  color: var(--primary);
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.1rem;
  transition: background 0.3s, transform 0.3s, color 0.3s, box-shadow 0.3s;
}

.social-icons a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(13, 110, 253, 0.3);
}

.footer-bottom {
  text-align: center;
  padding-top: 25px;
  border-top: 1px solid rgba(0, 43, 107, 0.1);
  font-size: 0.9rem;
  color: #666;
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
  .hero-float-img {
    width: 110px;
    height: 75px;
    opacity: 0.8;
  }
  .hero-float-left { left: 8px; }
  .hero-float-right { right: 8px; }
}

/* RESPONSIVE DESIGN CORRIGÉ */
@media (max-width: 768px) {
  .hamburger { 
    display: block; 
  }

  .hero-float-group,
  .hero-float-img { 
    display: none !important; 
  }

  nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    gap: 15px;
    margin-top: 8px;
  }

  nav.active { 
    display: flex; 
  }

  nav a {
    font-size: 1.1rem;
    width: 100%;
    justify-content: center;
    padding: 8px 0;
  }

  .nav-auth-btn {
    width: 80%;
    margin: 0 auto;
    justify-content: center;
  }
  
  .section-animated-img { 
    height: 210px; 
  }

  .footer-container {
    gap: 10px;
    text-align: left;
  }
  
  .footer-section h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }
  
  .footer-section p, 
  .footer-links a {
    font-size: 0.75rem; 
  }
  
  .social-icons { 
    gap: 5px; 
  }
  
  .social-icons a {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
}

/* STYLES DE LA MODALE STATISTIQUES */
.modal-body ul {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.modal-body li {
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

/* MODE SOMBRE (DARK THEME) */
[data-theme="dark"],
body.dark-mode {
  --bg-main: #121212;
  --bg-card: #1e1e1e;
  --bg-primary: #121212;
  --text-main: #f1f3f5;
  --text-primary: #ffffff;
  --text-muted: #a0a0a0;
  --border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] header,
body.dark-mode header {
  background: rgba(18, 18, 18, 0.85);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .auth-modal-content,
[data-theme="dark"] .user-dropdown-menu,
[data-theme="dark"] .custom-toast,
body.dark-mode .modal-content {
  background: rgba(30, 30, 30, 0.98);
  color: var(--text-main);
  border-color: var(--border-color);
}

[data-theme="dark"] .image-caption-top,
[data-theme="dark"] .image-caption-bottom {
  background: rgba(13, 110, 253, 0.15);
  color: var(--text-main);
}

[data-theme="dark"] .process-list li,
[data-theme="dark"] .card {
  background: var(--bg-card);
  color: var(--text-main);
}
