/* ==========================================================
   Institut Saad — Feuille de style publique
   Palette : #58668C (bleu-violet), #FFF7A0 (jaune), #FFFDB1 (crème)
   ========================================================== */

:root {
  --brand-primary: #58668C;
  --brand-primary-dark: #414D6B;
  --brand-primary-light: #7A88AE;
  --brand-accent: #FFF7A0;
  --brand-accent-dark: #E8DF8A;
  --brand-cream: #FFFDB1;
  --brand-cream-light: #FFFDE8;
  --brand-ink: #252B3B;
  --brand-muted: #6C7690;
  --brand-line: #E4E8F1;
  --brand-bg: #F7F8FC;

  --bs-primary: #58668C;
  --bs-primary-rgb: 88, 102, 140;
  --bs-warning: #FFF7A0;
  --bs-dark: #252B3B;

  --primary-gradient: linear-gradient(135deg, #58668C 0%, #465270 55%, #3A4360 100%);
  --primary-gradient-light: linear-gradient(135deg, #7A88AE 0%, #58668C 100%);
  --accent-gradient: linear-gradient(135deg, #FFF7A0 0%, #FFFDB1 100%);
  --dark-gradient: linear-gradient(135deg, #252B3B 0%, #414D6B 100%);
  --hero-gradient:
    radial-gradient(900px 500px at 85% 10%, rgba(255, 247, 160, 0.14), transparent 60%),
    radial-gradient(700px 400px at 5% 90%, rgba(255, 253, 177, 0.10), transparent 60%),
    linear-gradient(140deg, #58668C 0%, #465270 55%, #373F58 100%);

  --shadow-xs: 0 2px 8px rgba(37, 43, 59, 0.05);
  --shadow-sm: 0 6px 20px rgba(37, 43, 59, 0.07);
  --shadow: 0 14px 38px rgba(37, 43, 59, 0.11);
  --shadow-lg: 0 24px 60px rgba(37, 43, 59, 0.17);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --transition-fast: all 0.18s ease;
  --transition-base: all 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ============ Base ============ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--brand-ink);
  background: var(--brand-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
}

p { color: inherit; }

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: var(--brand-primary-dark); }

img { max-width: 100%; height: auto; }

::selection {
  background: var(--brand-accent);
  color: var(--brand-primary-dark);
}

:focus-visible {
  outline: 3px solid rgba(88, 102, 140, 0.45);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--brand-cream-light); }
::-webkit-scrollbar-thumb {
  background: var(--brand-primary);
  border-radius: 20px;
  border: 3px solid var(--brand-cream-light);
}
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary-dark); }

main { min-height: 40vh; }

/* ============ Preloader ============ */
#preloader {
  background: var(--brand-cream-light);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader .spinner-border { color: var(--brand-primary) !important; }
#preloader .text-muted { color: var(--brand-primary) !important; }

/* ============ Navbar ============ */
.navbar {
  background: rgba(65, 77, 107, 0.96) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px rgba(37, 43, 59, 0.16);
  padding: 0.85rem 0;
  transition: var(--transition-base);
}

.navbar.scrolled {
  background: rgba(55, 65, 92, 0.98) !important;
  padding: 0.55rem 0;
  box-shadow: 0 10px 30px rgba(37, 43, 59, 0.24);
}

.navbar-brand {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 72vw;
}

.navbar-brand img {
  height: 42px;
  width: auto;
  max-width: 54px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px;
}

.navbar-brand span {
  color: var(--brand-accent);
  line-height: 1.2;
}

.navbar-brand i { color: var(--brand-accent); }

.navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
}
.navbar-toggler:focus { box-shadow: 0 0 0 4px rgba(255, 247, 160, 0.25); }

.navbar-nav { gap: 0.15rem; }

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem !important;
  border-radius: 9px;
  position: relative;
  transition: var(--transition-fast);
}
.navbar-nav .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08);
}
.navbar-nav .nav-link.active {
  color: var(--brand-accent) !important;
  background: rgba(255, 247, 160, 0.10);
}
.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.28rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { transform: scaleX(1); }

.btn-nav-cta {
  background: var(--accent-gradient);
  color: var(--brand-primary-dark) !important;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.6rem 1.35rem !important;
  border-radius: 50rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px rgba(255, 247, 160, 0.20);
}
.btn-nav-cta::after { display: none; }
.btn-nav-cta:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(255, 247, 160, 0.35);
  color: var(--brand-primary-dark) !important;
}

/* ============ Boutons ============ */
.btn {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.72rem 1.45rem;
  border-radius: 50rem;
  transition: var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  line-height: 1.35;
  border-width: 1.5px;
}
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.03rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(88, 102, 140, 0.28);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-gradient-light);
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(88, 102, 140, 0.38);
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: rgba(88, 102, 140, 0.55);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-warning {
  background: var(--accent-gradient);
  border-color: transparent;
  color: var(--brand-primary-dark);
  box-shadow: 0 8px 22px rgba(232, 223, 138, 0.30);
}
.btn-warning:hover {
  background: #FFFBD0;
  border-color: transparent;
  color: var(--brand-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(232, 223, 138, 0.45);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}
.btn-outline-light:hover {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--brand-primary-dark);
  transform: translateY(-2px);
}

.btn-light { background: #fff; color: var(--brand-primary-dark); border-color: #fff; }
.btn-light:hover { background: var(--brand-cream); border-color: var(--brand-cream); color: var(--brand-primary-dark); }

.btn-outline-secondary {
  color: var(--brand-muted);
  border-color: #CBD2E0;
}
.btn-outline-secondary:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #5B8C5A, #477246);
  border-color: transparent;
  color: #fff;
}
.btn-success:hover { filter: brightness(1.05); color: #fff; transform: translateY(-2px); }

.btn-danger {
  background: linear-gradient(135deg, #C45C5C, #A94A4A);
  border-color: transparent;
}
.btn-danger:hover { filter: brightness(1.05); transform: translateY(-2px); }

/* ============ Sections ============ */
.section-padding { padding: 5.5rem 0; }
.section-header { margin-bottom: 3.25rem; }
.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: var(--brand-primary-dark);
  margin-bottom: 0.6rem;
}
.section-header .divider {
  width: 74px;
  height: 5px;
  border-radius: 10px;
  background: var(--accent-gradient);
  margin: 1.1rem auto;
}
.section-header p {
  color: var(--brand-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.bg-light { background-color: #F1F3F9 !important; }
.bg-primary-gradient {
  background-image: var(--primary-gradient) !important;
  background-color: var(--brand-primary) !important;
}
.bg-dark-gradient {
  background-image: var(--dark-gradient) !important;
  background-color: var(--brand-ink) !important;
}
.text-primary { color: var(--brand-primary) !important; }
.text-primary-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ Hero / pages intérieures ============ */
.hero-section {
  background: var(--hero-gradient);
  padding: 6.5rem 0 5.5rem;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.hero-section::before,
.hero-section::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-section::before {
  width: 560px;
  height: 560px;
  top: -260px;
  right: -140px;
  background: rgba(255, 247, 160, 0.10);
  filter: blur(4px);
}
.hero-section::after {
  width: 420px;
  height: 420px;
  bottom: -240px;
  left: -120px;
  background: rgba(255, 253, 177, 0.07);
}
.hero-section .container { position: relative; z-index: 2; }

.hero-section h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.55rem);
  font-weight: 800;
  line-height: 1.16;
  color: #fff;
  letter-spacing: -0.03em;
}
.hero-section h1 .text-warning,
.hero-section h1 span { color: var(--brand-accent) !important; }
.hero-section .lead {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.75;
}
.hero-section .lead p:last-child { margin-bottom: 0; }
.hero-section .badge {
  background: var(--accent-gradient) !important;
  color: var(--brand-primary-dark) !important;
  border-radius: 50rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-section img.rounded-4 {
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 30px 70px rgba(18, 22, 34, 0.35) !important;
}

.hero-fallback {
  background: rgba(255, 255, 255, 0.09) !important;
  border: 1px solid rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg) !important;
}
.hero-fallback i { color: var(--brand-accent) !important; }
.hero-fallback h3 { color: #fff !important; }

.hero-about,
.hero-contact,
.hero-timetable,
.hero-formations {
  position: relative;
  overflow: hidden;
  padding-top: 4.5rem !important;
  padding-bottom: 4.5rem !important;
  background-image: var(--hero-gradient) !important;
  color: #fff;
}
.hero-about::before,
.hero-contact::before,
.hero-timetable::before,
.hero-formations::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  top: -190px;
  right: -110px;
  border-radius: 50%;
  background: rgba(255, 247, 160, 0.10);
}
.hero-about .container,
.hero-contact .container,
.hero-timetable .container,
.hero-formations .container { position: relative; z-index: 2; }
.hero-about h1,
.hero-contact h1,
.hero-timetable h1,
.hero-formations h1 { color: #fff; }
.hero-stats > div {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  backdrop-filter: blur(8px);
}

/* ============ Carrousel ============ */
.hero-carousel-section { position: relative; background: var(--brand-ink); }
.hero-carousel-section .carousel-item { position: relative; }
.carousel-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(37, 43, 59, 0.72) 0%, rgba(37, 43, 59, 0.25) 55%, rgba(37, 43, 59, 0.10) 100%),
    linear-gradient(to top, rgba(37, 43, 59, 0.72), transparent 55%);
}
.carousel-caption-custom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: min(86%, 780px);
  text-align: center;
  color: #fff;
}
.carousel-title {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  margin-bottom: 0.9rem;
}
.carousel-subtitle {
  font-size: clamp(0.9rem, 1.5vw, 1.16rem);
  opacity: 0.94;
  margin-bottom: 1.4rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.carousel-btn {
  padding: 0.85rem 1.8rem;
  border-radius: 50rem;
  box-shadow: 0 14px 34px rgba(255, 247, 160, 0.30);
}
.hero-carousel-section .carousel-indicators { z-index: 3; bottom: 26px; }
.hero-carousel-section .carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: transparent;
  margin: 0 5px;
  opacity: 0.7;
  transition: var(--transition-base);
}
.hero-carousel-section .carousel-indicators button.active {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  transform: scale(1.3);
  opacity: 1;
}
.hero-carousel-section .carousel-control-prev,
.hero-carousel-section .carousel-control-next {
  z-index: 3;
  width: 52px;
  height: 52px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: var(--transition-base);
}
.hero-carousel-section:hover .carousel-control-prev,
.hero-carousel-section:hover .carousel-control-next { opacity: 1; }
.hero-carousel-section .carousel-control-prev:hover,
.hero-carousel-section .carousel-control-next:hover { background: rgba(255, 247, 160, 0.82); }

/* ============ Cartes ============ */
.card {
  border: 1px solid rgba(228, 232, 241, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  background: #fff;
  transition: var(--transition-base);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow); }
.card-img-top {
  height: 210px;
  width: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.formation-card:hover .card-img-top,
.card:hover > .position-relative .card-img-top { transform: scale(1.045); }
.card-body { padding: 1.5rem; }
.card-title { font-weight: 700; color: var(--brand-primary-dark); letter-spacing: -0.01em; }
.card-price { font-size: 1.28rem; font-weight: 800; color: var(--brand-primary); }
.card-badge { position: absolute; top: 0.9rem; right: 0.9rem; z-index: 2; }

.card-overlay {
  background: linear-gradient(135deg, rgba(65, 77, 107, 0.90), rgba(88, 102, 140, 0.78));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 4;
}
.card-overlay .btn { transform: translateY(12px); transition: transform 0.3s ease; }
.card:hover .card-overlay { opacity: 1; }
.card:hover .card-overlay .btn { transform: translateY(0); }

.formation-card { transition: var(--transition-base); }
.formation-card:hover { transform: translateY(-6px); }
.formation-card.hidden { display: none; }

.team-card { transition: var(--transition-base); }
.team-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg) !important; }
.team-image-wrapper { width: 140px; height: 140px; position: relative; }
.team-avatar {
  width: 140px;
  height: 140px;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background-image: var(--primary-gradient) !important;
  border: 4px solid var(--brand-cream);
  box-shadow: var(--shadow-sm);
}
.team-social-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 0.65rem;
  border-radius: 0 0 70px 70px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(transparent, rgba(65, 77, 107, 0.92));
}
.team-card:hover .team-social-overlay { opacity: 1; }

/* ============ Avantages / chiffres ============ */
.stats-section {
  background: var(--dark-gradient);
  padding: 4.5rem 0;
  position: relative;
  overflow: hidden;
}
.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 240px at 50% 0%, rgba(255, 247, 160, 0.10), transparent 70%);
  pointer-events: none;
}
.stats-section .container { position: relative; z-index: 2; }
.stat-item, .stat-card { text-align: center; padding: 1.3rem 0.75rem; }
.stat-icon {
  font-size: 2.2rem;
  color: var(--brand-accent) !important;
  margin-bottom: 0.8rem;
  line-height: 1;
}
.stat-number {
  font-size: clamp(1.9rem, 3.6vw, 2.65rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.stat-label { color: rgba(255, 255, 255, 0.74); font-size: 0.95rem; }

.feature-card {
  height: 100%;
  padding: 2rem 1.6rem;
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: var(--transition-base);
}
.feature-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow);
  border-color: rgba(232, 223, 138, 0.75);
}
.feature-icon {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 1.55rem;
  margin-bottom: 1.25rem;
  color: var(--brand-primary);
  background: linear-gradient(135deg, rgba(88, 102, 140, 0.11), rgba(255, 247, 160, 0.32));
  transition: var(--transition-base);
}
.feature-card:hover .feature-icon {
  background: var(--primary-gradient);
  color: var(--brand-accent);
  transform: rotateY(360deg);
}
.feature-card h5 { color: var(--brand-primary-dark); margin-bottom: 0.65rem; }

.icon-box {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
}

/* ============ Témoignages ============ */
.testimonial-card {
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-base);
}
.testimonial-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.testimonial-img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand-cream);
}
.testimonial-stars { color: var(--brand-accent-dark); }

/* ============ Formulaires ============ */
.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
  color: var(--brand-primary-dark);
}
.form-control,
.form-select {
  border: 1.5px solid #D8DDEA;
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.95rem;
  font-size: 0.94rem;
  color: var(--brand-ink);
  background-color: #fff;
  transition: var(--transition-fast);
}
.form-control::placeholder { color: #9AA3B7; }
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.22rem rgba(88, 102, 140, 0.13);
  color: var(--brand-ink);
}
.input-group-text {
  background: #F5F7FC;
  border: 1.5px solid #D8DDEA;
  border-radius: var(--radius-sm);
  color: var(--brand-primary);
}
.input-group .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-text:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.form-check-input:focus { box-shadow: 0 0 0 0.2rem rgba(88, 102, 140, 0.18); }
.form-control.is-valid { border-color: #5B8C5A; }
.form-control.is-invalid { border-color: #C45C5C; }
.form-text { font-size: 0.8rem; color: var(--brand-muted); }

.form-range { accent-color: var(--brand-primary); }

.brand-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #E9ECF4;
  outline: none;
}
.brand-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg, #FFF7A0 0%, #58668C 100%);
}
.brand-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 3px solid var(--brand-accent);
  margin-top: -7px;
  box-shadow: 0 2px 8px rgba(88, 102, 140, 0.4);
  cursor: pointer;
}
.brand-range::-moz-range-track {
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg, #FFF7A0 0%, #58668C 100%);
}
.brand-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 3px solid var(--brand-accent);
  cursor: pointer;
}

/* ============ Modales ============ */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  padding: 1.1rem 1.4rem;
}
.modal-header .modal-title { color: #fff; font-size: 1.05rem; }
.modal-header .btn-close { filter: brightness(0) invert(1); opacity: 0.9; }
.modal-body { background: #fff; }
.modal-footer { border-top: 1px solid var(--brand-line); }
.info-box {
  border: 1px solid var(--brand-line);
  background: #F8F9FD !important;
  transition: var(--transition-base);
}
.info-box:hover {
  border-color: rgba(88, 102, 140, 0.55);
  box-shadow: 0 6px 16px rgba(88, 102, 140, 0.10);
}
#modalFormationImage {
  min-height: 190px;
  max-height: 260px;
  object-fit: cover;
  background: #EEF0F6;
}
.info-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  box-shadow: 0 4px 12px rgba(37, 43, 59, 0.18);
}
.info-btn:hover { transform: scale(1.08); background: var(--brand-accent); color: var(--brand-primary-dark); }

/* ============ Tableaux ============ */
.table { vertical-align: middle; color: var(--brand-ink); }
.table thead th {
  background: #F2F4FA;
  color: var(--brand-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--brand-accent) !important;
  white-space: nowrap;
}
.table-hover tbody tr:hover { background: rgba(255, 247, 160, 0.16); }

/* ============ Badges / alertes ============ */
.badge {
  font-weight: 600;
  padding: 0.45em 0.72em;
  border-radius: 8px;
  letter-spacing: 0.01em;
}
.badge.bg-warning { color: var(--brand-primary-dark) !important; }
.badge-primary { background: var(--primary-gradient); color: #fff; }
.badge-success { background: linear-gradient(135deg, #5B8C5A, #477246); color: #fff; }

.alert {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  font-size: 0.94rem;
}
.alert-success { background: #E9F5EA; color: #3F6F3E; }
.alert-danger { background: #FCEAEA; color: #A94444; }
.alert-warning { background: #FFFBE0; color: #7A6B00; }
.alert-info { background: #EDF0FA; color: #465270; }

/* ============ Galerie / contact ============ */
.gallery-item { border-radius: var(--radius); overflow: hidden; }
.gallery-placeholder { height: 200px; background: #EEF1F9 !important; }
.gallery-overlay {
  background: linear-gradient(135deg, rgba(65, 77, 107, 0.88), rgba(88, 102, 140, 0.78));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-item img { width: 100%; height: 200px; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.05); }

.contact-icon {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 14px;
  transition: var(--transition-base);
}
.contact-info-item:hover .contact-icon { transform: scale(1.08); }
.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  text-decoration: none;
  transition: var(--transition-base);
}
.social-btn:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: #fff; }
.map-wrapper { background: linear-gradient(135deg, #E9ECF4, #DDE2EF); }
.map-wrapper iframe { width: 100%; height: 100%; border: 0; }

/* ============ Emplois du temps ============ */
.calendar-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}
.emploi-card-hover { transition: var(--transition-base); }
.emploi-card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow) !important; }
.form-select-lg { padding: 0.8rem 1rem; font-size: 0.98rem; }

#emploiContent {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.pdf-header { border-bottom: 1px solid #D8DDEA; padding-bottom: 0.5rem; }
.logo-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  color: var(--brand-accent);
}
.pdf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pdf-table th,
.pdf-table td { border: 2px solid #2D3446; padding: 8px; vertical-align: middle; }
.pdf-table .header-row th { background: #E7EBF5; text-align: center; font-weight: 700; }
.pdf-table .jour-col { width: 100px; text-align: center; background: #E7EBF5; }
.pdf-table .seance-col { text-align: center; width: 200px; }
.pdf-table .jour-cell { background: #F4F5F8; font-weight: 700; text-align: center; }
.pdf-table .seance-cell { text-align: center; height: 80px; }
.cell-matiere { font-weight: 700; color: #1F3864; margin-bottom: 3px; }
.cell-prof { font-style: italic; color: #7030A0; font-size: 12px; margin-bottom: 3px; }
.cell-salle { font-size: 11px; color: #C00000; font-weight: 700; }

/* ============ Footer ============ */
.footer {
  position: relative;
  background: var(--dark-gradient);
  color: rgba(255, 255, 255, 0.70);
  padding-top: 4.5rem;
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  bottom: -340px;
  right: -160px;
  border-radius: 50%;
  background: rgba(255, 247, 160, 0.05);
  pointer-events: none;
}
.footer .container { position: relative; z-index: 1; }
.footer h5, .footer h6 { color: #fff; font-weight: 700; }
.footer h5 { font-size: 1.18rem; }
.footer h6 {
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand-accent);
  margin-bottom: 1.1rem;
}
.footer p { color: rgba(255, 255, 255, 0.68); }
.footer a { color: rgba(255, 255, 255, 0.70); }
.footer a:hover { color: var(--brand-accent); }
.footer-links li { margin-bottom: 0.55rem; }
.footer-links a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.92rem; }
.footer-links a i { font-size: 0.62rem; color: var(--brand-accent); }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.10);
  transition: var(--transition-base);
}
.footer-social a:hover {
  background: var(--brand-accent);
  color: var(--brand-primary-dark);
  transform: translateY(-3px);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
  padding-top: 1.2rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.84rem;
}
.footer-bottom a { color: rgba(255, 255, 255, 0.68); }
.newsletter-form .form-control {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.newsletter-form .form-control::placeholder { color: rgba(255, 255, 255, 0.55); }
.newsletter-form .form-control:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--brand-accent);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(255, 247, 160, 0.16);
}

/* ============ Retour en haut ============ */
.btn-back-to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 1030;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  color: var(--brand-accent);
  box-shadow: var(--shadow);
  transition: var(--transition-base);
}
.btn-back-to-top:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn-back-to-top.visible { display: inline-flex; animation: fadeInUp 0.3s ease-out; }

/* ============ Animations ============ */
.animate-fade-in { animation: fadeIn 0.6s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out; }
.animate-fade-in-left { animation: fadeInLeft 0.6s ease-out; }
.animate-fade-in-right { animation: fadeInRight 0.6s ease-out; }
.hero-animate-left { animation: fadeInLeft 0.8s ease-out; }
.hero-animate-right { animation: fadeInRight 0.8s ease-out; }

.animate-on-scroll {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.visible { opacity: 1; transform: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(4deg); }
}

/* ============ Utilitaires ============ */
.rounded-xl { border-radius: var(--radius-xl) !important; }
.shadow-hover:hover { box-shadow: var(--shadow-lg) !important; }
.cursor-pointer { cursor: pointer; }
.opacity-90 { opacity: 0.9; }

/* ============ Responsive ============ */
@media (max-width: 991.98px) {
  .navbar { padding: 0.7rem 0; }
  .navbar-collapse {
    margin-top: 0.85rem;
    padding: 0.85rem;
    background: rgba(45, 52, 70, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .navbar-nav { gap: 0.15rem; }
  .navbar-nav .nav-link { padding: 0.7rem 0.85rem !important; }
  .navbar-nav .nav-link::after { display: none; }
  .navbar-nav .nav-link.active { background: rgba(255, 247, 160, 0.12); }
  .navbar-nav .btn-nav-cta { margin-top: 0.5rem; width: 100%; }

  .hero-section { padding: 4.5rem 0 4rem; }
  .section-padding { padding: 3.75rem 0; }
  .section-header { margin-bottom: 2.4rem; }
  .hero-carousel-section .carousel-control-prev,
  .hero-carousel-section .carousel-control-next { opacity: 1; width: 42px; height: 42px; margin: 0 8px; }
}

@media (max-width: 767.98px) {
  body { font-size: 0.97rem; }
  .hero-section { padding: 3.6rem 0 3.2rem; }
  .hero-section h1 { font-size: 2.05rem; }
  .section-padding { padding: 3rem 0; }
  .section-header h2 { font-size: 1.75rem; }
  .stat-number { font-size: 1.95rem; }
  .hero-stats { flex-wrap: wrap; gap: 0.6rem !important; }
  .hero-stats > div { flex: 1 1 30%; padding: 0.75rem 0.5rem; }
  .card-img-top { height: 190px; }
  .hero-carousel-section .carousel-item { height: 52vh !important; min-height: 320px !important; }
  .hero-carousel-section .carousel-indicators { bottom: 14px; }
  .team-image-wrapper, .team-avatar { width: 120px; height: 120px; }
  .team-avatar { font-size: 2.2rem; }
  #emploiContent { padding: 1rem; }
  .pdf-table { min-width: 720px; }
}

@media (max-width: 575.98px) {
  .navbar-brand { font-size: 1.05rem; }
  .navbar-brand img { height: 36px; }
  .hero-section { text-align: center; }
  .hero-section .btn { width: 100%; }
  .hero-section .d-flex { flex-direction: column; }
  .hero-carousel-section .carousel-item { height: 46vh !important; min-height: 280px !important; }
  .carousel-subtitle { display: none; }
  .section-padding { padding: 2.5rem 0; }
  .btn-lg { padding: 0.82rem 1.4rem; font-size: 0.95rem; }
}

/* ============ Impression ============ */
@media print {
  .navbar, .footer, .no-print, .btn-back-to-top, #preloader { display: none !important; }
  body { background: #fff !important; }
  #emploiContent { box-shadow: none; border-radius: 0; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-on-scroll { opacity: 1; transform: none; }
}
