/**
 * Formulaire d'inscription [ajouter-membre] - nouveau design (2026-11-20).
 *
 * Charte « Administration my·judo » : vert jade + encre, fond « brume »,
 * Fraunces (titres) / DM Sans (texte). Maquette et charte de référence :
 * Projet-JudoMyJudo-Claude/design/admin/ (charte.html, ajouter-membre.html).
 *
 * Contraintes de la page hôte (admin.my-judo.ch, thème Twenty Twenty +
 * Elementor) :
 * - Twenty Twenty fixe html { font-size: 62.5% } : 1rem = 10 px, d'où des
 *   tailles en px ici ;
 * - le thème et le kit Elementor stylent input, select, button, h2/h3, a
 *   (sélecteurs jusqu'à 0,1,1 et chargés APRÈS cette feuille) : toutes les
 *   règles commencent par « body .mji » (0,1,1 + classes) pour passer devant
 *   sans !important ;
 * - css/admin-style.css force certains styles en !important
 *   (.admin-champ-invalide, radios en inline-block) : repris ici quand il
 *   le faut.
 * Polices hébergées dans le plugin (fonts/), pas d'appel à Google.
 */

@font-face {
  font-family: "MJ DM Sans";
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MJ Fraunces";
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

.mji {
  --jade: #0F5D4F; --jade-fonce: #0A4238; --jade-clair: #E3F0EC;
  --lavande: #6E5CE6; --lavande-texte: #5442D2; --lavande-clair: #EEEBFD;
  --encre: #16212B; --ardoise: #55636F; --brume: #F2F5F4; --ligne: #DCE3E1; --ligne-forte: #B9C5C2;
  --succes: #16794C; --succes-fond: #E4F4EC;
  --alerte: #8A5A00; --alerte-fond: #FFF4D6;
  --erreur: #B42318; --erreur-fond: #FDECEA;
  --info: #5442D2; --info-fond: #EEEBFD;
  --c-blanche: #FFFFFF; --c-jaune: #F6D33B; --c-orange: #F39A2B; --c-verte: #3DB46D;
  --c-bleue: #2E6FD8; --c-marron: #8A5A3C; --c-noire: #111111;
  --ombre: 0 1px 2px rgba(22,33,43,.06), 0 8px 24px rgba(22,33,43,.06);
  --focus: 0 0 0 3px rgba(110,92,230,.35);
  --f-titre: "MJ Fraunces", Georgia, serif;
  --f-texte: "MJ DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body .mji {
  background: var(--brume);
  color: var(--encre);
  font-family: var(--f-texte);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: normal;
  text-align: left;
  border-radius: 24px;
  padding: clamp(16px, 3vw, 36px);
  -webkit-font-smoothing: antialiased;
}
body .mji *, body .mji *::before, body .mji *::after { box-sizing: border-box; }
body .mji [hidden] { display: none !important; }
body .mji p { margin: 0; }
body .mji a { color: var(--jade); text-decoration: underline; text-underline-offset: 3px; }
body .mji a:hover { color: var(--jade-fonce); }
body .mji h2, body .mji h3, body .mji h4 {
  margin: 0; color: var(--encre); letter-spacing: -.01em; line-height: 1.15; text-transform: none;
}
body .mji h2 { font-family: var(--f-titre); font-weight: 600; font-size: clamp(26px, 3.6vw, 38px); }
body .mji h3 { font-family: var(--f-titre); font-weight: 600; font-size: 23px; }
body .mji h4 { font-family: var(--f-texte); font-weight: 700; font-size: 17px; letter-spacing: 0; }
body .mji .mji-surtitre { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--jade); }

/* ---------- En-tête du club ---------- */
body .mji .mji-tete { display: flex; gap: 24px; align-items: center; margin-bottom: 28px; }
body .mji .mji-logo {
  flex: none; width: 92px; height: 92px; border-radius: 22px; background: #fff; border: 1px solid var(--ligne);
  display: grid; place-items: center; overflow: hidden; box-shadow: var(--ombre);
}
body .mji .mji-logo img { width: 80%; height: 80%; object-fit: contain; margin: 0; max-width: none; }
body .mji .mji-tete h2 { margin: 6px 0 8px; }
body .mji .mji-lieux { color: var(--ardoise); }
body .mji .mji-reperes { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 14px; color: var(--ardoise); }
body .mji .mji-reperes span { display: inline-flex; gap: 6px; align-items: center; }
body .mji .mji-reperes svg { color: var(--jade); flex: none; }

/* ---------- Disposition : étapes + cartes ---------- */
body .mji .mji-disposition { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
body .mji .mji-etapes { position: sticky; top: 24px; }
body .mji .mji-etapes ol { list-style: none; margin: 0; padding: 0; position: relative; }
body .mji .mji-etapes ol::before { content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 2px; background: var(--ligne); }
body .mji .mji-etapes li { margin: 0; padding: 0; }
body .mji .mji-etapes li a {
  position: relative; display: flex; gap: 12px; align-items: center; padding: 8px 0;
  text-decoration: none; color: var(--ardoise); font-weight: 500; font-size: 15px;
}
body .mji .mji-rond {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brume); border: 2px solid var(--ligne-forte);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ardoise); z-index: 1; transition: all .2s;
}
body .mji .mji-etapes li.faite .mji-rond { background: var(--jade); border-color: var(--jade); color: #fff; }
body .mji .mji-etapes li.active a { color: var(--encre); font-weight: 700; }
body .mji .mji-etapes li.active .mji-rond { background: #fff; border-color: var(--lavande); color: var(--lavande-texte); box-shadow: 0 0 0 4px var(--lavande-clair); }
body .mji .mji-aide-etapes {
  margin-top: 22px; padding: 16px; border-radius: 12px; background: #fff; border: 1px solid var(--ligne);
  font-size: 14px; color: var(--ardoise);
}
body .mji .mji-aide-etapes strong { color: var(--encre); display: block; margin-bottom: 4px; }
body .mji .mji-progression { display: none; }

/* ---------- Cartes ---------- */
body .mji .mji-carte {
  background: #fff; border: 1px solid var(--ligne); border-radius: 18px; box-shadow: var(--ombre);
  padding: clamp(20px, 3.5vw, 32px); scroll-margin-top: 24px;
}
body .mji .mji-carte + .mji-carte { margin-top: 20px; }
body .mji .mji-carte-tete { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
body .mji .mji-num {
  flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--jade-clair); color: var(--jade);
  display: grid; place-items: center; font-weight: 700; font-family: var(--f-titre); font-size: 18px;
}
body .mji .mji-carte-tete p { margin-top: 4px; color: var(--ardoise); font-size: 15px; }
body .mji .mji-separateur { border: 0; border-top: 1px solid var(--ligne); margin: 24px 0; height: 0; background: none; max-width: none; }

/* ---------- Champs ---------- */
body .mji .mji-grille { display: grid; gap: 18px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
body .mji .mji-grille .mji-large { grid-column: 1 / -1; }
body .mji .mji-grille-npa { display: grid; gap: 18px 20px; grid-template-columns: 140px minmax(0, 1fr); }
body .mji .mji-champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
body .mji .mji-champ > label, body .mji .mji-legende {
  display: block; margin: 0; font-weight: 600; font-size: 15px; color: var(--encre); letter-spacing: normal;
}
body .mji .mji-legende { margin-bottom: 10px; }
body .mji .mji-oblig { color: var(--erreur); margin-left: 2px; }
body .mji .mji-facultatif { font-weight: 400; color: var(--ardoise); font-size: 14px; }
body .mji .mji-aide { font-size: 13.5px; color: var(--ardoise); }

body .mji input.mji-saisie, body .mji select.mji-saisie {
  display: block; width: 100%; max-width: none; min-height: 46px; margin: 0; padding: 10px 14px;
  border: 1px solid var(--ligne-forte); border-radius: 8px; background-color: #fff; box-shadow: none;
  font-family: var(--f-texte); font-size: 16px; font-weight: 400; line-height: 1.3; letter-spacing: normal;
  color: var(--encre); transition: border-color .15s, box-shadow .15s;
}
body .mji select.mji-saisie {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2355636F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
body .mji .mji-saisie::placeholder { color: #8B979F; opacity: 1; }
body .mji .mji-saisie:hover { border-color: var(--ardoise); }
body .mji .mji-saisie:focus { outline: none; border-color: var(--lavande); box-shadow: var(--focus); }

/* Validation en direct (js/validation-formulaire.js) : mêmes classes qu'avant */
body .mji .admin-champ-invalide { border-color: var(--erreur) !important; background-color: #FFFBFA; }
body .mji .admin-erreur-champ { display: block; color: var(--erreur); font-size: 13.5px; margin-top: 2px; }
body .mji .mji-carte-choix .admin-erreur-champ,
body .mji .mji-pastille .admin-erreur-champ { display: none; }

/* ---------- Choix en cartes (radio) ---------- */
body .mji .mji-choix { display: grid; gap: 10px; }
body .mji .mji-choix.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body .mji .mji-choix.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body .mji .mji-carte-choix { position: relative; display: block; margin: 0; cursor: pointer; font-weight: 400; }
body .mji .mji-carte-choix input,
body .mji .mji-pastille input,
body .mji .mji-case input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none;
}
body .mji .mji-corps {
  display: flex; gap: 12px; align-items: flex-start; height: 100%;
  padding: 14px 16px; border: 1px solid var(--ligne-forte); border-radius: 12px; background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
body .mji .mji-puce {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--ligne-forte); background: #fff; transition: border-color .15s, box-shadow .15s;
}
body .mji .mji-titre-choix { font-weight: 600; display: block; color: var(--encre); }
body .mji .mji-detail { font-size: 14px; color: var(--ardoise); display: block; margin-top: 2px; }
body .mji .mji-carte-choix:hover .mji-corps { border-color: var(--jade); }
body .mji .mji-carte-choix input:checked + .mji-corps { border-color: var(--jade); background: var(--jade-clair); box-shadow: inset 0 0 0 1px var(--jade); }
body .mji .mji-carte-choix input:checked + .mji-corps .mji-puce { border-color: var(--jade); background: var(--jade); box-shadow: inset 0 0 0 4px #fff; }
body .mji .mji-carte-choix input:focus-visible + .mji-corps { box-shadow: var(--focus); }
body .mji .mji-carte-choix input.admin-champ-invalide + .mji-corps { border-color: var(--erreur); }

/* ---------- Pastilles (radio courts) ---------- */
body .mji .mji-pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
body .mji .mji-pastille { position: relative; display: inline-block; margin: 0; font-weight: 400; }
body .mji .mji-pastille span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--ligne-forte); background: #fff; cursor: pointer; font-weight: 500; font-size: 15px;
  color: var(--encre); transition: all .15s;
}
body .mji .mji-pastille span:hover { border-color: var(--jade); }
body .mji .mji-pastille input:checked + span { background: var(--jade); border-color: var(--jade); color: #fff; }
body .mji .mji-pastille input:focus-visible + span { box-shadow: var(--focus); }
body .mji .mji-pastille input.admin-champ-invalide + span { border-color: var(--erreur); }

/* ---------- Cases à cocher ---------- */
body .mji .mji-case { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 0; font-weight: 400; font-size: 15px; }
body .mji .mji-case + .mji-case { margin-top: 14px; }
body .mji .mji-boite {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px;
  border: 2px solid var(--ligne-forte); background: #fff; display: grid; place-items: center; transition: all .15s;
}
body .mji .mji-boite svg { opacity: 0; }
body .mji .mji-case input:checked + .mji-boite { background: var(--jade); border-color: var(--jade); }
body .mji .mji-case input:checked + .mji-boite svg { opacity: 1; }
body .mji .mji-case input:disabled + .mji-boite { background: var(--ardoise); border-color: var(--ardoise); }
body .mji .mji-case input:focus-visible + .mji-boite { box-shadow: var(--focus); }

/* ---------- Encadrés ---------- */
body .mji .mji-encadre {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--info-fond); color: var(--encre); font-size: 15px;
}
body .mji .mji-encadre svg { flex: none; width: 22px; height: 22px; color: var(--info); }
body .mji .mji-encadre p + p { margin-top: 6px; }
body .mji .mji-encadre.alerte { background: var(--alerte-fond); }
body .mji .mji-encadre.alerte svg { color: var(--alerte); }

/* ---------- Badges, ceintures ---------- */
body .mji .mji-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-family: var(--f-texte); font-size: 12.5px; font-weight: 600; letter-spacing: 0;
  background: var(--brume); color: var(--ardoise); white-space: nowrap; vertical-align: middle;
}
body .mji .mji-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
body .mji .mji-badge.ok { background: var(--succes-fond); color: var(--succes); }
body .mji .mji-ceinture {
  display: inline-block; flex: none; width: 44px; height: 14px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,.18); position: relative; overflow: hidden; background: var(--c-blanche);
}
body .mji .mji-ceinture::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; right: 0; background: var(--deux, transparent); }
body .mji .mji-ceinture.liseret::before { content: ""; position: absolute; top: 0; bottom: 0; left: 60%; width: 4px; background: var(--c-noire); z-index: 1; }

/* ---------- Cours 1 à 3 ---------- */
body .mji .mji-cours { border: 1px solid var(--ligne); border-radius: 12px; padding: 18px; background: #FBFCFC; }
body .mji .mji-cours + .mji-cours { margin-top: 14px; }
body .mji .mji-cours-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
body .mji .mji-cours-tete h4 { display: flex; align-items: center; gap: 10px; }
body .mji .mji-grade-apercu { display: flex; align-items: center; gap: 10px; min-height: 22px; font-size: 14px; color: var(--ardoise); }

/* ---------- Boutons ---------- */
body .mji .mji-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; margin: 0; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font-family: var(--f-texte); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: normal;
  text-transform: none; text-decoration: none; cursor: pointer; box-shadow: none;
  transition: background .15s, border-color .15s, color .15s;
}
body .mji .mji-btn:hover, body .mji .mji-btn:focus { text-decoration: none; }
body .mji .mji-btn:focus-visible { outline: none; box-shadow: var(--focus); }
body .mji .mji-btn-principal { background: var(--jade); color: #fff; }
body .mji .mji-btn-principal:hover { background: var(--jade-fonce); color: #fff; }
body .mji .mji-btn-secondaire { background: #fff; color: var(--jade); border-color: var(--ligne-forte); }
body .mji .mji-btn-secondaire:hover { border-color: var(--jade); color: var(--jade-fonce); background: #fff; }
body .mji .mji-btn-discret { background: transparent; color: var(--jade); padding: 0 10px; min-height: 34px; font-size: 14px; }
body .mji .mji-btn-discret:hover { background: var(--jade-clair); color: var(--jade-fonce); }
body .mji .mji-btn-grand { min-height: 52px; padding: 0 28px; font-size: 16.5px; }
body .mji .mji-ajouter-cours { width: 100%; margin-top: 14px; border-style: dashed; }

/* ---------- Barre d'envoi ---------- */
body .mji .mji-envoi {
  position: sticky; bottom: 0; z-index: 5; margin-top: 24px;
  background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--ligne); border-radius: 18px; box-shadow: 0 -4px 24px rgba(22,33,43,.08);
  padding: 16px 20px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
body .mji .mji-envoi p { font-size: 14px; color: var(--ardoise); max-width: 46ch; }
body .mji .mji-envoi p a { color: var(--ardoise); }

/* Badge reCAPTCHA (fixé en bas à droite de l'écran) : il recouvrait le
   bouton « Envoyer l'inscription » de la barre d'envoi collante. Masqué
   seulement sur les pages du formulaire (:has), la mention et les liens
   Google exigés étant affichés dans la barre d'envoi. visibility et non
   display:none, pour que reCAPTCHA continue de fonctionner. */
body:has(.mji) .grecaptcha-badge { visibility: hidden; }

/* ---------- Inscriptions fermées ---------- */
body .mji .mji-ferme { max-width: 640px; margin: 0 auto; text-align: center; }
body .mji .mji-ferme h3 { margin: 10px 0 12px; }
body .mji .mji-ferme .mji-surtitre { color: var(--alerte); }

/* ---------- Petits écrans ---------- */
@media (max-width: 900px) {
  body .mji .mji-disposition { grid-template-columns: 1fr; }
  body .mji .mji-etapes { display: none; }
  body .mji .mji-progression { display: block; position: sticky; top: 0; z-index: 6; background: var(--brume); padding: 10px 0 12px; margin-bottom: 8px; }
  body .mji .mji-progression .mji-libelle { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
  body .mji .mji-progression .mji-rail { height: 6px; border-radius: 99px; background: var(--ligne); overflow: hidden; }
  body .mji .mji-progression .mji-rail i { display: block; height: 100%; width: 20%; background: var(--jade); border-radius: 99px; transition: width .3s; }
}
@media (max-width: 720px) {
  body .mji { border-radius: 0; padding: 16px; }
  body .mji .mji-grille, body .mji .mji-choix.deux, body .mji .mji-choix.trois { grid-template-columns: 1fr; }
  body .mji .mji-grille-npa { grid-template-columns: 110px minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body .mji .mji-tete { flex-direction: column; align-items: flex-start; gap: 16px; }
  body .mji .mji-logo { width: 72px; height: 72px; border-radius: 18px; }
  body .mji .mji-envoi .mji-btn { width: 100%; }
  body .mji .mji-envoi { padding: 12px 14px; gap: 10px; }
  body .mji .mji-envoi p { font-size: 12.5px; line-height: 1.45; }
}

/* ---------- Fenêtre « champs obligatoires » (js/validation-formulaire.js) ---------- */
.mji-modale-fond {
  position: fixed; inset: 0; background: rgba(22,33,43,.55); z-index: 99999;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.mji-modale {
  background: #fff; border-radius: 18px; padding: 28px; max-width: 420px; width: 100%; text-align: center;
  border-top: 5px solid #B42318; box-shadow: 0 20px 50px rgba(22,33,43,.25);
  font-family: "MJ DM Sans", system-ui, sans-serif; color: #16212B;
}
.mji-modale p { margin: 0 0 20px; font-size: 16px; font-weight: 600; line-height: 1.5; }
.mji-modale button {
  min-height: 44px; padding: 0 24px; border: 0; border-radius: 8px; background: #0F5D4F; color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: normal; cursor: pointer;
}
.mji-modale button:hover { background: #0A4238; text-decoration: none; }
