/* ================================================================
   CENTRE FORMATION FFVELO - CSS (REFACTORISÉ • SANS JAUNE)
   - Conserve toutes les classes existantes
   - Factorise les couleurs/répétitions
   - FFVélo = bleu/rouge uniquement (aucun jaune)
   ================================================================ */

/* =========================
   TOKENS / VARIABLES
   ========================= */
:root {
  /* FFVélo */
  --ffvelo-blue: #004b9b;
  --ffvelo-red:  #e30613;
  --bs-body-color: #292675;
  --bs-heading-color: #292675;           /* Titres (h1-h6) */
  --bs-secondary-color: #292675;         /* Texte secondaire */
  --bs-tertiary-color: #292675;
  --bs-text-muted: #6c757d;

  /* Système primaire (ton système actuel) */
  --primary: #172983;
  --primary-hover: #303F9F;
  --primary-shadow: rgba(23, 41, 131, 0.3);

  /* Texte & UI */
  --ink: #0b2e59;
  --text-light: #666666;
  --border-light: #e0e0e0;

  /* Gradients */
  --grad-ffvelo: linear-gradient(90deg, var(--ffvelo-blue), var(--ffvelo-red));
  --grad-ffvelo-soft: linear-gradient(
    90deg,
    rgba(0, 75, 155, 0.10),
    rgba(227, 6, 19, 0.06)
  );

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);

  /* Motion */
  --anim: 0.3s ease;

  /* Bootstrap compatibility */
  --bs-primary: var(--primary);
  --bs-primary-rgb: 23, 41, 131;
}

/* ================================================================
   OVERRIDE BOOTSTRAP PRIMARY - conservation de ton système (factorisé)
   ================================================================ */
.bg-primary,
.badge.bg-primary,
.card-header.bg-primary {
  background-color: var(--primary) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.border-primary,
.card.border-primary {
  border-color: var(--primary) !important;
}

.border-start.border-primary,
.list-group-item.border-start.border-primary {
  border-left-color: var(--primary) !important;
}

.table-primary,
.table-primary th {
  background-color: var(--primary);
  color: white;
}

/* Buttons (factorisé) */
.btn-primary,
.btn-outline-primary {
  font-weight: 600;
  transition: all var(--anim);
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-shadow);
}

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

.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-shadow);
}

/* ================================================================
   TYPOGRAPHIE & BASE
   ================================================================ */
body {
  background-color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
  transition: all var(--anim);
}

.navbar-brand img {
  transition: transform var(--anim);
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

.navbar-light .navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all var(--anim);
  position: relative;
}

/* Dropdown menu */
.dropdown-menu {
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  margin-top: 0.5rem !important;
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  transition: all var(--anim);
}

.dropdown-item:hover {
  background: var(--grad-ffvelo-soft);
  color: var(--ffvelo-blue);
  padding-left: 2rem;
}

.dropdown-menu-custom {
  min-width: 20rem;
  max-height: 95vh;
}

/* ================================================================
   HERO / IMAGE TOP
   ================================================================ */
div.img-top {
  height: 70vh;
  min-height: 400px;
  position: relative;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6)),
    url('/assets/styles/img/home_page/centre_formation.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: stretch; /* allow full height */
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  max-width: 900px;
  padding: 2rem;

  /* NEW */
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  margin-bottom: 2rem;
  opacity: 0.95;
}

.hero-actions {
  margin-top: auto;     /* pushes buttons to bottom */
  padding-top: 1.5rem; /* optional spacing */
}

/* ================================================================
   ARROW BAND (conservé, mais sans jaune)
   ================================================================ */
.arrow-band {
  position: relative;
}

.arrow-band::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 1.5rem;
  height: clamp(140px, 22vw, 260px);
  z-index: 1;
  pointer-events: none;
  background: var(--grad-ffvelo);
  clip-path: polygon(0 15%, 88% 15%, 96% 50%, 88% 85%, 0 85%);
  box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, .15);
}

.band-content {
  position: relative;
  z-index: 2;
}

@media (min-width: 992px) {
  .arrow-band::before {
    inset: auto 0 25% 0;
    height: 260px;
  }
}

/* ================================================================
   CARDS & PILLAR
   ================================================================ */
.card {
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  transition: all var(--anim);
  box-shadow: var(--shadow-sm);
}

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

.card-img-top {
  transition: transform 0.5s ease;
}

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

.pillar {
  border: 0;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
}

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

.pillar .card-header {
  background: transparent;
  border: 0;
  padding: 1.25rem 1.25rem 0;
}

.pillar .card-title {
  font-weight: 700;
  color: var(--ink);
}

.pillar .card-body {
  padding: 1.5rem;
}

/* ================================================================
   CARDS DE FORMATIONS
   ================================================================ */
.formation-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
  background: white;
}

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

.formation-card .card-img-top {
  height: 220px;
  object-fit: cover;
}

/* (Conservé : ce badge est vert, pas jaune) */
.formation-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.formation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.formation-meta i {
  color: var(--primary);
  margin-right: 0.25rem;
}

/* ================================================================
   SECTIONS
   ================================================================ */
.section {
  padding: 4rem 0;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--ink);
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-light);
  margin-bottom: 3rem;
}

.section-bg-light {
  background-color: #f8f9fa;
}

.section-bg-gradient {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

/* Séparateur de section */
.section-divider {
  height: 4px;
  width: 80px;
  background: var(--grad-ffvelo);
  margin: 2rem 0;
  border-radius: 2px;
}

/* ================================================================
   STATS / CHIFFRES CLÉS
   (refactor : enlève l'ancien dégradé jaune)
   ================================================================ */
.stat-box {
  text-align: center;
  padding: 2rem;
  border-radius: 1rem;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  background: var(--grad-ffvelo);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.badge-dot {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.badge-dot::before {
  content: "";
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.success-badge {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.info-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 12px rgba(23, 41, 131, 0.2);
}

/* ================================================================
   LISTE DES FORMATIONS
   (refactor : enlève border-left hover jaune)
   ================================================================ */
.formation-list-item {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
  border-left: 4px solid var(--primary);
}

.formation-list-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--ffvelo-red);
}

.formation-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* ================================================================
   ARTICLES / ACTUALITÉS
   ================================================================ */
.article-card {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
  background: white;
}

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

.article-image {
  height: 250px;
  object-fit: cover;
  width: 100%;
  transition: transform 0.5s ease;
}

.article-card:hover .article-image {
  transform: scale(1.05);
}

.article-content {
  padding: 1.5rem;
}

.article-date {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
}

.article-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* ================================================================
   BOUTONS AMÉLIORÉS
   (refactor : enlève btn-cta jaune -> FFVélo gradient)
   ================================================================ */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all var(--anim);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* CTA en FFVélo bleu/rouge */
.btn-cta {
  background: linear-gradient(135deg, var(--ffvelo-blue), var(--ffvelo-red));
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 75, 155, 0.25);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(227, 6, 19, 0.25);
  color: white;
}

/* ================================================================
   UTILITIES
   ================================================================ */
.arrow {
  border: solid white;
  border-width: 0 3px 3px 0;
  display: inline-block;
  padding: 5px;
}

.up {
  transform: rotate(-135deg);
  -webkit-transform: rotate(-135deg);
}

a {
  color: black;
  text-decoration: none;
  transition: color var(--anim);
}

a:hover {
  color: var(--primary);
}

.text-outline {
  -webkit-text-stroke: 0.3px black;
}

.line-clamp-4 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.line-clamp-6 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}

.checklist li {
  padding: .25rem 0;
}

.subtle {
  opacity: .85;
}

/* ================================================================
   FOOTER
   ================================================================ */
footer {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-top: 4px solid transparent;
  border-image: var(--grad-ffvelo) 1;
}

footer a {
  color: var(--text-light);
  transition: all var(--anim);
}

footer a:hover {
  color: var(--primary);
  padding-left: 0.25rem;
}

footer .fs-5 {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1rem;
}

#img-qualiopi,
#img-ocsport {
  transition: transform var(--anim);
}

#img-qualiopi:hover,
#img-ocsport:hover {
  transform: scale(1.05);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }

  .dropdown-menu-custom {
    min-width: 10rem;
  }

  .navbar-collapse {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .section {
    padding: 2rem 0;
  }

  .stat-box {
    margin-bottom: 1rem;
  }
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Focus states améliorés */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(23, 41, 131, 0.25);
}

/* ================================================================
   QUALIOPI BADGE
   ================================================================ */
.qualiopi-badge {
  display: inline-block;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
}

.qualiopi-badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ================================================================
   LOADING STATES
   ================================================================ */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================================================
   NAVBAR FIX: underline on ::before + chevron caret (FINAL)
   - underline visible on hover + active + dropdown open
   ================================================================ */
#navmain .nav-link {
  position: relative;
}

#navmain .nav-link:hover,
#navmain .nav-link:focus,
#navmain .nav-link.active,
#navmain .nav-item.show > .nav-link {
  color: var(--ffvelo-blue) !important;
}

/* Underline (shared) */
#navmain .navbar-nav .nav-link::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  transform: translateX(-50%);
  transition: width 0.25s ease;
  background: var(--grad-ffvelo);
}

#navmain .navbar-nav .nav-link:hover::before,
#navmain .navbar-nav .nav-link.active::before,
#navmain .nav-item.show > .nav-link::before {
  width: 80%;
}

/* Dropdown caret = chevron (no triangle, no underline conflict) */
#navmain .dropdown-toggle::after {
  content: "\f282"; /* bi-chevron-down */
  font-family: "Bootstrap-icons";
  border: 0 !important;
  display: inline-block;
  width: auto;
  height: auto;
  background: none;
  position: static;
  margin-left: .4rem;
  vertical-align: middle;
  transition: transform .2s ease;
}

#navmain .nav-item.show .dropdown-toggle::after {
  transform: rotate(180deg);
}

#navmain .dropdown-toggle {
  padding-right: 1.25rem;
}
