/**
 * Espace Formateur — interface de l'accueil et de la page session.
 *
 * Reprend la charte du site : rose #e41c5c, orange #FAB22D, navy #1a1a2e,
 * rayons de 5px et panneaux #f7f7f7 déjà utilisés dans style.css.
 */

.ef-app {
  --ef-rose: #e41c5c;
  --ef-orange: #FAB22D;
  --ef-navy: #1a1a2e;
  --ef-bord: #e4e4ea;
  --ef-gris: #6b6b7b;
  --ef-fond: #f7f7f9;
}

/* ---------------------------------------------------------------- En-tête */

.ef-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--ef-bord);
}

.ef-entete h2.ef-titre {
  margin: 0;
  font-size: 1.7em;
  font-weight: 700;
  color: var(--ef-navy);
  line-height: 1.2;
}

.ef-entete .ef-titre::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-top: 7px;
  background: var(--ef-rose);
  border-radius: 2px;
}

.ef-salutation {
  margin: 0;
  color: var(--ef-gris);
  font-size: .95em;
}

.ef-salutation b { color: var(--ef-navy); }

/* -------------------------------------------------------- Barre d'outils */

.ef-outils {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--ef-fond);
  border: 1px solid var(--ef-bord);
  border-radius: 5px;
}

.ef-recherche { position: relative; flex: 1 1 280px; }

.ef-recherche input {
  width: 100%;
  padding: 9px 34px 9px 36px;
  border: 1px solid #d5d5dd;
  border-radius: 5px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b7b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 17px 17px;
  font-size: .95em;
  font-family: inherit;
  color: var(--ef-navy);
  transition: border-color .15s, box-shadow .15s;
}

.ef-recherche input:focus {
  outline: none;
  border-color: var(--ef-rose);
  box-shadow: 0 0 0 3px rgba(228, 28, 92, .12);
}

.ef-recherche input::-webkit-search-cancel-button { cursor: pointer; }

/* Pastilles de filtre : la case à cocher réelle reste accessible mais masquée. */
.ef-filtres { display: flex; flex-wrap: wrap; gap: 8px; }

.ef-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid #d5d5dd;
  border-radius: 999px;
  background: #fff;
  color: #55555f;
  font-size: .89em;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  transition: background-color .15s, border-color .15s, color .15s;
}

.ef-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.ef-chip .ef-pastille {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ef-puce, #bbb);
  flex: none;
}

.ef-chip:hover { border-color: var(--ef-rose); color: var(--ef-rose); }

.ef-chip input:focus-visible + .ef-pastille { outline: 2px solid var(--ef-rose); outline-offset: 2px; }

.ef-chip.est-actif {
  background: var(--ef-puce, var(--ef-rose));
  border-color: var(--ef-puce, var(--ef-rose));
  color: #fff;
}

.ef-chip.est-actif .ef-pastille { background: rgba(255, 255, 255, .85); }

.ef-chip--presentiel { --ef-puce: #e41c5c; }
.ef-chip--mixte      { --ef-puce: #FAB22D; }
.ef-chip--distanciel { --ef-puce: #1a1a2e; }

/* Filtre des sessions inactives : détaché des types par un séparateur, car il
   agit sur une autre dimension (le statut de la session, pas sa modalité). */
.ef-chip--inactives {
  --ef-puce: #8a8a99;
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid #e2e2ea;
  border-radius: 0 999px 999px 0;
}

.ef-chip--inactives .ef-pastille {
  background: transparent;
  border: 2px solid var(--ef-puce);
}

.ef-chip--inactives.est-actif .ef-pastille {
  background: rgba(255, 255, 255, .85);
  border-color: rgba(255, 255, 255, .85);
}

.ef-outils select {
  padding: 9px 12px;
  border: 1px solid #d5d5dd;
  border-radius: 5px;
  background: #fff;
  color: var(--ef-navy);
  font-family: inherit;
  font-size: .92em;
  cursor: pointer;
}

.ef-outils select:focus { outline: none; border-color: var(--ef-rose); }

/* ------------------------------------------------------------- Résultats */

.ef-compteur {
  margin: 0 0 14px;
  color: var(--ef-gris);
  font-size: .88em;
  letter-spacing: .02em;
}

.ef-liste { transition: opacity .15s; }
.ef-liste.est-chargement { opacity: .4; pointer-events: none; }

.ef-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.ef-carte {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--ef-bord);
  border-radius: 5px;
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s;
}

.ef-carte:hover {
  border-color: #d3d3dd;
  box-shadow: 0 6px 18px rgba(26, 26, 46, .09);
}

.ef-carte-entete {
  padding: 14px 16px 12px;
  border-bottom: 1px solid #f0f0f4;
  /* Liseré coloré rappelant le type de formation */
  border-left: 3px solid var(--ef-accent, var(--ef-bord));
}

.ef-carte--presentiel { --ef-accent: #e41c5c; }
.ef-carte--mixte      { --ef-accent: #FAB22D; }
.ef-carte--distanciel { --ef-accent: #1a1a2e; }

.ef-carte-titre {
  margin: 0 0 8px;
  font-size: 1.02em;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ef-navy);
}

.ef-carte-infos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.ef-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ef-accent, #999);
  color: #fff;
  font-size: .72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.5;
}

.ef-badge--neutre { background: #9b9baa; }

.ef-carte-meta { margin: 0; color: var(--ef-gris); font-size: .84em; }

/* Sessions */

.ef-sessions { margin: 0; padding: 0; list-style: none; }
.ef-sessions li { margin: 0; padding: 0; list-style: none; }

.ef-session > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid #f4f4f7;
  color: #3c3c48;
  font-size: .93em;
  text-decoration: none;
  transition: background-color .13s, color .13s, padding-left .13s;
}

.ef-sessions li:last-child > a { border-bottom: none; }

.ef-session > a::after {
  content: "›";
  color: #c3c3ce;
  font-size: 1.35em;
  line-height: 1;
  transition: color .13s, transform .13s;
}

.ef-session > a:hover {
  background: #fdf3f6;
  color: var(--ef-rose);
  padding-left: 20px;
  text-decoration: none;
}

.ef-session > a:hover::after { color: var(--ef-rose); transform: translateX(2px); }

.ef-session-nom { flex: 1; }

.ef-session--inactive > a { color: #9a9aa6; }

.ef-etiquette-inactif {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid #dcdce4;
  border-radius: 3px;
  background: #f4f4f7;
  color: #8b8b98;
  font-size: .76em;
  font-weight: 600;
  white-space: nowrap;
}

/* Repli des sessions surnuméraires (CSS pur, sans JavaScript) */

.ef-pliage { position: absolute; opacity: 0; width: 1px; height: 1px; }

.ef-pliage:not(:checked) ~ .ef-sessions .ef-session--sup { display: none; }

.ef-voir-plus {
  display: block;
  margin: 0;
  padding: 9px 16px;
  border-top: 1px solid #f0f0f4;
  background: #fafafc;
  color: var(--ef-rose, #e41c5c);
  font-size: .85em;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color .13s;
}

.ef-voir-plus:hover { background: #fdf3f6; }

.ef-pliage:not(:checked) ~ .ef-voir-plus .ef-moins,
.ef-pliage:checked ~ .ef-voir-plus .ef-plus { display: none; }

.ef-pliage:focus-visible ~ .ef-voir-plus { outline: 2px solid var(--ef-rose, #e41c5c); outline-offset: -2px; }

/* État vide */

.ef-vide {
  padding: 34px 20px;
  text-align: center;
  background: var(--ef-fond);
  border: 1px dashed #d8d8e0;
  border-radius: 5px;
}

.ef-vide-titre { margin: 0 0 5px; font-weight: 700; color: var(--ef-navy); }
.ef-vide p { margin: 0; color: var(--ef-gris); font-size: .92em; }

/* ------------------------------------------- Page session (formation_ef) */

.lien_retour_ef { margin-bottom: 4px; }

.lien_retour_ef a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--ef-bord, #e4e4ea);
  border-radius: 5px;
  background: #fff;
  color: #55555f;
  font-size: .88em;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s, color .15s, background-color .15s;
}

.lien_retour_ef a::before { content: "‹"; font-size: 1.3em; line-height: 1; }

.lien_retour_ef a:hover {
  border-color: #e41c5c;
  background: #fdf3f6;
  color: #e41c5c;
  text-decoration: none;
}

/* Tableau des stagiaires : le thème force table{display:block}, on conserve
   le défilement horizontal tout en soignant la présentation. */
.table_ef {
  margin-top: 18px !important;
  border: 1px solid #e4e4ea;
  border-radius: 5px;
  background: #fff;
}

.table_ef th {
  background: #f7f7f9 !important;
  border: none !important;
  border-bottom: 2px solid #e4e4ea !important;
  padding: 11px 12px !important;
  color: #1a1a2e;
  font-size: .84em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}

.table_ef td {
  border: none !important;
  border-bottom: 1px solid #f1f1f5 !important;
  padding: 10px 12px !important;
  font-size: .93em;
  vertical-align: middle;
}

.table_ef tr:hover td { background: #fbfbfd; }

.table_ef .nom_tableau_ef { font-weight: 600; color: #1a1a2e; }

/* Boutons de téléchargement de la feuille d'émargement (PDF et Word) */

.bloc_emargement {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.bouton_emargement {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 5px;
  background: #e41c5c;
  color: #fff !important;
  font-size: .93em;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(228, 28, 92, .25);
  transition: background-color .15s, box-shadow .15s, transform .15s;
}

.bouton_emargement::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M7 11l5 5 5-5'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E") no-repeat center / contain;
}

.bouton_emargement:hover {
  background: #c8154f;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(228, 28, 92, .32);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Variante secondaire : le format modifiable, proposé en second choix. */

.bouton_emargement--secondaire {
  background: #fff;
  color: #e41c5c !important;
  border: 1px solid #e41c5c;
  box-shadow: none;
}

.bouton_emargement--secondaire::before {
  /* Icône « document » plutôt que « télécharger », et au rose du bouton. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e41c5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E");
}

.bouton_emargement--secondaire:hover {
  background: #fdeef3;
  color: #c8154f !important;
  border-color: #c8154f;
  box-shadow: none;
}

/* ---------------------------------------------------------- Petits écrans */

@media (max-width: 760px) {
  .ef-outils { flex-direction: column; align-items: stretch; }
  .ef-recherche { flex: 1 1 auto; }
  .ef-outils select { width: 100%; }
  .ef-grille { grid-template-columns: 1fr; }
  .ef-entete h2.ef-titre { font-size: 1.4em; }
}
