/* =====================================================================
   EduLink Learning — V9.4 : gamification (espace étudiant + administration)
   Charte : violet nuit #302044 · lavande #F1EBFC · blanc · texte #17151B / #514466 · bordures #E4DFEA
   Direction « Cahier + Parcours » : cartes sobres, filets, pas d'effets lumineux.
   ===================================================================== */
.gm, .gx { --gm-night:#302044; --gm-lav:#F1EBFC; --gm-white:#FFFFFF; --gm-text:#17151B; --gm-mut:#514466; --gm-line:#E4DFEA; --gm-ok:#126B4E; --gm-ok-bg:#E7F4EE; }
.gm *, .gx * { box-sizing:border-box; }
.ga-svg { display:block; border-radius:50%; flex-shrink:0; max-width:100%; height:auto; }
.gb-svg { display:block; flex-shrink:0; }

/* Carte résumé (tableau de bord) */
.gm-card { display:grid; grid-template-columns:auto minmax(0, 1fr); gap:16px; align-items:center; border:1px solid var(--gm-line); border-radius:18px; padding:16px; background:var(--gm-white); color:var(--gm-text); }
.gm-card .gm-av { width:84px; height:84px; border-radius:50%; border:3px solid var(--gm-lav); box-shadow:0 0 0 1px var(--gm-line); overflow:hidden; }
.gm-card .gm-av .ga-svg { width:100%; height:100%; }
.gm-card h2, .gm-card h3 { margin:0 0 2px; font-size:16px; color:var(--gm-night); }
.gm-lvl { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; font-size:13.5px; color:var(--gm-mut); }
.gm-lvl b { color:var(--gm-night); font-size:15px; }
.gm-bar { height:8px; border-radius:99px; background:var(--gm-lav); overflow:hidden; margin:8px 0 4px; }
.gm-bar i { display:block; height:100%; background:var(--gm-night); border-radius:99px; transition:width .6s ease; }
.gm-next { font-size:13px; color:var(--gm-mut); margin:6px 0 0; line-height:1.45; }
.gm-badges-mini { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.gm-links { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.gm-link { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0 12px; border-radius:10px; border:1px solid var(--gm-line); color:var(--gm-night) !important; font-size:13px; font-weight:600; text-decoration:none; background:var(--gm-white); }
.gm-link:hover { background:var(--gm-lav); }
.gm-link--primary { background:var(--gm-night); border-color:var(--gm-night); color:#fff !important; }
.gm-link--primary:hover { background:#21162F; }
@media (max-width:480px) { .gm-card { grid-template-columns:minmax(0, 1fr); text-align:left; } .gm-card .gm-av { width:72px; height:72px; } }

/* Sections de la page Récompenses */
.gm-section { margin-bottom:18px; }
.gm-kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:10px; margin:12px 0 0; }
.gm-kpis div { border:1px solid var(--gm-line); border-radius:14px; padding:12px 14px; background:var(--gm-white); }
.gm-kpis b { display:block; font-size:20px; color:var(--gm-night); }
.gm-kpis span { font-size:12.5px; color:var(--gm-mut); }
.gm-badges { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:12px; list-style:none; margin:0; padding:0; }
.gm-badge { display:flex; gap:12px; align-items:flex-start; border:1px solid var(--gm-line); border-radius:14px; padding:12px; background:var(--gm-white); }
.gm-badge.is-locked { background:#FBFAFD; }
.gm-badge b { display:block; color:var(--gm-night); font-size:14px; }
.gm-badge p { margin:2px 0 0; font-size:12.5px; color:var(--gm-mut); line-height:1.4; }
.gm-badge .gm-when { font-size:12px; color:var(--gm-ok); font-weight:600; }
.gm-shop { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:12px; list-style:none; margin:0; padding:0; }
.gm-item { display:flex; flex-direction:column; gap:8px; align-items:center; text-align:center; border:1px solid var(--gm-line); border-radius:14px; padding:14px 12px; background:var(--gm-white); }
.gm-item b { color:var(--gm-night); font-size:14px; }
.gm-item p { margin:0; font-size:12.5px; color:var(--gm-mut); line-height:1.4; }
.gm-item .gm-price { font-weight:700; color:var(--gm-night); }
.gm-item form { width:100%; margin-top:auto; }
.gm-tag { display:inline-flex; padding:3px 10px; border-radius:99px; font-size:12px; font-weight:600; background:var(--gm-lav); color:var(--gm-night); }
.gm-tag--ok { background:var(--gm-ok-bg); color:var(--gm-ok); }
body.eu .gm button.gm-btn, .gm button.gm-btn { width:100%; min-height:44px; border-radius:10px; border:1px solid var(--gm-night); background:var(--gm-night); color:#fff; font-weight:600; cursor:pointer; }
body.eu .gm button.gm-btn:hover { background:#21162F; }
body.eu .gm button.gm-btn[disabled] { background:var(--gm-white); color:var(--gm-mut); border-color:var(--gm-line); cursor:not-allowed; }
.gm-hist { width:100%; border-collapse:collapse; font-size:13.5px; }
.gm-hist td, .gm-hist th { padding:8px 6px; border-bottom:1px solid var(--gm-line); text-align:left; }
.gm-hist th { font-size:12px; color:var(--gm-mut); font-weight:600; }
.gm-hist .pos { color:var(--gm-ok); font-weight:700; white-space:nowrap; } .gm-hist .neg { color:#A8261D; font-weight:700; white-space:nowrap; } .gm-hist .nul { color:var(--gm-mut); white-space:nowrap; }

/* Éditeur d'avatar */
.gm-editor { display:grid; grid-template-columns:260px minmax(0, 1fr); gap:20px; align-items:start; }
.gm-preview { position:sticky; top:84px; border:1px solid var(--gm-line); border-radius:18px; padding:18px; background:var(--gm-white); text-align:center; }
.gm-preview .ga-svg { width:200px; height:200px; margin:0 auto 10px; border:4px solid var(--gm-lav); }
.gm-choices { display:grid; grid-template-columns:repeat(auto-fill, minmax(104px, 1fr)); gap:10px; border:0; padding:0; margin:0 0 18px; }
.gm-choices legend { font-weight:700; color:var(--gm-night); margin-bottom:8px; padding:0; font-size:15px; }
.gm-choice { position:relative; display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 6px; border:1.5px solid var(--gm-line); border-radius:14px; background:var(--gm-white); cursor:pointer; font-size:12.5px; color:var(--gm-text); text-align:center; }
.gm-choice input { position:absolute; opacity:0; width:1px; height:1px; }
.gm-choice:has(input:checked) { border-color:var(--gm-night); background:var(--gm-lav); }
.gm-choice:has(input:focus-visible) { outline:3px solid var(--gm-night); outline-offset:2px; }
.gm-choice.is-locked { cursor:not-allowed; opacity:.55; }
.gm-choice .ga-svg { width:64px; height:64px; }
.gm-choice small { color:var(--gm-mut); font-size:11.5px; }
@media (max-width:760px) { .gm-editor { grid-template-columns:minmax(0, 1fr); } .gm-preview { position:static; } .gm-preview .ga-svg { width:150px; height:150px; } }

/* Administration */
.gx-stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:10px; margin:0 0 16px; }
.gx-stats div { border:1px solid #E4DFEA; border-radius:14px; padding:12px 14px; background:#fff; }
.gx-stats b { display:block; font-size:20px; color:#302044; } .gx-stats span { font-size:12.5px; color:#514466; }
.gx-grid3 { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:12px; }
.gx-inline { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.gx-inline input[type=text], .gx-inline input[type=search] { flex:1 1 180px; min-width:0; }
.gx-list { list-style:none; margin:0; padding:0; }
.gx-list li { display:flex; gap:12px; align-items:center; padding:12px 16px; border-bottom:1px solid #E4DFEA; }
.gx-list li > div { flex:1; min-width:0; } .gx-list b { color:#302044; } .gx-list span { display:block; font-size:13px; color:#514466; }
.gx-list .ga-svg { width:48px; height:48px; border:1px solid #E4DFEA; }
.gx-table td, .gx-table th { vertical-align:middle; }

@media (prefers-reduced-motion: reduce) { .gm-bar i { transition:none; } }

/* Carte dans une colonne étroite (tableau de bord du cours) : avatar au-dessus, liens pleine largeur */
.gm-card--etroite { grid-template-columns:minmax(0, 1fr); justify-items:start; }
.gm-card--etroite .gm-av { width:72px; height:72px; }
.gm-card--etroite > div { width:100%; }
.gm-card--etroite .gm-links { flex-direction:column; }
.gm-card--etroite .gm-link { justify-content:center; }

/* ---------- V9.6 : avatars 3D ---------- */
/* En-tête : médaillon cliquable (remplace les initiales quand la gamification est active) */
.eu-avatar.eu-avatar--img { padding:0; background:none; overflow:visible; display:inline-flex; border-radius:50%; text-decoration:none; }
.eu-avatar.eu-avatar--img .ga-svg { width:100%; height:100%; }
.eu-avatar.eu-avatar--img:focus-visible { outline:3px solid #302044; outline-offset:2px; }
/* Commentaires */
.comment-head { display:flex; align-items:center; gap:8px; }
.comment-av { display:inline-flex; width:28px; height:28px; flex-shrink:0; }
.comment-av .ga-svg { width:28px; height:28px; }
/* Galerie de choix : grandes vignettes, sélection marquée par un anneau violet nuit + coche */
.gm-choices--avatars { grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:12px; }
.gm-choice--avatar { padding:12px 8px 10px; font-weight:600; color:var(--gm-night); }
.gm-choice--avatar img { width:88px; height:88px; border-radius:50%; background:#E5DBF7; box-shadow:0 0 0 3px #FFFFFF, 0 0 0 4px var(--gm-line); transition:box-shadow .2s ease, transform .2s ease; }
.gm-choice--avatar:hover img { transform:translateY(-2px); }
.gm-choice--avatar:has(input:checked) img { box-shadow:0 0 0 3px #FFFFFF, 0 0 0 6px var(--gm-night); }
.gm-check { position:absolute; top:8px; inset-inline-end:8px; width:24px; height:24px; border-radius:50%; background:var(--gm-night); color:#fff; display:none; place-items:center; }
.gm-check svg { width:14px; height:14px; stroke:#fff; }
.gm-choice--avatar:has(input:checked) .gm-check { display:grid; }
.gm-preview .ga-svg { box-shadow:0 18px 40px rgba(48,32,68,.14); }
@media (max-width:480px) { .gm-choices--avatars { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; } .gm-choice--avatar img { width:72px; height:72px; } }
@media (prefers-reduced-motion: reduce) { .gm-choice--avatar img { transition:none; } .gm-choice--avatar:hover img { transform:none; } }

/* ---------- V9.7 : avatar pendant l'inscription + éditeur à onglets ---------- */
.ea-page--xl { grid-template-columns:minmax(0, 1fr); }
.ea-page--xl .ea-panel { display:none; }
.ea-page--xl .ea-card { max-width:1120px; }
.ins-steps { list-style:none; display:flex; gap:8px; margin:0 0 6px; padding:0; counter-reset:none; }
.ins-steps li { flex:1; display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:12px; background:#FFFFFF; border:1px solid #E4DFEA; color:#514466; font-size:13px; font-weight:600; min-width:0; }
.ins-steps li .n { width:24px; height:24px; border-radius:50%; display:grid; place-items:center; background:#F1EBFC; color:#302044; font-size:12px; flex-shrink:0; }
.ins-steps li .l { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ins-steps li.is-current { border-color:#302044; color:#302044; background:#F1EBFC; }
.ins-steps li.is-current .n { background:#302044; color:#fff; }
.ins-steps li.is-done .n { background:#126B4E; color:#fff; }
.ins-steps-txt { margin:0 0 16px; font-size:12.5px; color:#514466; }
.gm-editor2 { grid-template-columns:280px minmax(0, 1fr); }
.gm-preview-nom { margin:0 0 6px; font-weight:700; color:#302044; font-size:16px; }
.gm-tabs { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 14px; padding:4px; background:#F1EBFC; border-radius:14px; }
.gm-tabs[hidden] { display:none; }
.gm-tabs button { flex:1 1 auto; min-height:40px; padding:0 14px; border:0; border-radius:10px; background:transparent; color:#514466; font:600 14px/1 inherit; cursor:pointer; }
.gm-tabs button[aria-selected="true"] { background:#FFFFFF; color:#302044; box-shadow:0 2px 6px rgba(48,32,68,.10); }
.gm-tabs button:focus-visible { outline:3px solid #302044; outline-offset:1px; }
.gm-cat-intro { margin:0 0 12px; font-size:13.5px; color:#514466; }
.gm-coiffure { margin:0 0 12px; } .gm-coiffure b { display:block; margin:0 0 6px; color:#302044; font-size:14px; }
.gm-coiffure-liste { display:flex; flex-wrap:wrap; gap:8px; }
.gm-mini { display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px; border:1.5px solid #E4DFEA; border-radius:12px; background:#FFFFFF; cursor:pointer; font-size:12px; color:#17151B; }
.gm-mini img { width:56px; height:56px; border-radius:50%; background:#E5DBF7; }
.gm-mini.is-on { border-color:#302044; background:#F1EBFC; }
.gm-mini:focus-visible { outline:3px solid #302044; outline-offset:2px; }
.gm-couleurs { border:0; padding:0; margin:0 0 18px; display:flex; flex-wrap:wrap; gap:8px; }
.gm-couleurs legend { font-weight:700; color:#302044; margin-bottom:8px; padding:0; font-size:15px; width:100%; }
.gm-couleur { position:relative; display:inline-flex; align-items:center; gap:8px; padding:8px 12px 8px 8px; border:1.5px solid #E4DFEA; border-radius:999px; background:#FFFFFF; cursor:pointer; font-size:13px; }
.gm-couleur input { position:absolute; opacity:0; width:1px; height:1px; }
.gm-couleur .sw { width:22px; height:22px; border-radius:50%; border:1px solid #E4DFEA; }
.gm-couleur .sw--auto { background:conic-gradient(#7A5BA6, #D67D70, #5E8C61, #2F5DA8, #7A5BA6); }
.gm-couleur:has(input:checked) { border-color:#302044; background:#F1EBFC; }
.gm-couleur:has(input:focus-visible) { outline:3px solid #302044; outline-offset:2px; }
.gm-nav { display:flex; align-items:center; gap:10px; margin-top:16px; padding-top:14px; border-top:1px solid #E4DFEA; flex-wrap:wrap; }
.gm-nav-esp { flex:1; }
.gm-nav [hidden] { display:none !important; }
.ins-avatar .ea-btn--ghost { background:#FFFFFF; color:#302044; border:1px solid #E4DFEA; }
@media (max-width:760px) {
  .gm-editor2 { grid-template-columns:minmax(0, 1fr); }
  .gm-editor2 .gm-preview { position:sticky; top:0; z-index:5; display:grid; grid-template-columns:96px minmax(0, 1fr); gap:4px 12px; align-items:center; text-align:start; padding:10px; }
  .gm-editor2 .gm-preview #gm-apercu { grid-row:span 3; } .gm-editor2 .gm-preview .ga-svg { width:96px; height:96px; margin:0; border-width:2px; }
  .gm-editor2 .gm-preview .ec-sub { display:none; }
  .ins-steps li .l { font-size:12px; }
}
/* Boutons de navigation de l'éditeur sur les pages d'inscription (hors espace étudiant) */
.ea .gm-nav .eu-btn, .ea .gm-nav button { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 18px; border-radius:12px; font:600 14px/1 inherit; cursor:pointer; text-decoration:none; }
.ea .gm-nav .eu-btn--ghost { background:#FFFFFF; color:#302044; border:1px solid #E4DFEA; }
.ea .gm-nav .eu-btn--ghost:hover { background:#F1EBFC; }
.ea .gm-nav .eu-btn--primary { background:#302044; color:#FFFFFF; border:1px solid #302044; }
.ea .gm-nav .eu-btn--primary:hover { background:#21162F; }
.ea .gm-nav svg { width:16px; height:16px; }
.ea-top-nav { display:flex; align-items:center; gap:10px; }
@media (max-width:480px) { .ea-top-nav .edu-lang a { min-width:32px; padding:0 5px; } .ea-home span { display:none; } }
@media (max-width:480px) { .ins-steps li { padding:6px 8px; } .ins-steps li .l { white-space:normal; font-size:11.5px; line-height:1.2; } }

/* ---------- V9.8 : filtres de la collection d'avatars ---------- */
.gm-filtres { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px; }
.gm-filtres[hidden] { display:none; }
.gm-filtre { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:0 14px; border-radius:999px; border:1.5px solid #E4DFEA; background:#FFFFFF; color:#514466; font:600 13px/1 inherit; cursor:pointer; }
.gm-filtre span { font-size:11.5px; color:#7D6B88; }
.gm-filtre[aria-pressed="true"] { background:#302044; border-color:#302044; color:#FFFFFF; }
.gm-filtre[aria-pressed="true"] span { color:#D9CCF0; }
.gm-filtre:focus-visible { outline:3px solid #302044; outline-offset:2px; }
.gm-choice--avatar[hidden] { display:none; }
/* Administration des images d'avatars */
.av-admin { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:12px; }
.av-admin .av-cell { border:1px solid #E4DFEA; border-radius:14px; padding:12px; background:#FFFFFF; display:grid; grid-template-columns:64px 1fr; gap:6px 10px; align-items:center; }
.av-admin .av-img { width:64px; height:64px; border-radius:50%; background:#F1EBFC; display:grid; place-items:center; font-weight:700; color:#302044; overflow:hidden; }
.av-admin .av-img img { width:100%; height:100%; }
.av-admin form { grid-column:1 / -1; display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.av-admin input[type=file] { font-size:12px; max-width:100%; }
/* V9.8c : vignettes sans prénom */
.gm-choice--avatar { padding:10px; }
.gm-mini { padding:6px; }
