/* =========================
   style.css - Fichier complet
   ========================= */

/* ========== VARIABLES GLOBALES ========== */
:root{
  --primary: #030B87;
  --secondary: #6ABDE7;
  --accent: #D51079;
  --light: #ecf0f1;
  --dark: #030B87;
  --success: #2ecc71;
  --header-height: 80px;
  --max-content-width: 1200px;
}

/* ========== RESET / BASE ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
  padding-top: var(--header-height);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  transition: background-color 0.2s ease;
}
.container {
  width: 90%;
  max-width: var(--max-content-width);
  margin: 0 auto;
}

/* ========== PRELOADER ========== */
#preloader{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 99999;
  transition: opacity 0.45s ease, visibility 0.45s ease, transform 0.45s ease;
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}
.preloader-inner{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  background: white;
}
.preloader-logo{
  width: 140px;
  height: auto;
  display: block;
  transform-origin: center;
  will-change: transform;
}
@keyframes logo-float {
  0%   { transform: translateY(0) scale(1) rotate(-3deg); }
  30%  { transform: translateY(-10px) scale(1.06) rotate(3deg); }
  60%  { transform: translateY(-6px) scale(1.03) rotate(-2deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}
.preloader-logo { animation: logo-float 1.8s ease-in-out infinite; }
#preloader.preloader--hidden { opacity: 0; visibility: hidden; transform: scale(0.98); pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .preloader-logo { animation: none; }
  #preloader { transition: none; }
}
body.preloader-open { overflow: hidden; }

/* ========== HEADER (logo + menu) ========== */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 0.7rem 0;
  position: fixed;
  width: 100%;
  height: auto;
  min-height: var(--header-height);
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

/* logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
}
.logo-img {
  width: auto;
  height: calc(var(--header-height) - 14px);
  max-height: 64px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border: 2px solid rgba(255,255,255,0.08);
  background: white;
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text .brand{ font-weight: 700; font-size: clamp(0.9rem, 1.6vw, 1.05rem); color: #fff; letter-spacing: 0.2px; }
.logo-text .tag{ font-size: 0.66rem; color: rgba(255,255,255,0.9); margin-top: 2px; opacity: 0.9; }

/* NAV - desktop */
.main-nav { display: flex; align-items: center; gap: 1rem; }
.desktop-nav{ display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.desktop-nav li { list-style: none; }
.desktop-nav a{
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease, transform 120ms ease;
  display: inline-block;
}
.desktop-nav a::after {
  content: '';
  display: block;
  width: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 220ms ease;
  margin-top: 6px;
}
.desktop-nav a:hover {
  color: var(--dark);
  background: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}
.desktop-nav a:hover::after { width: 100%; }

/* nav toggle (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  position: relative;
  z-index: 10001;
}
.nav-toggle:focus { outline: 3px solid rgba(255,255,255,0.12); outline-offset: 3px; }

/* MOBILE MENU (overlay) */
.mobile-menu {
  display: none;
  position: fixed;
  top: calc(var(--header-height) + 8px);
  right: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 0.8rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  z-index: 9999;
  min-width: 220px;
  transform-origin: top right;
  transition: opacity 160ms ease, transform 160ms ease;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  max-height: calc(100vh - (var(--header-height) + 24px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.mobile-menu ul { list-style: none; padding: 0; margin: 0; display:flex; flex-direction:column; gap:8px; align-items:stretch; }
.mobile-menu a { color: #fff; text-decoration: none; font-weight:600; padding: 10px 14px; display:block; border-radius:8px; }
.mobile-menu a:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* ========== HERO / VIDEO / CAROUSEL ========== */
.hero {
  position: relative;
  height: calc(100vh - var(--header-height));
  min-height: 320px;
  overflow: hidden;
  z-index: 0;
}
.hero-fade { position: relative; width: 100%; height: 100%; }

/* slides */
.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 600ms ease, visibility 0.2s;
  display:flex;
  align-items:center;
  justify-content:center;
  will-change: opacity;
  z-index: 0;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

/* media */
.slide-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: 100%;
  pointer-events: none; /* prevent clicks on underlying images */
}

/* image slides that are logos / centered graphics */
.slide[data-type="image"] .slide-media,
.slide[data-type="image"] img.slide-media,
.slide[data-type="image"] video.slide-media {
  object-fit: contain !important;
  max-height: calc(65vh - var(--header-height));
}

/* overlay (title/cta) */
.slide-overlay{
  position: absolute;
  z-index: 3;
  text-align: center;
  color: #fff;
  padding: 2rem;
  max-width: 900px;
  width: 100%;
  pointer-events: none;
}
.slide-overlay h1{ font-size: 2.6rem; margin-bottom: 0.6rem; text-shadow: 0 6px 18px rgba(0,0,0,0.45); }
.slide-overlay p{ font-size: 1.05rem; margin-bottom: 1rem; text-shadow: 0 6px 14px rgba(0,0,0,0.35); }
.slide-overlay .btn{ pointer-events: auto; }

/* subtle dark gradient to help readability */
.slide::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.18) 10%, rgba(0,0,0,0.45) 60%);
  z-index: 1;
}

/* controls */
.carousel-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0,0,0,0.45);
  color: white;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  backdrop-filter: blur(4px);
}
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-btn:focus { outline: 3px solid rgba(255,255,255,0.12); }

/* indicators */
.carousel-indicators {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display:flex;
  gap:8px;
  z-index: 11;
}
.carousel-indicators button{
  width: 10px; height: 10px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.5); cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.carousel-indicators button[aria-current="true"]{
  background: var(--accent);
  transform: scale(1.25);
}

/* ========== SECTIONS / CARDS / MODAL / FORMS ========== */
section { padding: 5rem 0; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}
.section-title h2:after {
  content: '';
  position: absolute;
  width: 50%;
  height: 3px;
  background: var(--secondary);
  bottom: -10px;
  left: 25%;
}

/* formation cards */
.formation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.07);
  transition: transform 0.32s, box-shadow 0.32s;
}
.card:hover { transform: translateY(-10px); box-shadow: 0 18px 40px rgba(0,0,0,0.12); }
.card-img { height: 200px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-img img { transform: scale(1.08); }
.card-content { padding: 1.5rem; }
.card h3 { color: var(--primary); margin-bottom: 0.5rem; }
.card p { color: #666; margin-bottom: 1rem; }
.card ul { margin: 1rem 0; padding-left: 1.5rem; }
.card ul li { margin-bottom: 0.5rem; }

/* more-content collapse */
.more-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.45s cubic-bezier(.2,.9,.2,1), opacity 0.35s ease;
}
.more-content.open { opacity: 1; }

/* voir plus button */
.btn-see-more {
  margin-top: 10px;
  background: transparent;
  border: 1px dashed var(--primary);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.btn-see-more:focus { outline: 3px solid rgba(3,11,135,0.15); outline-offset: 3px; }

/* modal test */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  width: 92%;
  max-width: 720px;
  max-height: 80vh;
  overflow-y: auto;
}
.close { font-size: 1.5rem; cursor: pointer; }

/* forms */
form { display: grid; gap: 1rem; }
.form-group { display: flex; flex-direction: column; }
label { margin-bottom: 0.5rem; font-weight: 500; }
input, textarea, select {
  padding: 0.8rem;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}

/* ========== FOOTER ========== */
footer {
  background: var(--dark);
  color: white;
  padding: 3rem 0;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.footer-section h3 { margin-bottom: 1.5rem; position: relative; padding-bottom: 0.5rem; }
.footer-section h3:after {
  content: '';
  position: absolute;
  width: 50px;
  height: 2px;
  background: var(--accent);
  bottom: 0;
  left: 0;
}
.contact-info { display: flex; flex-direction: column; gap: 1rem; }
.contact-info div { display: flex; align-items: center; gap: 10px; }
.contact-info i { color: var(--accent); }
.social-links { display: flex; gap: 1rem; margin-top: 1rem; }
.social-links a {
  color: white;
  background: rgba(255,255,255,0.06);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  transition: all 0.25s;
}
.social-links a:hover { background: var(--accent); transform: translateY(-3px); }
.copyright { text-align: center; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.06); }

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

/* titre animé */
.titre-activite {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  background: rgba(240, 240, 240, 0.6);
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.titre-activite:before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 12px;
  background: linear-gradient(270deg, var(--primary), var(--secondary), var(--accent), var(--primary));
  background-size: 600% 600%;
  z-index: -1;
  animation: borderMove 3s linear infinite;
}
@keyframes borderMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.titre-activite:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }

/* focus accessibilité */
a:focus, button:focus { outline: 3px solid rgba(3,11,135,0.12); outline-offset: 2px; }
.btn:focus, .btn-see-more:focus, .mobile-link:focus { box-shadow: 0 0 0 4px rgba(10,120,255,0.08); }

/* ========== BOUTONS GLOBAUX ========== */
button.btn, .btn, input[type="button"].btn, input[type="submit"].btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  text-decoration: none;
  appearance: none;
}
button.btn:hover, .btn:hover, input[type="button"].btn:hover, input[type="submit"].btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  background: #b30d65;
}
button.btn:active, .btn:active { transform: translateY(-1px); }
button.btn[disabled], .btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

/* styles zone résultat */
#result .btn { background: var(--primary); }
#result .btn[aria-pressed="true"] { outline: 3px solid rgba(255,255,255,0.08); }

/* carousel controls style */
.carousel-btn { background: rgba(0,0,0,0.45); color: #fff; border: none; }

/* ensure header above hero */
header { z-index: 1000; margin-bottom: 0; }
.hero { margin-top: 0; padding-top: 0; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .hero h1 { font-size: 2.75rem; }
  .logo-img { width: 48px; height:48px; }
}

@media (max-width: 860px) {
  .container { width: 94%; }
  .header-content { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
  .desktop-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-menu { left: 0; right: 0; top: calc(var(--header-height)); margin: 0 12px; border-radius: 12px; }

  /* hide small tag to save space */
  .logo-text .tag { display: none; }

  /* reduce logo size */
  .logo-img {
    height: calc(var(--header-height) - 18px) !important;
    max-height: 52px !important;
    max-width: 90px;
  }

  /* HERO adjustments to keep carousel behavior on mobile */
  .hero {
    height: calc(55vh - var(--header-height));
    min-height: 220px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .hero-fade { position: relative; height: 100%; }

  .slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 500ms ease, visibility 0.2s;
    display:flex;
    align-items:center;
    justify-content:center;
    z-index: 0;
  }
  .slide.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
  }

  .slide .slide-media { object-fit: cover !important; height: 100%; width: 100%; }

  .slide-overlay { position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%); width: calc(100% - 40px); padding: 1rem; text-align: center; pointer-events: auto; }
  .slide-overlay h1 { font-size: 1.4rem; margin-bottom: .3rem; }
  .slide-overlay p { font-size: 0.95rem; margin-bottom: .6rem; }

  .carousel-btn { display: none; }

  .carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display:flex;
    gap:8px;
    z-index: 11;
  }

  /* other small-screen tweaks */
  .slide-overlay .btn { padding: .5rem .8rem; font-size: .9rem; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  section { padding: 3rem 0; }
  .header-content { padding: 0 8px; }
  .logo-text .brand { font-size: 0.98rem; }
}

@media (max-width: 480px) {
  .logo-img {
    height: calc(var(--header-height) - 20px) !important;
    max-height: 44px !important;
    max-width: 72px;
  }
  .logo-text .brand { font-size: 0.92rem; }
  header { padding: 0.25rem 0; }
  .slide[data-type="image"] .slide-media { max-height: calc(35vh); }
  .slide-overlay { padding: 0.6rem; }
}

/* reduced-motion fallback */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .logo-img { transition: none !important; }
}

/* final safety: ensure body padding equals header height */
body { padding-top: var(--header-height); }

/* ====== Radios pour Mode de formation ====== */
.form-group.radio-group {
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
}

.form-group.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0; /* supprime l’espace vertical par défaut */
  cursor: pointer;
  font-weight: 500;
}

.form-group.radio-group input[type="radio"] {
  accent-color: var(--primary); /* couleur bleue personnalisée */
  width: 18px;
  height: 18px;
  cursor: pointer;
}
