/* =============================================
   CSS PRINCIPAL — GEDBERED Formation
   Mobile-first | Charte graphique GEDBERED
   ============================================= */

/* --- Variables CSS --- */
:root {
  --primary: #1A56DB;
  --primary-dark: #1343A8;
  --primary-light: #EBF0FD;
  --secondary: #E02424;
  --accent-green: #16A34A;
  --accent-yellow: #FBBF24;
  --dark: #1F2937;
  --light: #F9FAFB;
  --white: #FFFFFF;
  --gray: #6B7280;
  --gray-light: #E5E7EB;
  --whatsapp: #25D366;
  --font: 'Poppins', sans-serif;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(26,86,219,0.15);
  --transition: all 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--dark);
  background-color: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
}

a { color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* --- Navbar : z-index supérieur à tout le contenu de page --- */
.navbar {
  background-color: var(--primary) !important;
  padding: 0.75rem 0;
  z-index: 1040 !important;
}

/* --- Sidebar sticky : z-index bas pour ne jamais passer au-dessus du header --- */
.sidebar-sticky {
  position: sticky;
  top: 78px;          /* hauteur de la navbar */
  z-index: 10;        /* bien inférieur à 1040 */
}

/* --- Badge info dans la bannière formation --- */
.badge-info-banniere {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: rgb(36, 0, 0);
  border-radius: 50px;
  padding: .35rem 1rem;
  font-size: .82rem;
  font-weight: 600;
}

/* Scroll padding pour les ancres (compense la navbar sticky) */
html {
  scroll-padding-top: 80px;
}

.logo-circle {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  border: 2px solid rgba(255,255,255,0.4);
}

.logo-circle-sm {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
}

.navbar .nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  background: rgba(255,255,255,0.15);
}

/* --- Hero / Bannière principale --- */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #0d2d7a 100%);
  color: white;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(251,191,36,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  opacity: 0.9;
  max-width: 600px;
}

.badge-fdfp-hero {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  color: white;
  border-radius: 50px;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Section Titre --- */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--dark);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent-yellow);
  border-radius: 2px;
}

.section-title.text-center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* --- Cards Formation --- */
.formation-card {
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
  background: white;
}

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

.formation-card .card-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.formation-card .card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.formation-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.formation-card .card-img-overlay-custom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  padding: 1rem;
}

.badge-fdfp {
  background: var(--accent-green);
  color: white;
  border-radius: 50px;
  padding: 0.2rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.formation-card .card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.formation-card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.formation-card .card-text {
  font-size: 0.875rem;
  color: var(--gray);
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.formation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.78rem;
  color: var(--gray);
}

.formation-meta span {
  background: var(--light);
  border-radius: 50px;
  padding: 0.2rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.formation-meta i {
  color: var(--primary);
}

/* Placeholder pour image manquante */
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: rgba(255,255,255,0.7);
  font-size: 3rem;
}

/* --- Boutons --- */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
  border-radius: 8px;
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-warning {
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  color: var(--dark);
  font-weight: 600;
  border-radius: 8px;
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  border-radius: 8px;
}

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

.btn-whatsapp {
  background-color: var(--whatsapp);
  border-color: var(--whatsapp);
  color: white;
  font-weight: 600;
  border-radius: 8px;
}

.btn-whatsapp:hover {
  background-color: #1da851;
  border-color: #1da851;
  color: white;
}

/* --- WhatsApp Flottant --- */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 58px;
  height: 58px;
  background-color: var(--whatsapp);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  z-index: 9999;
  text-decoration: none;
  transition: var(--transition);
  animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  color: white;
  box-shadow: 0 6px 25px rgba(37,211,102,0.6);
}

.whatsapp-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--secondary);
  color: white;
  border-radius: 50px;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 5px;
}

@keyframes pulse-whatsapp {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.4); }
  70% { box-shadow: 0 0 0 12px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* --- Retour en haut --- */
.back-to-top {
  position: fixed;
  bottom: 90px;
  right: 25px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Page Formation Détail --- */
.formation-hero {
  position: relative;
  min-height: 350px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.formation-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.formation-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.formation-hero-content {
  position: relative;
  z-index: 1;
  color: white;
  padding: 3rem 0;
}

.module-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--light);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.module-item:hover {
  background: var(--primary-light);
  transform: translateX(4px);
}

.module-item i {
  color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.debouche-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  transition: var(--transition);
}

.debouche-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.debouche-item i {
  color: var(--accent-green);
}

/* Info box formation */
.info-box {
  background: var(--primary-light);
  border: 1px solid rgba(26,86,219,0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.info-box-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(26,86,219,0.1);
}

.info-box-item:last-child { border-bottom: none; }
.info-box-item i { color: var(--primary); font-size: 1.1rem; width: 20px; }
.info-box-label { font-size: 0.8rem; color: var(--gray); }
.info-box-value { font-weight: 600; color: var(--dark); font-size: 0.95rem; }

/* --- Formulaire d'inscription --- */
.inscription-section {
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid rgba(26,86,219,0.15);
}

.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid var(--gray-light);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

/* --- Commentaires --- */
.comment-card {
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: var(--transition);
}

.comment-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.comment-avatar {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.stars {
  color: var(--accent-yellow);
  font-size: 0.9rem;
}

/* --- Témoignages --- */
.testimonial-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

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

.testimonial-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-light);
}

/* --- Stats section --- */
.stats-section {
  background: var(--primary);
  color: white;
  padding: 3rem 0;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--accent-yellow);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--dark) 0%, #374151 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* --- Footer --- */
.footer { font-size: 0.9rem; }
.footer .hover-white:hover { color: white !important; }

/* --- Formation card hover sidebar --- */
.sidebar-formation-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: .25rem;
}

/* --- Atouts section --- */
.atout-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--light);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  height: 100%;
  transition: var(--transition);
}
.atout-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* Smooth scroll offset pour ancres */
:target {
  scroll-margin-top: 90px;
}

/* --- Admin --- */
.admin-sidebar {
  background: var(--dark);
  min-height: 100vh;
  color: white;
}

.admin-nav-link {
  color: rgba(255,255,255,0.7);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
  font-size: 0.9rem;
}

.admin-nav-link:hover, .admin-nav-link.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.6s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* --- Responsive ajustements --- */
@media (max-width: 767.98px) {
  .hero-banner { padding: 3rem 0 2.5rem; }
  .formation-card .card-img-wrapper { height: 180px; }
  .whatsapp-float { bottom: 15px; right: 15px; width: 52px; height: 52px; font-size: 1.5rem; }
  .back-to-top { bottom: 75px; right: 15px; }
  .stats-section { padding: 2rem 0; }
}

@media (max-width: 575.98px) {
  body { font-size: 15px; }
  .navbar-brand span.fs-5 { font-size: 1rem !important; }
  .formation-hero { min-height: 280px; }
}

/* --- Utilitaires --- */
.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.text-warning { color: var(--accent-yellow) !important; }
.bg-light-custom { background-color: var(--light); }

/* Ligne de séparation décorative */
.divider {
  width: 60px;
  height: 4px;
  background: var(--accent-yellow);
  border-radius: 2px;
  margin: 1rem auto;
}

.divider-left {
  margin: 1rem 0;
}

/* Breadcrumb */
.breadcrumb-custom {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

.breadcrumb-custom a { color: rgba(255,255,255,0.7); text-decoration: none; }
.breadcrumb-custom a:hover { color: white; }
.breadcrumb-custom span { color: white; }

/* Alert styles */
.alert { border-radius: var(--radius); border: none; }
.alert-success { background: rgba(22,163,74,0.1); color: var(--accent-green); }
.alert-danger { background: rgba(224,36,36,0.1); color: var(--secondary); }

/* ====== CAROUSEL MAISON (formations & avis) ====== */
.gdb-carousel-wrap {
  position: relative;
}
.gdb-carousel-viewport {
  overflow: hidden;
}
.gdb-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
.gdb-carousel-slide {
  flex: 0 0 33.333%;
  padding: 0 0.65rem;
  box-sizing: border-box;
}
@media (max-width: 991.98px) {
  .gdb-carousel-slide { flex: 0 0 50%; }
}
@media (max-width: 575.98px) {
  .gdb-carousel-slide { flex: 0 0 100%; }
}

.gdb-carousel-btn {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: white;
  border: 1.5px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  transition: all .22s;
  color: #1F2937;
  font-size: 1.05rem;
  padding: 0;
  line-height: 1;
}
.gdb-carousel-btn:hover,
.gdb-carousel-btn:focus {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 18px rgba(26,86,219,.28);
  outline: none;
}
.gdb-carousel-btn-prev { left: -23px; }
.gdb-carousel-btn-next { right: -23px; }

@media (max-width: 575.98px) {
  .gdb-carousel-btn { width: 36px; height: 36px; font-size: .88rem; }
  .gdb-carousel-btn-prev { left: -18px; }
  .gdb-carousel-btn-next { right: -18px; }
}

.gdb-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gdb-c-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all .22s;
  flex-shrink: 0;
}
.gdb-c-dot.active {
  width: 26px;
  border-radius: 4px;
  background: var(--primary);
}
.gdb-c-dot:hover { background: var(--primary); opacity: .6; }
