@import url("https://fonts.googleapis.com/css2?family=Epilogue:wght@400;500;600;700&family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

/* ============================================================
   SCF — ESPACE MEMBRE — Design Tokens
   Source : Figma "Espace Membre" (graphiste)
   fileKey vrfWRpTTSkme8HllvwI9D4 — page "Prototypes v.04"
   ------------------------------------------------------------
   Tout est SCOPÉ sous .scf-membre pour ne PAS impacter
   le back-office (thème violet #422ad5 inchangé).
   Appliquer la classe .scf-membre sur le conteneur racine
   des pages de l'espace membre.
   ============================================================ */

.scf-membre {
  /* ---------- Couleurs : Bleu primaire ---------- */
  --em-primary:          #0F63FF;
  --em-primary-light:    #9FC1FF;
  --em-primary-xlight:   #CDDEFF;
  --em-primary-xlight2:  #F0F5FF;

  /* ---------- Couleurs : Bleu marine ---------- */
  --em-navy:             #06228E;
  --em-navy-light:       #B4BDDD;
  --em-navy-xlight:      #E9EBEF;

  /* ---------- Couleurs : Indigo ---------- */
  --em-indigo:           #6A7ABB;
  --em-indigo-xlight:    #E6E9F4;

  /* ---------- Couleurs : Vert menthe (accent) ---------- */
  --em-mint:             #2BD9B5;
  --em-mint-light:       #AAF0E1;
  --em-mint-xlight:      #D6FCF1;
  --em-mint-xlight2:     #F2FDFB;

  /* ---------- Neutres ---------- */
  --em-neutral:          #3B3B3B;
  --em-neutral-light:    #ACACAC;
  --em-neutral-xlight:   #DEDEDE;
  --em-neutral-xlight2:  #FAFAFA;
  --em-white:            #FFFFFF;

  /* ---------- Texte ---------- */
  --em-text:             #172C3D;  /* texte principal (slate foncé) */
  --em-text-soft:        #232326;
  --em-text-muted:       #6A7ABB;  /* texte secondaire (indigo) */

  /* ---------- Dégradés ---------- */
  --em-grad-primary: linear-gradient(215deg, #0F63FF 0%, #B7D0FF 100%);
  --em-grad-navy:    linear-gradient(215deg, #06228E 0%, #9DA7C7 100%);
  --em-grad-indigo:  linear-gradient(215deg, #6A7ABB 0%, #DEDEDE 100%);
  --em-grad-mint:    linear-gradient(227deg, #C6FAEB 11%, #2BD9B5 100%);

  /* ---------- Typographie ---------- */
  --em-font-title: 'Epilogue', system-ui, -apple-system, sans-serif;
  --em-font-body:  'Inter', 'Helvetica Neue', system-ui, -apple-system, sans-serif;

  /* ---------- Rayons ---------- */
  --em-radius-card: 16px;
  --em-radius-btn:  8px;
  --em-radius-input: 8px;
  --em-radius-pill: 9999px;

  /* ---------- Ombres ---------- */
  --em-shadow-200:  0 1px 4px rgba(12, 12, 13, 0.05), 0 1px 4px rgba(12, 12, 13, 0.10);
  --em-shadow-card: 3px 4px 16px rgba(23, 44, 61, 0.05);
  --em-shadow-400:  0 4px 4px -4px rgba(12, 12, 13, 0.05), 0 16px 32px -4px rgba(12, 12, 13, 0.10);

  /* ---------- Base ---------- */
  font-family: var(--em-font-body);
  color: var(--em-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   TYPOGRAPHIE — échelle (Figma "2/Typos & utilisations")
   Titres = Epilogue Medium ; Textes = Inter
   ============================================================ */

.scf-membre .em-hero,
.scf-membre .em-h1,
.scf-membre .em-h2,
.scf-membre .em-h3,
.scf-membre .em-h4 {
  font-family: var(--em-font-title);
  font-weight: 500;            /* Medium */
  color: var(--em-text);
  letter-spacing: -0.02em;
  margin: 0;
}

.scf-membre .em-hero { font-size: 3.875rem; line-height: 1.25; }  /* 62px */
.scf-membre .em-h1   { font-size: 2.875rem; line-height: 1.30; }  /* 46px */
.scf-membre .em-h2   { font-size: 2.125rem; line-height: 1.30; }  /* 34px */
.scf-membre .em-h3   { font-size: 1.50rem;  line-height: 1.35; }  /* 24px */
.scf-membre .em-h4   { font-size: 1.375rem; line-height: 1.30; }  /* 22px */

/* Textes (Inter) */
.scf-membre .em-body      { font-family: var(--em-font-body); font-size: 1rem;     font-weight: 400; line-height: 1.52; }  /* 16 */
.scf-membre .em-body-sm   { font-family: var(--em-font-body); font-size: 0.875rem; font-weight: 400; line-height: 1.55; }  /* 14 */
.scf-membre .em-body-xl   { font-family: var(--em-font-body); font-size: 1.125rem; font-weight: 400; line-height: 1.65; }  /* 18 */
.scf-membre .em-strong    { font-weight: 600; }
.scf-membre .em-tag {
  font-family: var(--em-font-body);
  font-size: 0.75rem;          /* 12 */
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--em-primary);
  text-transform: uppercase;
}

/* ============================================================
   PRIMITIVES — boutons, cartes, champs, avatar
   (base réutilisable ; à affiner écran par écran)
   ============================================================ */

/* --- Boutons --- */
.scf-membre .em-btn {
  font-family: var(--em-font-body);
  font-size: 1.125rem;         /* 18 — Button Large */
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--em-radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.scf-membre .em-btn-primary {
  background-color: var(--em-primary);
  color: var(--em-white);
}
.scf-membre .em-btn-primary:hover { background-color: var(--em-navy); }
.scf-membre .em-btn-primary:disabled { background-color: var(--em-neutral-light); cursor: not-allowed; }

.scf-membre .em-btn-secondary {
  background-color: var(--em-white);
  color: var(--em-primary);
  border-color: var(--em-primary-xlight);
}
.scf-membre .em-btn-secondary:hover { background-color: var(--em-primary-xlight2); }

.scf-membre .em-btn-mint {
  background-color: var(--em-mint);
  color: var(--em-navy);
}
.scf-membre .em-btn-ghost {
  background-color: transparent;
  color: var(--em-text);
}
.scf-membre .em-btn-ghost:hover { background-color: var(--em-neutral-xlight2); }

/* --- Cartes --- */
.scf-membre .em-card {
  background-color: var(--em-white);
  border-radius: var(--em-radius-card);
  box-shadow: var(--em-shadow-card);
  padding: 1.5rem;
}
.scf-membre .em-card-flat {
  background-color: var(--em-white);
  border: 1px solid var(--em-neutral-xlight);
  border-radius: var(--em-radius-card);
  padding: 1.5rem;
}

/* --- Champs de saisie --- */
.scf-membre .em-input,
.scf-membre .em-select,
.scf-membre .em-textarea {
  font-family: var(--em-font-body);
  font-size: 1rem;
  color: var(--em-text);
  background-color: var(--em-white);
  border: 1px solid var(--em-neutral-xlight);
  border-radius: var(--em-radius-input);
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.scf-membre .em-input:focus,
.scf-membre .em-select:focus,
.scf-membre .em-textarea:focus {
  outline: none;
  border-color: var(--em-primary);
  box-shadow: 0 0 0 3px var(--em-primary-xlight);
}
.scf-membre .em-input::placeholder { color: var(--em-neutral-light); }
.scf-membre .em-label {
  font-family: var(--em-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--em-text);
  display: block;
  margin-bottom: 0.375rem;
}

/* --- Avatar à initiales (cf. spec Navigation §3.8) --- */
.scf-membre .em-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--em-radius-pill);
  font-family: var(--em-font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--em-white);
  background-color: var(--em-indigo);   /* couleur par défaut, surchargée dynamiquement */
  text-transform: uppercase;
  user-select: none;
}

/* --- Badges / pills --- */
.scf-membre .em-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--em-radius-pill);
  font-family: var(--em-font-body);
  font-size: 0.75rem;
  font-weight: 600;
}
.scf-membre .em-badge-success { background-color: var(--em-mint-xlight); color: #0B7A63; }
.scf-membre .em-badge-info    { background-color: var(--em-primary-xlight2); color: var(--em-primary); }
.scf-membre .em-badge-muted   { background-color: var(--em-neutral-xlight2); color: var(--em-neutral); }

/* --- Champ mot de passe (label en haut) : ancrer le bouton "œil" dans l'input --- */
.scf-membre bspk:has([data-toggle-password]) { position: relative; }
.scf-membre [data-toggle-password] {
  top: auto;
  bottom: 1px;
  height: 45px;
  color: var(--em-neutral-light);
}
.scf-membre [data-toggle-password]:hover { color: var(--em-primary); }

/* ===== Espace membre - navigation + dashboard (lot Mon compte) ===== */
.scf-membre .em-nav a.em-navlink{color:#5B6B7B;text-decoration:none;padding:6px 10px;border-radius:8px;font-weight:500;white-space:nowrap}
.scf-membre .em-nav a.em-navlink:hover{background:#F0F5FF;color:#0F63FF}
.scf-membre .em-nav a.em-navlink-active{color:#0F63FF;font-weight:600}
.scf-membre .em-quickcard{display:flex;flex-direction:column;gap:6px;background:#fff;border:1px solid #E6EDFB;border-radius:14px;padding:18px;text-decoration:none;height:100%;transition:transform .15s,box-shadow .15s,border-color .15s}
.scf-membre .em-quickcard:hover{border-color:#0F63FF;box-shadow:0 6px 20px rgba(15,99,255,.12);transform:translateY(-2px)}
.scf-membre .em-quickicon{font-size:24px}
.scf-membre .em-quicktitle{font-weight:600;color:#06228E}
.scf-membre .em-quickdesc{font-size:13px;color:#8A98A8}

/* ============================================================
   CHROME — Header / Sidebar navy / Footer  (Espace Membre)
   Éléments de template (hors .scf-membre) mais ce fichier
   n'est chargé que sur le domaine membre -> sélecteurs sûrs.
   Mobile-first : styles de base = mobile, @media min-width = desktop.
   ============================================================ */
header, footer, #SideBarLeft, .em-sidebar, .em-header, .em-footer {
  --em-navy-deep:#0B1A5D;
  --em-font-title:'Epilogue',system-ui,-apple-system,sans-serif;
  --em-font-body:'Inter','Helvetica Neue',system-ui,-apple-system,sans-serif;
}

/* fond applicatif général */
#MainBody { background:#F0F5FF; }
#mainContentParent { background:#F0F5FF; min-width:0; }
/* pages membre : contenu pleine largeur, aligné à gauche, cartes à leur max-width */
.em-page { width:100%; }
.em-page > * { align-self:flex-start; }
/* remplit la zone de contenu (viewport - header - footer) SANS min-h-screen :
   évite le scroll + garde le footer collé en bas, et permet le centrage vertical */
.em-fill { flex:1 1 auto; }

/* ---------- HEADER (barre blanche : logo + retour) ---------- */
header { background:#fff; border-bottom:1px solid #E6EDFB; position:relative; z-index:40; }
.em-header { display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 16px; font-family:var(--em-font-body); }
.em-brand { display:flex; align-items:center; gap:10px; text-decoration:none; }
.em-brand-mark { width:38px; height:38px; border-radius:10px; background:var(--em-navy-deep);
  color:#fff; font-weight:800; font-size:15px; display:flex; align-items:center; justify-content:center;
  font-family:var(--em-font-title); letter-spacing:.5px; flex:0 0 auto; }
.em-brand-name { font-family:var(--em-font-title); font-weight:600; font-size:12px; line-height:1.12;
  color:var(--em-navy-deep); text-transform:uppercase; letter-spacing:.02em; }
.em-header-right { display:flex; align-items:center; gap:10px; }
.em-retour { display:inline-flex; align-items:center; gap:6px; text-decoration:none;
  font-size:14px; font-weight:600; color:#0F63FF; }
.em-retour:hover { color:#06228E; }
.em-burger { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px;
  border:none; background:transparent; cursor:pointer; font-size:22px; color:var(--em-navy-deep); padding:0; }
.em-nav-overlay { display:none; }

/* ---------- SIDEBAR (navy) ---------- */
#SideBarLeft:not(:has(*)) { display:none; }            /* invité = pas de sidebar */
#SideBarLeft:has(.em-side-off) { display:none; }       /* invité (page publique) = pas de sidebar */
.em-sidebar.em-side-off { display:none; }
#SideBarLeft { flex:0 0 auto; z-index:60; }
.em-sidebar { width:262px; align-self:stretch; min-height:100%; background:var(--em-navy-deep);
  display:flex; flex-direction:column; color:#fff; font-family:var(--em-font-body); }
.em-side-user { display:flex; align-items:center; gap:12px; padding:16px;
  border-bottom:.8px solid rgba(255,255,255,.10); }
.em-side-avatar { width:46px; height:46px; border-radius:9999px; background:#2BD9B5; color:#0B214A;
  font-weight:700; font-size:16px; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.em-side-userinfo { display:flex; flex-direction:column; gap:2px; min-width:0; }
.em-side-name { font-weight:600; font-size:15px; line-height:1.2; }
.em-side-num { font-size:12px; opacity:.8; }
.em-side-nav { display:flex; flex-direction:column; gap:3px; padding:16px 12px; flex:1 1 auto; }
.em-side-section { font-size:11px; text-transform:uppercase; letter-spacing:.08em; opacity:.5;
  margin:14px 8px 5px; font-weight:600; }
.em-side-section:first-child { margin-top:0; }
.em-side-link { display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:8px;
  color:rgba(255,255,255,.85); text-decoration:none; font-size:15px; font-weight:500; position:relative;
  transition:background .15s, color .15s; }
.em-side-link .bi { font-size:17px; opacity:.9; }
.em-side-link:hover { background:rgba(255,255,255,.08); color:#fff; }
.em-side-link.em-active { background:rgba(255,255,255,.10); color:#fff; font-weight:600; }
.em-side-link.em-active::before { content:""; position:absolute; left:-12px; top:50%; transform:translateY(-50%);
  width:4px; height:26px; border-radius:0 8px 8px 0; background:#2BD9B5; }
.em-side-bottom { padding:12px; border-top:.8px solid rgba(255,255,255,.10); display:flex;
  flex-direction:column; gap:3px; }
.em-side-logout { color:#FFC9C9; }
.em-side-logout:hover { background:rgba(255,90,90,.16); color:#fff; }

/* ---- menu NATIF dans la sidebar (bloc menu vertical) ---- */
.em-sidebar > bspk[bspk="menu"] { flex:1 1 auto; display:block; }
.em-sidebar .em-side-menu.menu,
.em-sidebar .menu.menu-vertical {
  display:flex; flex-direction:column; justify-content:flex-start; gap:3px;
  padding:16px 12px; width:100%; }
.em-sidebar .menu li { list-style:none; background:transparent; }
.em-sidebar .menu li.active,
.em-sidebar .menu li:hover,
.em-sidebar .menu li:focus { background:transparent; }
.em-sidebar .menu li > a { display:flex; align-items:center; gap:12px; padding:11px 12px;
  border-radius:8px; color:rgba(255,255,255,.85); text-decoration:none; font-size:15px;
  font-weight:500; position:relative; transition:background .15s, color .15s; }
.em-sidebar .menu li > a .bi { font-size:17px; opacity:.9; color:#fff !important; }
.em-sidebar .menu li > a .bi.text-base-content { color:#fff !important; }
.em-sidebar .menu li > a:hover,
.em-sidebar .menu li > a:focus { background:rgba(255,255,255,.08); color:#fff; }
.em-sidebar .menu li.active > a { background:rgba(255,255,255,.12) !important; color:#fff; font-weight:600; }
.em-sidebar .menu li.active > a::before { content:""; position:absolute; left:-12px; top:50%;
  transform:translateY(-50%); width:4px; height:26px; border-radius:0 8px 8px 0; background:#2BD9B5; }

/* ---- STEPS du parcours d'inscription (remplace le menu) ---- */
.em-steps { display:flex; flex-direction:column; gap:4px; padding:20px 12px; }
.em-steps-title { font-size:11px; text-transform:uppercase; letter-spacing:.08em; opacity:.5;
  font-weight:600; margin:0 8px 12px; }
.em-step { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:8px;
  color:rgba(255,255,255,.55); font-size:15px; font-weight:500; }
.em-step-num { width:24px; height:24px; border-radius:50%; border:1.5px solid rgba(255,255,255,.3);
  display:flex; align-items:center; justify-content:center; font-size:13px; flex:0 0 auto; }
.em-step.em-step-active { color:#fff; font-weight:600; }
.em-step.em-step-active .em-step-num { background:#2BD9B5; border-color:#2BD9B5; color:#0B1A5D; font-weight:700; }
.em-step.em-step-done { color:rgba(255,255,255,.85); }
.em-step.em-step-done .em-step-num { background:rgba(255,255,255,.15); border-color:transparent; color:#fff; }

/* lien déconnexion (bloc texte bas) */
.em-sidebar .em-side-bottom { margin-top:auto; }
.em-side-logoutlink { display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:8px;
  color:#FFC9C9; text-decoration:none; font-size:15px; font-weight:500; }
.em-side-logoutlink .bi { font-size:17px; }
.em-side-logoutlink:hover { background:rgba(255,90,90,.16); color:#fff; }

/* ---------- FOOTER ---------- */
footer { background:#fff; border-top:1px solid #E6EDFB; }
.em-footer { padding:18px 16px; display:flex; flex-direction:column; gap:8px; align-items:center;
  text-align:center; font-family:var(--em-font-body); font-size:13px; color:#6A7ABB; }
.em-footer-copy { font-weight:600; color:#06228E; }
.em-footer-links { display:flex; flex-wrap:wrap; gap:6px 18px; justify-content:center; }
.em-footer a { color:#6A7ABB; text-decoration:none; }
.em-footer a:hover { color:#0F63FF; }

/* ---------- MOBILE-FIRST : sidebar en overlay sous lg ---------- */
@media (max-width:1023px){
  #SideBarLeft { position:fixed; top:0; left:0; bottom:0; transform:translateX(-100%);
    transition:transform .25s ease; }
  body.em-nav-open #SideBarLeft { transform:translateX(0); box-shadow:0 0 40px rgba(0,0,0,.40); }
  body.em-nav-open .em-nav-overlay { display:block; position:fixed; inset:0; z-index:55;
    background:rgba(11,26,93,.45); }
}
/* desktop : sidebar fixe dans le flux, burger caché */
@media (min-width:1024px){
  .em-burger { display:none; }
}
/* burger visible seulement si une sidebar existe (= connecté) */
@media (max-width:1023px){
  .em-burger { display:none; }
  body:has(.em-sidebar) .em-burger { display:inline-flex; }  /* invité : masqué par la garde */
  .em-retour .em-retour-text { display:none; }   /* mobile : icône retour seule */
}

/* ---- Barre de boutons FIXE du parcours d'inscription (maquette) ---- */
/* fixe en bas de la zone de contenu (décalée de la sidebar steps sur desktop) */
.em-parcours-actions { position:fixed; bottom:0; left:0; right:0; z-index:30; background:#fff;
  border-top:1px solid #E6EDFB; padding:14px 24px; display:flex; align-items:center;
  justify-content:space-between; gap:16px;
  box-shadow:0 -3px 14px rgba(23,44,61,.06); }
@media (min-width:1024px){
  .em-parcours-actions { left:262px; }   /* largeur de la sidebar steps */
}
.em-parcours-step { font-size:13px; font-weight:600; color:#6A7ABB; letter-spacing:.02em; }
.em-parcours-btns { display:flex; align-items:center; gap:12px; margin-left:auto; }
.em-parcours-actions a { text-decoration:none; }
.em-btn-inline { display:inline-flex; align-items:center; justify-content:center; width:auto;
  padding:11px 30px; border-radius:8px; font-weight:600; font-size:15px; }
.em-btn-inline.em-btn-primary { background:#0F63FF; color:#fff; border:1px solid #0F63FF; }
.em-btn-inline.em-btn-primary:hover { background:#06228E; border-color:#06228E; }
.em-btn-inline.em-btn-outline { background:#fff; color:#0F63FF; border:1px solid #CDDEFF; }
.em-btn-inline.em-btn-outline:hover { border-color:#0F63FF; background:#F0F5FF; }
@media (max-width:640px){
  .em-parcours-actions { padding:12px 16px; }
  .em-parcours-step { display:none; }
  .em-parcours-btns { width:100%; }
  .em-btn-inline { flex:1; padding:12px 16px; }
}

/* ===================================================================
 * Ticket 1299 — Divisions disciplinaires en accordeon (espace membre)
 * Le widget disciplinaire reutilise getDivisionsDisciplinairesWF (HTML
 * 2 colonnes du back-office). custom.js marque chaque input via
 * data-scfdiv="div"|"sub". On reformate ici pour l'espace membre :
 * nom a gauche / controle a droite, compteur "-" et marqueur "└" masques,
 * sous-divisions sur fond indente pour materialiser la hierarchie.
 * Scope .scf-membre => n'affecte PAS le back-office.
 * =================================================================== */
.scf-membre .form-control:has(> label > input[data-scfdiv]) > label{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; width:100%; margin:0; padding:6px 10px;
}
.scf-membre .form-control:has(> label > input[data-scfdiv]) label > span.label-text{
  display:flex; align-items:center; flex:1 1 auto; min-width:0; padding-left:0;
}
.scf-membre .form-control:has(> label > input[data-scfdiv]) label > span.label-text > div{
  width:auto !important; min-width:0 !important;
}
/* Divisions : masquer la colonne compteur ("-" ou nombre de sous-div) */
.scf-membre .form-control:has(input[data-scfdiv="div"]) label span.label-text > div:nth-child(2){
  display:none;
}
/* Sous-divisions : masquer le marqueur "└" (remplace par fond + indentation) */
.scf-membre .form-control:has(input[data-scfdiv="sub"]) label span.label-text > div:first-child{
  display:none;
}
/* Sous-divisions : fond + liseré + indentation = enfants de la division cochee */
.scf-membre .form-control:has(input[data-scfdiv="sub"]){
  background:#EEF2FF; border-left:3px solid #C7D2FE; margin-left:22px;
}
.scf-membre .form-control:has(input[data-scfdiv="sub"]) label span.label-text{
  color:#334155; font-size:.92em;
}
/* Rond radio / case checkbox toujours a droite */
.scf-membre .form-control:has(> label > input[data-scfdiv]) input{
  margin-left:auto; flex:0 0 auto;
}
