/* ===== Formations : recherche, cartes, fiche ===== */
.metiers-section { padding: 18px 0 70px; }
.page-header p { max-width: 640px; }

/* Barre de recherche à deux champs */
.fsearch { background: var(--white); border: 1px solid var(--border); border-radius: 18px; padding: 16px; margin-bottom: 18px; max-width: 920px; }
.fsearch-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.fsearch-field { flex: 1 1 260px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); }
.fsearch-field input, .ffilters select { font: inherit; font-size: 14px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--white); color: var(--text-dark); min-width: 0; }
.fsearch-field input:focus, .ffilters select:focus { outline: 2px solid var(--terracotta); outline-offset: 1px; }
.fsearch-go { font: inherit; font-size: 14px; font-weight: 500; background: var(--terracotta); color: var(--white); border: 0; border-radius: 12px; padding: 12px 26px; cursor: pointer; }
.fsearch-go:hover { background: var(--terracotta-text); }
.ffilters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.ffilters label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); flex: 1 1 150px; }
.ffilters select { padding: 9px 12px; font-size: 13px; }
.ffilters-apply { font: inherit; font-size: 13px; background: var(--deep); color: var(--white); border: 0; border-radius: 12px; padding: 10px 20px; cursor: pointer; }

.fdomaines { align-items: center; margin-top: 4px; }
.fdomaines-label { font-size: 13px; color: var(--text-muted); margin-right: 4px; }
.ftypes { margin-bottom: 8px; }
.type-tab .count { opacity: .65; font-size: 11px; margin-left: 4px; }
.result-count a { color: var(--terracotta-text); text-decoration: underline; }

/* Liste de résultats */
.formation-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.formation-card { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; transition: border-color .2s; }
.formation-card:hover { border-color: var(--terracotta); }
.formation-main { min-width: 0; }
.formation-card h2 { font-family: 'Poppins', sans-serif; font-size: 19px; font-weight: 600; color: var(--deep); margin: 8px 0 4px; line-height: 1.3; }
.formation-card h2 a:hover { color: var(--terracotta-text); }
.formation-lieu { font-size: 13.5px; color: var(--text-body); }
.formation-chiffres { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
.formation-chiffres strong { color: var(--text-dark); font-weight: 600; }

.formation-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ftag { font-size: 11px; letter-spacing: .02em; padding: 4px 10px; border-radius: 12px; background: var(--terracotta-light); color: var(--terracotta-text); }
.ftag-type { background: var(--sage-light); color: var(--sage-text); font-weight: 500; }
.ftag-soft { background: var(--cream); color: var(--text-body); border: 1px solid var(--border); }
.ftag-warn { background: #FFF1D0; color: #7A5200; }

/* Cœur de favori */
.fav-form { flex-shrink: 0; }
.fav-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer; transition: border-color .2s, color .2s, transform .2s; }
.fav-btn:hover { border-color: var(--terracotta); color: var(--terracotta); transform: scale(1.06); }
.fav-btn.on { background: var(--terracotta-light); border-color: var(--terracotta); color: var(--terracotta); }

.fsource { font-size: 12px; color: var(--text-muted); line-height: 1.6; max-width: 760px; margin-top: 28px; }
.fnote { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin-top: 12px; max-width: 700px; }
.fnote a { color: var(--terracotta-text); text-decoration: underline; }

/* Fiche d'une formation */
.fdetail { padding-top: 34px; padding-bottom: 90px; max-width: 1080px; }
.fil-ariane { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.fil-ariane a:hover { color: var(--terracotta-text); }
.fdetail-head { background: var(--white); border: 1px solid var(--border); border-radius: 20px; padding: 28px; }
.fdetail-head h1 { font-family: 'Poppins', sans-serif; font-size: 30px; font-weight: 600; color: var(--deep); margin: 14px 0 6px; line-height: 1.25; }
.fdetail-etab { font-size: 16px; color: var(--text-dark); font-weight: 500; }
.fdetail-lieu { font-size: 14px; color: var(--text-body); margin-top: 2px; }
.fwarn { margin-top: 14px; font-size: 13px; background: #FFF1D0; color: #7A5200; padding: 10px 14px; border-radius: 10px; }
.fdetail-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.btn-fav { font: inherit; font-size: 13px; padding: 10px 22px; border-radius: 24px; border: 1px solid var(--terracotta); background: var(--terracotta); color: var(--white); cursor: pointer; }
.btn-fav.on { background: var(--terracotta-light); color: var(--terracotta-text); }
.fdetail-bloc { margin-top: 28px; }
.fdetail-bloc h2 { font-family: 'Poppins', sans-serif; font-size: 21px; font-weight: 600; color: var(--deep); margin-bottom: 14px; }
.fkeys { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fkey { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.fkey strong { font-family: 'Poppins', sans-serif; font-size: 28px; font-weight: 600; color: var(--deep); }
.fkey span { font-size: 12.5px; color: var(--text-muted); }
.finfos { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 6px 20px; }
.finfos > div { display: flex; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.finfos > div:last-child { border-bottom: 0; }
.finfos dt { flex: 0 0 120px; color: var(--text-muted); }
.finfos dd { color: var(--text-dark); min-width: 0; }
.muted { color: var(--text-muted); }
.flinks { list-style: none; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 6px 20px; }
.flinks li { padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.flinks li:last-child { border-bottom: 0; }
.flinks a { color: var(--deep); font-weight: 500; }
.flinks a:hover { color: var(--terracotta-text); }

@media (max-width: 600px) {
  .fsearch { padding: 12px; }
  .fsearch-go { width: 100%; }
  .formation-card { padding: 16px; }
  .fdetail-head { padding: 22px 18px; }
  .fdetail-head h1 { font-size: 25px; }
  .finfos > div { flex-direction: column; gap: 2px; }
  .finfos dt { flex: none; }
}

/* Sur la fiche d'une formation, l'en-tête du site reste à sa place (il ne suit pas le défilement). */
body:has(.fdetail) header { position: static; }


/* =========================================================
   Écoles : cartes illustrées + bandeau de favoris
   ========================================================= */
.formation-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.formation-list .empty-state { grid-column: 1 / -1; }
.formation-card { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; overflow: hidden; gap: 0; }
.fc-banner { position: relative; height: 112px; display: flex; align-items: flex-end; padding: 14px 16px; background: var(--fc-bg, #ECEBFF); }
.fc-banner .ftag-type { position: relative; z-index: 1; background: rgba(255,255,255,.85); }
.fc-init { position: absolute; right: 16px; top: 12px; font: 800 52px/1 'Poppins', sans-serif; letter-spacing: -0.04em; color: var(--fc-fg, #5B4DF5); opacity: .85; }
.fc-banner .fav-form { position: absolute; left: 14px; top: 12px; z-index: 2; }
.fc-banner .fav-btn { background: rgba(255,255,255,.9); }
.fc-t0 { --fc-bg: #ECEBFF; --fc-fg: #5B4DF5; } .fc-t1 { --fc-bg: #FFF1D3; --fc-fg: #D98A00; } .fc-t2 { --fc-bg: #E3F7EE; --fc-fg: #1E9E6A; }
.fc-t3 { --fc-bg: #FFE6EE; --fc-fg: #E0457B; } .fc-t4 { --fc-bg: #E5EEFF; --fc-fg: #2F6FE0; } .fc-t5 { --fc-bg: #F3E8FF; --fc-fg: #9333EA; }
.formation-card .formation-main { padding: 16px 20px 20px; }
.formation-card h2 { font-size: 17px; }

.fav-strip { background: var(--degrade); color: var(--white); border-radius: 28px; padding: 18px 22px; margin-bottom: 20px; box-shadow: var(--ombre-forte); }
.fav-strip-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 14px; }
.fav-strip-head a { color: var(--white); font-weight: 600; text-decoration: underline; }
.fav-strip-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.fav-strip-items a { background: rgba(255,255,255,.16); border-radius: 16px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fav-strip-items b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-strip-items span { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 960px) { .formation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .formation-list { grid-template-columns: minmax(0, 1fr); } }


/* =========================================================
   Fiche école : tableau de bord (anneau, entonnoir, carte, pastille)
   ========================================================= */
.fdetail-head { position: relative; overflow: hidden; background: var(--fc-bg, #ECEBFF); border-color: transparent; border-radius: 32px; padding: 34px 36px; }
.fd-init { position: absolute; right: 28px; top: 14px; font: 800 110px/1 'Poppins', sans-serif; letter-spacing: -0.05em; color: var(--fc-fg, #5B4DF5); opacity: .22; pointer-events: none; }
.fdetail-head > *:not(.fd-init) { position: relative; z-index: 1; }
.fd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.fd-main { min-width: 0; }
.fd-side { position: sticky; top: 24px; background: var(--white); border: 1px solid #EEEDF7; border-radius: 28px; overflow: hidden; box-shadow: var(--ombre); margin-top: 28px; }
.fd-map { height: 170px; position: relative; background:
  linear-gradient(35deg, transparent 46%, #fff 46% 49%, transparent 49%),
  linear-gradient(120deg, transparent 58%, #fff 58% 61%, transparent 61%),
  linear-gradient(90deg, transparent 30%, #FDF3D0 30% 33%, transparent 33%),
  radial-gradient(circle at 75% 25%, #CDE8D6 0 55px, transparent 56px), #E6EEF9; }
.fd-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -80%); font-size: 36px; filter: drop-shadow(0 4px 4px rgba(20,18,58,.25)); }
.fd-where { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--text-body); }
.fd-where strong { font-family: 'Poppins', sans-serif; color: var(--deep); font-size: 15px; }
.fd-where a { color: var(--terracotta-text); font-weight: 600; margin-top: 6px; }
.fd-stats { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; background: var(--white); border: 1px solid #EEEDF7; border-radius: 28px; padding: 24px 26px; margin-bottom: 14px; box-shadow: var(--ombre); }
.fd-ring { --p: 0; width: 140px; height: 140px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--terracotta) calc(var(--p) * 1%), #EEEDF7 0); display: grid; place-items: center; }
.fd-ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fd-ring strong { font: 800 26px 'Poppins', sans-serif; color: var(--deep); }
.fd-ring span { font-size: 11.5px; color: var(--text-muted); }
.fd-funnel { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 12px; }
.fd-bar { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; color: var(--text-body); }
.fd-bar b { font-family: 'Poppins', sans-serif; color: var(--deep); }
.fd-track { height: 12px; border-radius: 999px; background: #EEEDF7; overflow: hidden; }
.fd-track i { display: block; height: 100%; border-radius: 999px; background: var(--degrade); }
.fkey { border-radius: 22px; border-color: #EEEDF7; }
.fd-pill { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 14px; background: var(--deep); color: var(--white); padding: 8px 8px 8px 22px; border-radius: 999px; box-shadow: 0 12px 34px rgba(20,18,58,.35); max-width: calc(100vw - 24px); }
.fd-pill span { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.fd-pill button { border: 0; cursor: pointer; font: 600 14px 'Poppins', sans-serif; padding: 11px 22px; border-radius: 999px; background: var(--terracotta); color: var(--white); white-space: nowrap; }
.fd-pill button.on { background: var(--white); color: var(--terracotta-text); }
@media (max-width: 900px) {
  .fd-layout { grid-template-columns: minmax(0, 1fr); }
  .fd-side { position: static; margin-top: 0; order: -1; }
  .fd-map { height: 120px; }
  .fd-init { font-size: 72px; }
  .fd-bar { grid-template-columns: 96px minmax(0, 1fr) auto; }
}
@media (max-width: 560px) { .fd-pill span { display: none; } .fd-pill { padding: 6px; } }

/* Métiers liés (bas de la fiche formation) */
.fd-metiers { margin: 36px 0 24px; }
.fd-metiers h2 { font-family: 'Poppins', sans-serif; font-size: 22px; color: var(--deep); margin: 0 0 4px; }
.fd-metiers-note { color: var(--text-muted, #6b6b80); font-size: 14px; margin: 0 0 6px; }

/* Carte entière cliquable : le lien du titre couvre toute la carte, le bouton cœur reste au-dessus */
.formation-card { position: relative; cursor: pointer; }
.formation-card h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.formation-card .fav-form { position: relative; z-index: 2; }


/* =========================================================
   Cartes compactes (remplacent les cartes à grand bandeau)
   ========================================================= */
.formation-list { gap: 16px; }
.formation-card { position: relative; flex-direction: row; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 20px; overflow: visible; cursor: pointer; transition: box-shadow .2s, transform .2s, border-color .2s; }
.formation-card:hover { box-shadow: var(--ombre); transform: translateY(-2px); }
.formation-card .fc-init { position: static; flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--fc-bg); color: var(--fc-fg); display: grid; place-items: center; font: 700 17px 'Poppins', sans-serif; letter-spacing: 0; opacity: 1; }
.formation-card .formation-main { padding: 0; min-width: 0; flex: 1; }
.formation-card .ftag-type { display: inline-block; font: 600 11px 'Inter', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--fc-fg); background: var(--fc-bg); padding: 2px 8px; border-radius: 99px; margin-bottom: 6px; }
.formation-card h2 { font-size: 15px; line-height: 1.35; margin: 0 0 3px; padding-right: 34px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.formation-card .formation-lieu { font-size: 12.5px; color: var(--text-muted); margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.formation-quoi { font-size: 12.5px; line-height: 1.45; color: var(--text-body); margin: 0 0 10px; }
.formation-pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
.formation-pastilles span { font-size: 12px; background: var(--cream); border-radius: 99px; padding: 3px 10px; color: var(--text-body); }
.formation-pastilles strong { color: var(--deep); }
.formation-pastilles .pastille-warn { background: #FFF1D3; color: #8a5a00; }
.formation-card .fav-form { position: absolute; top: 12px; right: 12px; z-index: 2; }
.formation-card .fav-btn { width: 32px; height: 32px; font-size: 16px; }
