
/* =========================================================
   VERSION PLUS PROCHE DU VISUEL FOURNI
   ========================================================= */

/* ----- MENU FORMATIONS ----- */
.kb-formation-dropdown {
  position: relative;
}
.kb-formation-mega {
  min-width: 760px;
  padding: 20px;
  border: 1px solid #ece6db;
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(0,0,0,.12);
  background: #fff;
  margin-top: 14px;
}
.kb-formation-menu-head {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #eee8dd;
}
.kb-menu-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: #c6a13d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.kb-formation-menu-head h5 {
  margin-bottom: 6px;
  font-size: 1.12rem;
}
.kb-formation-menu-head p {
  margin: 0;
  color: #8a8a8a;
  font-size: .94rem;
}
.kb-formation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.kb-formation-link {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-decoration: none;
  padding: 14px;
  border: 1px solid #eee7db;
  border-radius: 14px;
  background: #fff;
  transition: .25s ease;
}
.kb-formation-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.06);
  border-color: rgba(198,161,61,.35);
}
.kb-formation-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #c6a13d;
  background: rgba(198,161,61,.12);
}
.kb-formation-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kb-formation-text strong {
  color: #23252a;
  font-size: .97rem;
  line-height: 1.35;
}
.kb-formation-text small {
  color: #898989;
  font-size: .84rem;
}
.kb-formation-menu-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee8dd;
}
.btn-outline-accent-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #c6a13d;
  border-radius: 999px;
  color: #b88f27;
  text-decoration: none;
  font-weight: 600;
  transition: .25s ease;
}
.btn-outline-accent-sm:hover {
  background: #c6a13d;
  color: #fff;
}

@media (min-width: 992px) {
  .navbar .dropdown:hover .dropdown-menu {
    display: block;
  }
}
@media (max-width: 991.98px) {
  .kb-formation-mega {
    min-width: 100%;
    border-radius: 16px;
    padding: 14px;
    box-shadow: none;
  }
  .kb-formation-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- HERO FICHE FORMATION ----- */
.kbf-hero {
  position: relative;
  padding: 64px 0 54px;
  min-height: 440px;
  color: #fff;
  background-image:
    linear-gradient(90deg, rgba(34,37,44,.62) 0%, rgba(34,37,44,.48) 34%, rgba(34,37,44,.26) 100%),
    url('../images/trait/ka1.png');
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
}
.kbf-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(24,26,32,.20) 0%, rgba(24,26,32,.10) 30%, rgba(255,255,255,.10) 100%),
    radial-gradient(circle at top left, rgba(198,161,61,.14), transparent 24%);
  pointer-events: none;
}
.kbf-hero .container {
  position: relative;
  z-index: 2;
}
.kbf-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-size: .84rem;
  color: rgba(255,255,255,.78);
}
.kbf-breadcrumb a {
  color: rgba(255,255,255,.78);
  text-decoration: none;
}
.kbf-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #e8d28c;
  border: 1px solid rgba(198,161,61,.45);
  background: rgba(198,161,61,.14);
}
.kbf-title {
  margin: 16px 0 10px;
  font-size: clamp(2.1rem, 4vw, 3.55rem);
  line-height: 1.03;
  text-transform: uppercase;
  color: #fff;
}
.kbf-desc {
  max-width: 680px;
  margin-bottom: 22px;
  color: rgba(255,255,255,.92);
  line-height: 1.7;
  font-size: .95rem;
}
.kbf-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.kbf-stat {
  min-width: 112px;
  padding: 16px 16px 14px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.05);
}
.kbf-stat strong {
  display: block;
  margin-bottom: 5px;
  color: #e3c56d;
  font-size: 1.42rem;
  font-weight: 800;
}
.kbf-stat span {
  display: block;
  color: rgba(255,255,255,.88);
  font-size: .72rem;
  text-transform: uppercase;
  line-height: 1.35;
  font-weight: 700;
}

/* ----- MAIN SECTION ----- */
.kbf-main {
  padding: 64px 0 36px;
  background: #fbfaf8;
}
.kbf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 320px;
  gap: 42px;
  align-items: start;
}
.kbf-block + .kbf-block {
  margin-top: 54px;
}
.kbf-block h2 {
  margin-bottom: 20px;
  font-size: .95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #22242a;
}

/* ----- LISTE ----- */
.kbf-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kbf-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #ede7dc;
}
.kbf-list li:first-child {
  padding-top: 0;
}
.kbf-list-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #c6a13d;
  background: rgba(198,161,61,.10);
  margin-top: 2px;
  font-size: .72rem;
}
.kbf-list-copy strong {
  display: block;
  margin-bottom: 3px;
  color: #2a2b2f;
  font-size: .9rem;
}
.kbf-list-copy small {
  display: block;
  color: #969696;
  line-height: 1.55;
  font-size: .77rem;
}

/* ----- APPROCHE ----- */
.kbf-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.kbf-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 112px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #efe9de;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.03);
}
.kbf-card-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(198,161,61,.12);
  color: #c6a13d;
  font-size: .9rem;
}
.kbf-card-body h3 {
  margin-bottom: 5px;
  color: #2b2d31;
  font-size: 1rem;
  text-transform: uppercase;
}
.kbf-card-body p {
  margin: 0;
  color: #959595;
  line-height: 1.55;
  font-size: .8rem;
}

/* ----- SIDEBAR ----- */
.kbf-price-card {
  position: sticky;
  top: 104px;
  padding: 24px 22px;
  border-radius: 18px;
  border: 1px solid #e8dfd0;
  background: #fff;
  box-shadow: 0 18px 35px rgba(0,0,0,.08);
}
.kbf-price-media {
  width: 132px;
  height: 132px;
  margin: -78px auto 18px;
  padding: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(198,161,61,.28), rgba(198,161,61,.08));
  box-shadow: 0 18px 30px rgba(0,0,0,.12);
}
.kbf-price-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 4px solid #fff;
}
.kbf-price-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: #c6a13d;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.kbf-price-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 18px;
}
.kbf-price {
  color: #c6a13d;
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1;
}
.kbf-tax {
  color: #989898;
  font-size: .78rem;
}
.kbf-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.kbf-meta li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #eee8de;
}
.kbf-meta span {
  color: #939393;
  font-size: .85rem;
}
.kbf-meta strong {
  color: #23252a;
  font-size: .85rem;
}
.kbf-cert-box {
  padding: 18px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(198,161,61,.22);
  background: rgba(198,161,61,.07);
  text-align: center;
}
.kbf-cert-box i {
  display: inline-block;
  margin-bottom: 8px;
  color: #c6a13d;
}
.kbf-cert-box p {
  margin: 0;
  color: #7f7f7f;
  line-height: 1.55;
  font-size: .78rem;
}
.kbf-btn-primary,
.kbf-btn-secondary {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  margin-top: 10px;
}
.kbf-page-success {
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid rgba(39, 42, 50, 0.08);
  background: rgba(242, 248, 241, 0.96);
  color: #204b2e;
  box-shadow: 0 12px 28px rgba(39, 42, 50, 0.08);
}

/* ----- BAS DE PAGE ----- */
.kbf-bottom-cta {
  padding: 18px 0 72px;
  background: #fbfaf8;
}
.kbf-bottom-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, #c8a23f 0%, #b88f27 100%);
}
.kbf-bottom-copy h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 2rem;
  text-transform: uppercase;
}
.kbf-bottom-copy p {
  margin: 0;
  color: rgba(255,255,255,.92);
  font-size: .9rem;
  max-width: 620px;
}
.kbf-bottom-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.kbf-outline-btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.9);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  font-size: .76rem;
  letter-spacing: .5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .25s ease;
}
.kbf-outline-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* ----- PAGE LISTE FORMATIONS ----- */
.kb-formations-listing {
  padding: 58px 0 72px;
  background: #fbfaf8;
}
.kb-formations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.kb-formation-tile {
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #ece5d9;
  box-shadow: 0 10px 22px rgba(0,0,0,.04);
}
.kb-formation-tile-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: #c6a13d;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.kb-formation-tile h3 {
  margin-bottom: 14px;
  font-size: 1.2rem;
  color: #22242a;
}
.kb-formation-tile ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: #8a8a8a;
}
.kb-formation-tile ul li + li {
  margin-top: 8px;
}
.kb-formation-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid #eee7db;
}
.kb-formation-tile-footer strong {
  color: #b88f27;
}
.kb-formation-tile-footer a {
  text-decoration: none;
  color: #23252a;
  font-weight: 700;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 1199.98px) {
  .kb-formations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 991.98px) {
  .kbf-layout {
    grid-template-columns: 1fr;
  }
  .kbf-price-card {
    position: relative;
    top: 0;
  }
  .kbf-bottom-box {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 767.98px) {
  .kbf-hero {
    padding: 54px 0 42px;
    min-height: auto;
    background-position: center, center;
    background-size: cover, cover;
  }
  .kbf-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kbf-price-media {
    width: 112px;
    height: 112px;
    margin: -64px auto 16px;
  }
  .kbf-cards,
  .kb-formations-grid {
    grid-template-columns: 1fr;
  }
  .kbf-bottom-actions {
    width: 100%;
    flex-direction: column;
  }
  .kbf-outline-btn {
    width: 100%;
  }
}


/* =========================================================
   FIX COMPLET : MEGA MENU FORMATIONS
   À mettre tout à la fin du dernier fichier CSS chargé
========================================================= */

/* Le parent doit permettre au menu de sortir */
.kb-formation-dropdown {
  position: relative;
}

@media (min-width: 992px) {
  #siteHeader,
  #mainNav,
  #mainNav .container,
  #mainNav .container-fluid,
  #mainNav .navbar-collapse,
  #mainNav .navbar-nav,
  #mainNav .nav-item,
  .kb-formation-dropdown {
    overflow: visible !important;
  }

  /* Bloc principal du mega menu */
  .kb-formation-dropdown .kb-formation-mega,
  .kb-formation-dropdown .dropdown-menu.kb-formation-mega {
    position: absolute !important;
    top: calc(100% + 26px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;

    width: min(760px, calc(100vw - 32px));
    min-width: min(760px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);

    margin: 0 !important;
    padding: 28px 30px !important;

    border: 0 !important;
    border-radius: 28px !important;
    background: #ffffff !important;
    box-shadow: 0 28px 70px rgba(18, 24, 32, 0.16) !important;
    z-index: 9999 !important;
  }

  /* Petit espace visuel entre le header et le menu */
  .kb-formation-dropdown .kb-formation-mega::before,
  .kb-formation-dropdown .dropdown-menu.kb-formation-mega::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
  }

  /* En-tête du mega menu */
  .kb-formation-mega .kb-formation-header,
  .kb-formation-mega .mega-header,
  .kb-formation-mega .menu-header {
    margin-bottom: 18px;
  }

  .kb-formation-mega .kb-formation-header h3,
  .kb-formation-mega .mega-header h3,
  .kb-formation-mega .menu-header h3 {
    margin: 0 0 10px 0;
  }

  .kb-formation-mega .kb-formation-header p,
  .kb-formation-mega .mega-header p,
  .kb-formation-mega .menu-header p {
    margin: 0;
  }

  /* Grille des cartes */
  .kb-formation-mega .kb-formation-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px !important;
    margin-top: 18px;
  }

  /* Cartes / liens */
  .kb-formation-mega .kb-formation-link,
  .kb-formation-mega .formation-card,
  .kb-formation-mega .menu-card {
    width: 100%;
    min-height: 98px;
    border-radius: 22px;
  }

  /* Bouton bas de menu */
  .kb-formation-mega .kb-formation-footer,
  .kb-formation-mega .kb-formation-cta,
  .kb-formation-mega .kb-formation-button,
  .kb-formation-mega .mega-footer {
    margin-top: 22px;
  }

  /* Si Bootstrap applique un alignement parasite */
  .kb-formation-dropdown .dropdown-menu-end {
    right: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

@media (max-width: 991.98px) {
  .kb-formation-dropdown .kb-formation-mega,
  .kb-formation-dropdown .dropdown-menu.kb-formation-mega {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;

    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;

    margin-top: 14px !important;
    padding: 20px 18px !important;

    border-radius: 22px !important;
    box-shadow: 0 18px 40px rgba(18, 24, 32, 0.10) !important;
  }

  .kb-formation-mega .kb-formation-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-top: 16px;
  }

  .kb-formation-mega .kb-formation-footer,
  .kb-formation-mega .kb-formation-cta,
  .kb-formation-mega .kb-formation-button,
  .kb-formation-mega .mega-footer {
    margin-top: 18px;
  }
}

/* =========================================================
   CORRECTION : menu plus proche du header + visible بالكامل
========================================================= */

@media (min-width: 992px) {
  .kb-formation-dropdown {
    position: relative;
  }

  .kb-formation-dropdown .kb-formation-mega,
  .kb-formation-dropdown .dropdown-menu.kb-formation-mega {
    position: absolute !important;
    top: calc(100% + 0px) !important; /* plus proche du header */
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;

    width: min(760px, calc(100vw - 32px));
    min-width: min(760px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);

    max-height: calc(100vh - 120px); /* empêche que le menu sorte de l'écran */
    overflow-y: auto;
    overflow-x: hidden;

    margin: 0 !important;
    padding: 22px 24px !important;

    border: 0 !important;
    border-radius: 24px !important;
    background: #fff !important;
    box-shadow: 0 24px 55px rgba(18, 24, 32, 0.14) !important;
    z-index: 9999 !important;
  }

  .kb-formation-mega .kb-formation-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px !important;
    margin-top: 14px;
  }

  .kb-formation-mega .kb-formation-link,
  .kb-formation-mega .formation-card,
  .kb-formation-mega .menu-card {
    min-height: 88px;
  }

  .kb-formation-mega .kb-formation-footer,
  .kb-formation-mega .kb-formation-cta,
  .kb-formation-mega .kb-formation-button,
  .kb-formation-mega .mega-footer {
    margin-top: 16px;
  }
}

@media (max-width: 991.98px) {
  .kb-formation-dropdown .kb-formation-mega,
  .kb-formation-dropdown .dropdown-menu.kb-formation-mega {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;

    max-height: none;
    overflow: visible;

    margin-top: 10px !important;
    padding: 18px 16px !important;
  }

  .kb-formation-mega .kb-formation-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}




.kb-interest-modal .modal-content {
  border: 1px solid var(--border);
  border-radius: 24px;
}

.kb-interest-modal .modal-header,
.kb-interest-modal .modal-body {
  padding: 28px;
}

.kb-interest-modal .modal-header {
  border-bottom: 1px solid var(--border);
}

.kb-interest-modal .modal-title {
  color: var(--primary);
}

.kb-interest-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kb-interest-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.kb-interest-choice:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.kb-interest-choice input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.kb-interest-choice span {
  color: var(--primary);
  font-weight: 500;
  line-height: 1.4;
}

@media (max-width: 767.98px) {
  .kb-interest-choices {
    grid-template-columns: 1fr;
  }

  .kb-interest-modal .modal-header,
  .kb-interest-modal .modal-body {
    padding: 20px;
  }
}


/* === Correctifs menu formations mobile/tablette === */
@media (max-width: 991.98px) {
  .kb-formation-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .kb-formation-dropdown .kb-formation-mega,
  .kb-formation-dropdown .dropdown-menu.kb-formation-mega {
    background: #ffffff !important;
    border: 1px solid rgba(218, 187, 106, 0.20) !important;
    box-shadow: 0 14px 34px rgba(18, 24, 32, 0.08) !important;
  }

  .kb-formation-menu-head {
    padding: 0 0 12px;
    margin-bottom: 12px;
  }

  .kb-formation-menu-head p {
    display: none;
  }

  .kb-formation-link {
    padding: 14px 12px;
    align-items: flex-start;
  }

  .kb-formation-text strong,
  .kb-formation-text small,
  .kb-menu-kicker,
  .kb-formation-menu-head h5,
  .kb-formation-menu-footer a {
    color: #343538 !important;
  }
}
