.formation-hero { min-height: calc(clamp(470px, 58vh, 620px) + var(--header-height)); padding-block: calc(76px + var(--header-height)) 64px; text-align: left; background-image: radial-gradient(circle at 82% 30%, rgba(11,143,199,.26), transparent 28%), linear-gradient(104deg, rgba(7,21,33,.97) 15%, rgba(11,54,79,.83) 70%, rgba(7,21,33,.76)), url('../assets/banner-formations.jpg'); background-position: center; }
.formation-hero .hero-overlay { width: min(1180px, 100%); max-width: none; }
.formation-hero h1 { max-width: 900px; margin-bottom: 20px; font-size: clamp(2.7rem, 6vw, 5.4rem); }
.formation-hero h2 { margin-bottom: 14px; }
.formation-hero .formation-hero-text { max-width: 720px; margin: 0; color: rgba(255,255,255,.78); font-size: 1.08rem; }

.formation-page { padding: 0 24px 96px; background: linear-gradient(180deg, #eef4f7 0, var(--surface-soft) 340px); }
.support-overview { width: min(1180px, 100%); margin: 0 auto; padding: 84px 0 34px; }
.support-overview-heading { max-width: 820px; margin-bottom: 34px; }
.support-overview-heading h2 { margin: 0 0 15px; color: var(--navy-900); font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.08; letter-spacing: -.045em; }
.support-overview-heading > p:last-child { margin: 0; color: var(--muted); font-size: 1.04rem; line-height: 1.75; }
.support-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.support-card { position: relative; display: flex; min-height: 300px; flex-direction: column; padding: 30px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(7,21,33,.06); scroll-margin-top: calc(var(--header-height) + 24px); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.support-card:hover { border-color: #bad9e5; box-shadow: 0 18px 42px rgba(7,21,33,.1); transform: translateY(-3px); }
.support-card-number { position: absolute; top: 19px; right: 24px; color: rgba(11,54,79,.1); font-size: 3.3rem; font-weight: 900; line-height: 1; }
.support-card-kicker { margin: 0 0 24px; color: var(--blue-600); font-size: .72rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.support-card h3 { position: relative; margin: 0 0 13px; color: var(--navy-900); font-size: 1.45rem; line-height: 1.2; }
.support-card > p:not(.support-card-kicker) { position: relative; margin: 0 0 24px; color: var(--muted); line-height: 1.65; }
.support-card > a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; color: var(--blue-600); font-size: .86rem; font-weight: 780; text-decoration: none; }
.support-card > a:hover { color: var(--navy-900); }
.support-card--highlight { background: linear-gradient(145deg, var(--navy-900), var(--navy-800)); border-color: transparent; }
.support-card--highlight .support-card-number { color: rgba(255,255,255,.09); }
.support-card--highlight .support-card-kicker { color: var(--amber-500); }
.support-card--highlight h3 { color: #fff; }
.support-card--highlight > p:not(.support-card-kicker) { color: rgba(255,255,255,.7); }
.support-card--highlight > a { color: var(--amber-500); }
.support-card--highlight > a:hover { color: #fff; }

.formation-intro { width: min(1180px, 100%); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 70px; align-items: end; margin: 0 auto; padding: 54px 0; scroll-margin-top: calc(var(--header-height) + 24px); }
.section-kicker { margin: 0 0 10px; color: var(--blue-600); font-size: .74rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.formation-intro h2 { margin: 0 0 15px; color: var(--navy-900); font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.08; letter-spacing: -.045em; }
.formation-intro-copy > p:last-child { max-width: 700px; margin: 0; color: var(--muted); font-size: 1.04rem; }
.formation-search { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-sm); }
.formation-search label { display: block; margin-bottom: 8px; color: var(--navy-800); font-size: .82rem; font-weight: 760; }
.formation-search-field { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #f7fafb; border: 1px solid #cbd8df; border-radius: 10px; transition: border-color .2s, box-shadow .2s; }
.formation-search-field:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(11,143,199,.11); }
.formation-search-field span { color: var(--blue-600); font-size: 1.4rem; }
.formation-search input { width: 100%; min-height: 46px; padding: 10px 0; color: var(--ink); background: transparent; border: 0; outline: 0; }
.formation-search input::placeholder { color: #84919b; }
#formation-result-count { margin: 7px 2px 0; color: var(--muted); font-size: .74rem; }

.formation-layout { width: min(1180px, 100%); display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; margin: 0 auto; }
.formation-sidebar { position: sticky; top: calc(var(--header-height) + 24px); max-height: calc(100vh - var(--header-height) - 48px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.formation-sidebar-inner { padding: 20px; background: var(--navy-900); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; box-shadow: var(--shadow-sm); }
.formation-sidebar-title { margin: 0 0 12px; color: #fff; font-size: .78rem; font-weight: 820; letter-spacing: .1em; text-transform: uppercase; }
#formation-toc { display: grid; gap: 3px; }
#formation-toc a { position: relative; display: block; padding: 8px 9px 8px 18px; color: rgba(255,255,255,.65); border-radius: 8px; font-size: .78rem; line-height: 1.35; text-decoration: none; transition: color .2s, background .2s; }
#formation-toc a::before { content: ""; position: absolute; left: 7px; top: 50%; width: 4px; height: 4px; background: rgba(255,255,255,.3); border-radius: 50%; transform: translateY(-50%); }
#formation-toc a:hover, #formation-toc a.is-active { color: #fff; background: rgba(255,255,255,.08); }
#formation-toc a.is-active::before { background: var(--amber-500); box-shadow: 0 0 0 3px rgba(242,169,0,.15); }
#formation-toc a.is-hidden { display: none; }
.formation-sidebar-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; padding: 12px; color: var(--navy-950); background: var(--amber-500); border-radius: 9px; font-size: .76rem; font-weight: 780; line-height: 1.3; text-decoration: none; }
.formation-sidebar-cta:hover { color: var(--navy-950); background: #ffc13d; }

.formation-list { min-width: 0; }
.formation-category { position: relative; margin: 0 0 22px; padding: 34px 36px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgba(7,21,33,.065); scroll-margin-top: calc(var(--header-height) + 24px); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.formation-category:hover { border-color: #bad9e5; box-shadow: 0 18px 42px rgba(7,21,33,.1); transform: translateY(-2px); }
.formation-category::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: linear-gradient(180deg, var(--amber-500), var(--blue-500)); }
.formation-category[hidden], .toggle-item[hidden] { display: none; }
.formation-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 23px; }
.formation-index { flex: 0 0 40px; display: grid; place-items: center; width: 40px; height: 40px; color: var(--navy-950); background: var(--amber-500); border-radius: 11px; font-size: .78rem; font-weight: 900; }
.formation-category h3 { margin: 0; color: var(--navy-900); font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: 1.2; letter-spacing: -.025em; }
.formation-category ul { margin: 0; padding: 0; list-style: none; }
.toggle-item { margin-bottom: 9px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 11px; scroll-margin-top: calc(var(--header-height) + 24px); transition: border-color .2s, box-shadow .2s; }
.toggle-item:last-child { margin-bottom: 0; }
.toggle-item:has(.toggle-button[aria-expanded="true"]) { border-color: #a8d4e4; box-shadow: 0 7px 18px rgba(8,120,168,.08); }
.toggle-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 17px; color: var(--ink); background: #fff; border: 0; text-align: left; font-weight: 700; cursor: pointer; transition: color .2s, background .2s; }
.toggle-button:hover, .toggle-button[aria-expanded="true"] { color: var(--blue-600); background: #f3fafc; }
.formation-category mark.search-highlight { padding: 0 .12em; color: inherit; background: linear-gradient(transparent 8%, rgba(242,169,0,.42) 8%, rgba(242,169,0,.42) 92%, transparent 92%); border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.details { max-height: 0; overflow: hidden; padding: 0 17px; color: var(--muted); background: #f8fbfc; line-height: 1.65; transition: max-height .35s ease, padding .35s ease; }
.details.open { max-height: var(--details-height, 520px); padding: 16px 17px 19px; border-top: 1px solid var(--line); }
.arrow { position: relative; flex: 0 0 32px; display: block; width: 32px; height: 32px; overflow: hidden; color: var(--blue-600); background: linear-gradient(145deg, #fff, var(--blue-100)); border: 1px solid #c4e3ee; border-radius: 50%; box-shadow: 0 4px 10px rgba(8,120,168,.1); font-size: 0; transition: transform .28s cubic-bezier(.2,.8,.2,1), color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.arrow::before { content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translate(-34%, -50%) rotate(45deg); }
.arrow::after { content: ""; position: absolute; top: 50%; left: 9px; width: 12px; height: 2px; background: currentColor; border-radius: 2px; transform: translateY(-50%); }
.toggle-button:hover .arrow { color: var(--navy-900); background: #fff; border-color: #91cddd; box-shadow: 0 6px 14px rgba(8,120,168,.16); }
.arrow.open { color: var(--navy-950); background: linear-gradient(145deg, #ffc13d, var(--amber-500)); border-color: var(--amber-500); box-shadow: 0 6px 15px rgba(242,169,0,.24); transform: rotate(90deg); }
.formation-empty { padding: 55px 25px; color: var(--muted); background: #fff; border: 1px dashed #b8c8d1; border-radius: 18px; text-align: center; }
.formation-empty[hidden] { display: none; }
.formation-empty strong { display: block; color: var(--navy-900); font-size: 1.15rem; }
.formation-empty p { margin: 5px 0 0; }
.reveal-ready { opacity: 0; transform: translateY(20px); }
.reveal-ready.is-visible { opacity: 1; transform: translateY(0); transition: opacity .55s ease, transform .55s ease; }

@media (max-width: 980px) {
  .support-grid { grid-template-columns: 1fr 1fr; }
  .support-card--highlight { grid-column: 1 / -1; min-height: 250px; }
  .formation-intro { grid-template-columns: 1fr; gap: 28px; }
  .formation-layout { min-width: 0; display: block; }
  .formation-sidebar, .formation-sidebar-inner { width: 100%; min-width: 0; }
  .formation-sidebar { position: static; max-height: none; margin-bottom: 34px; overflow: visible; }
  #formation-toc { width: 100%; max-width: 100%; min-width: 0; display: flex; gap: 7px; overflow-x: auto; padding: 0 2px 8px; scroll-snap-type: x proximity; scroll-padding-inline: 2px; scrollbar-width: thin; overscroll-behavior-inline: contain; }
  #formation-toc a { flex: 0 0 auto; display: inline-flex; min-height: 44px; align-items: center; padding: 9px 12px; background: rgba(255,255,255,.06); scroll-snap-align: start; }
  #formation-toc a::before { display: none; }
  .formation-sidebar-cta { display: flex; min-height: 48px; margin-top: 12px; }
}
@media (min-width: 701px) and (max-width: 980px) {
  .formation-sidebar { position: sticky; z-index: 20; top: calc(var(--header-height) + 12px); }
}
@media (max-width: 700px) {
  .formation-hero { min-height: calc(450px + var(--header-height)); padding: calc(54px + var(--header-height)) 20px 48px; text-align: center; background-image: radial-gradient(circle at 82% 30%, rgba(11,143,199,.26), transparent 28%), linear-gradient(104deg, rgba(7,21,33,.97) 15%, rgba(11,54,79,.83) 70%, rgba(7,21,33,.76)), url('../assets/mobile/banner-formations-960.webp'); }
  .formation-hero h1 { font-size: clamp(2.45rem, 12vw, 3.75rem); }
  .formation-hero .formation-hero-text { margin-inline: auto; }
  .formation-page { padding-inline: 16px; }
  .support-overview { padding-block: 60px 20px; }
  .support-grid { grid-template-columns: 1fr; }
  .support-card, .support-card--highlight { grid-column: auto; min-height: 0; padding: 25px; }
  .formation-intro { padding-block: 60px 38px; }
  .formation-layout { gap: 22px; }
  .formation-sidebar { margin-bottom: 22px; }
  .formation-sidebar-inner { padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
  .formation-sidebar-title, #formation-toc { display: none !important; }
  .formation-sidebar-cta { width: 100%; min-height: 50px; margin: 0; padding: 14px 16px; }
  .formation-category { padding: 28px 18px 22px; }
  .formation-heading { align-items: flex-start; }
  .formation-index { flex-basis: 35px; width: 35px; height: 35px; }
  .toggle-button { min-height: 52px; padding: 14px; }
  .details.open { padding-inline: 14px; }
}
@media (max-width: 420px) {
  .formation-page { padding-inline: 12px; }
  .formation-category { padding-inline: 15px; }
  .formation-category h3 { font-size: 1.35rem; }
  .toggle-button { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .reveal-ready { opacity: 1; transform: none; } }
