/* ---- Sections & titres génériques ---- */
.section-top{
  padding-top:2rem;}
.section-narrow{
  padding-top:2rem;
  max-width:480px;}
.section-question{
  padding-top:2rem;
  max-width:520px;}

.page-title{
  font-size:clamp(1.5rem,3vw,1.875rem);}
.page-title--tight{
  font-size:clamp(1.5rem,3vw,1.875rem);
  margin-bottom:0.5rem;}
.page-title--centered{
  font-size:clamp(1.5rem,3vw,1.875rem);
  margin-bottom:1.5rem;
  text-align:center;}
.page-subtitle{
  color:var(--black);
  margin-bottom:2rem;}

/* ---- Header row (title + logout) ---- */
.page-header-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:2rem;}
.logout-link{
  font-size:0.85rem;
  text-decoration:underline;
  color:var(--muted);
  white-space:nowrap;}
.header-links{
  display:flex;
  gap:1rem;
  align-items:center;}

/* ---- Auth cards (connexion / inscription / inscription-eleve) ---- */
.auth-card{
  max-width:520px;
  margin:0 auto;
  border-radius:var(--radius-md);
  border:1px solid #ddd8c9;
  padding:2rem;}
.auth-card--wide{
  max-width:440px;
  margin:0 auto;}
.auth-card-inner{
  border:1px solid #ddd8c9;
  border-radius:var(--radius-md);
  padding:2rem;}
.auth-intro{
  text-align:center;
  color:var(--black);
  margin-bottom:1.5rem;
  font-size:0.9rem;}
.auth-switch{
  text-align:center;
  font-size:0.85rem;
  color:var(--black);
  margin-top:1.5rem;}
.auth-switch a{
  text-decoration:underline;}

/* Role selector tabs (connexion.php) */
.role-tabs{
  display:flex;
  gap:6px;
  background:var(--cream);
  padding:4px;
  border-radius:999px;
  margin-bottom:1.5rem;}
.role-tab{
  flex:1;
  padding:8px 0;
  border-radius:999px;
  background:transparent;
  color:var(--black);
  font-size:13px;
  font-weight:500;}
.role-tab.active{
  background:var(--green);
  color:var(--cream);}

/* ---- Form fields (shared: auth pages + compte.php + école's add-formateur form) ---- */
.field{
  margin-bottom:1.1rem;}
.field label{
  display:block;
  font-size:0.85rem;
  font-weight:600;
  margin-bottom:0.4rem;}
.field input,
.field select{
  width:100%;
  padding:0.7rem 0.9rem;
  border-radius:10px;
  border:1px solid #ddd8c9;
  font-family:inherit;
  font-size:0.9rem;
  background:var(--cream);}
.field--code input{
  text-transform:uppercase;
  letter-spacing:2px;}
.field-password{
  position:relative;}
.field-password input{
  padding-right:2.5rem;}
.field-password-toggle{
  position:absolute;
  right:0.7rem;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  background:none;
  padding:0;}
.icon-inline{
  width:16px;
  height:16px;
  vertical-align:-3px;
  display:inline-block;}
.field--nowrap{
  min-width:0;
  margin-bottom:0;}
.field--nowrap label{
  display:block;
  font-size:0.8rem;
  font-weight:600;
  margin-bottom:0.3rem;}
.field--nowrap input{
  padding:0.6rem 0.8rem;
  border-radius:8px;
  border:1px solid #ddd8c9;
  background:var(--cream);
  font-family:inherit;}

.checkbox-row{
  margin-bottom:1.25rem;
  display:flex;
  align-items:flex-start;
  gap:0.6rem;}
.checkbox-row input{
  margin-top:0.2rem;}
.checkbox-row label{
  font-size:0.82rem;
  color:var(--muted);}
.checkbox-row a{
  text-decoration:underline;}

.btn-block{
  width:100%;
  text-align:center;}

/* ---- Inline messages (error / success) ---- */
.msg{
  padding:0.8rem 1rem;
  border-radius:10px;
  font-size:0.85rem;
  margin-bottom:1.25rem;}
.msg--error{
  background:#fbe3e3;
  color:#8a2c2c;}
.msg--success{
  background:#e1f0d8;
  color:#2f5c1a;}

/* ---- Panels (dashboards, compte) ---- */
.panel{
  border-radius:var(--radius-md);
  padding:1.5rem;
  margin-bottom:2rem;}
.panel:last-child{
  margin-bottom:0;}
.panel-title{
  font-size:1.2rem;
  margin-bottom:1rem;}
.panel-title--flush{
  font-size:1.2rem;
  margin-bottom:0;}
.panel-title--small{
  font-size:1.05rem;
  margin-bottom:1rem;}
.panel-title--small-tight{
  font-size:1.05rem;
  margin-bottom:0.5rem;}
.panel-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:1.25rem;}
.panel--tight{
  margin-bottom:1.5rem;}

.page-subtitle--flush{
  color:var(--black);
  margin-bottom:0;}
.page-subtitle--spaced{
  color:var(--black);
  margin-bottom:1rem;}
.form-spaced{
  margin-top:1.5rem;}
.step-hidden{
  display:none;}
.btn-spaced{
  margin-top:0.75rem;}
.page-subtitle--small{
  color:var(--black);
  font-size:0.85rem;
  margin-bottom:0;}
.page-header-row--centered{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:0.75rem;
  margin-bottom:2rem;}
.page-header-row--centered-tight{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:0.6rem;
  margin-bottom:1.5rem;}

.info-banner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  background:var(--cream-soft);
  border-radius:8px;
  margin-bottom:2rem;
  flex-wrap:wrap;
  gap:0.75rem 1.5rem;}
.info-banner .code{
  font-size:1.2rem;
  letter-spacing:2px;}
.info-banner .code--inline{
  font-size:1rem;
  letter-spacing:2px;}
.copy-code-btn{
  display:inline-flex;
  align-items:center;
  gap:0.4rem;
  font-size:0.8rem;
  color:var(--black);
  background:var(--cream);
  padding:0.35rem 0.7rem;
  border-radius:999px;
  margin-left:0.5rem;}
.panel--nested{
  background:var(--cream);
  margin-bottom:1rem;}

/* ---- Stat cards (dashboard école) ---- */
.stat-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1rem;
  margin-bottom:2rem;}
.stat-card{
  max-width:100%;
  background:var(--cream-soft);
  border-radius:8px;
  padding:1rem;}
.stat-card .stat-label{
  color:var(--black);
  font-size:0.85rem;
  margin-bottom:0;}
.stat-card .stat-value{
  font-size:1.6rem;
  font-weight:700;
  margin-top:0;}

.stat-card--yellow{
  background:var(--yellow);}
.stat-card--yellow .stat-label{
  color:#856A0A;}
.stat-card--yellow .stat-value{
  color:#412402;}
.stat-card--green{
  background:var(--green);}
.stat-card--green .stat-label{
  color:#9FE1CB;}
.stat-card--green .stat-value{
  color:var(--cream);}
.stat-card--lavender{
  background:var(--lavender);}
.stat-card--lavender .stat-label{
  color:#3C3489;}
.stat-card--lavender .stat-value{
  color:#26215C;}

.class-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:1rem;}
.class-card{
  background:var(--cream);
  border:0.5px solid #ddd8c9;
  border-radius:var(--radius-md);
  padding:1rem;}

/* ---- Module activation chips (dashboard formateur) ---- */
.module-chips{
  display:flex;
  flex-wrap:wrap;
  gap:1rem;
  margin-bottom:1.25rem;}
.module-chip{
  display:flex;
  align-items:center;
  gap:0.5rem;
  background:var(--cream);
  border-radius:999px;
  padding:0.5rem 1rem;
  font-size:0.88rem;}

/* ---- Data tables (dashboards) ---- */
.data-table{
  width:100%;
  border-collapse:collapse;
  font-size:0.9rem;}
.data-table th{
  text-align:left;
  color:var(--black);
  font-weight:600;
  padding:8px 1.25rem 8px 0;}
.data-table td{
  padding:10px 1.25rem 10px 0;
  border-top:1px solid #ddd8c9;}
.data-table tr.data-table__head-row{
  text-align:left;
  color:var(--black);}

/* ---- Inline form (dashboard école : ajouter un formateur) ---- */
.inline-form{
  display:flex;
  gap:0.75rem;
  flex-wrap:wrap;
  align-items:flex-end;}
.inline-form--spaced{
  display:flex;
  gap:0.75rem;
  flex-wrap:wrap;
  align-items:flex-end;
  margin-bottom:1.25rem;}
.form--inline-block{
  display:inline-block;}
.table-actions{
  display:flex;
  flex-wrap:wrap;
  gap:0.5rem;
  align-items:center;}
.table-actions .cta-btn{
  padding:0.55rem 1.1rem;
  font-size:0.78rem;}

/* ---- Paramètres > Forfait & facturation---- */
.rib-panel{
  background:rgba(0,0,0,0.04);
  border-radius:var(--radius-md);
  padding:1.5rem;
  margin-top:1rem;}
.rib-details{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:0.5rem 1.5rem;
  margin:1rem 0;}
.rib-details dt{
  font-weight:600;
  color:var(--black);}
.rib-details dd{
  margin:0;}

/* ============================================
   Espace élève : avancée / jeu / question
   ============================================ */

/* Avancée : cartes de progression par module */
.module-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:1.25rem;}
.module-progress-card{
  border: 0.5px solid #ddd8c9;
  border-radius:var(--radius-md);
  padding:1.5rem;
  text-align:center;}
.module-progress-card h2{
  font-size:1.05rem;
  margin-bottom:1rem;}

.progress-ring{
  position:relative;
  width:110px;
  height:110px;
  margin:0 auto 1rem;}
.progress-ring-value{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.1rem;
  font-weight:700;
  color:var(--green);}

.stats-row{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:0.5rem 1.5rem;
  margin-bottom:1.25rem;
  font-size:0.9rem;}
.stats-row--top{
  display:flex;
  flex-wrap:wrap;
  gap:0.6rem 1.25rem;
  font-size:0.95rem;}
.stats-row--inline{
  display:flex;
  justify-content:center;
  gap:1.5rem;
  font-size:0.9rem;}

/* Jeu : chemin de paliers */
.path{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1.5rem;
  max-width:320px;
  margin:0 auto;}
.path-node{
  text-align:center;}
.path-node--offset-right{
  margin-left:60px;}
.path-node--offset-left{
  margin-left:-60px;}

.node-circle{
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  text-decoration:none;}
.node-circle--done{
  width:56px;
  height:56px;
  background:var(--green);
  color:var(--cream);
  font-size:1.2rem;}
.node-circle--current{
  width:64px;
  height:64px;
  background:var(--yellow);
  border:3px solid var(--green);
  font-size:1.3rem;}
.node-circle--locked{
  width:56px;
  height:56px;
  background:var(--lavender);
  opacity:0.5;
  font-size:1.2rem;}

.node-label{
  font-size:0.78rem;
  color:var(--black);
  margin-top:0.4rem;
  max-width:110px;
  margin-left:auto;
  margin-right:auto;}

/* Question */
.back-link{
  display:inline-flex;
  align-items:center;
  gap:0.4rem;
  font-size:0.85rem;
  font-weight:600;
  color:var(--green);
  background:var(--yellow);
  padding:0.5rem 0.9rem;
  border-radius:999px;
  text-decoration:none;
  text-transform: uppercase;}

.question-card{
  background:var(--purple);
  color:var(--cream);
  border-radius:var(--radius-md);
  padding:1.75rem;}
.question-eyebrow{
  font-size:0.75rem;
  text-transform:uppercase;
  letter-spacing:1px;
  opacity:0.7;
  margin-bottom:0.75rem;}
.question-text{
  font-size:1.05rem;
  margin-bottom:1.5rem;}

.answers{
  display:flex;
  flex-direction:column;
  gap:0.6rem;}
.answer-btn{
  text-align:left;
  background:rgba(251,250,246,0.1);
  border:1px solid rgba(251,250,246,0.3);
  color:var(--cream);
  border-radius:10px;
  padding:0.7rem 1rem;
  font-size:0.9rem;}
.answer-btn--correcte{
  background:rgba(76,175,80,0.25);
  border-color:rgba(76,175,80,0.6);}
.question-card--stacked{
  margin-bottom:1.25rem;}

.ordre-item{
  display:flex;
  align-items:center;
  gap:0.75rem;}
.ordre-badge{
  display:flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  flex-shrink:0;
  border-radius:50%;
  border:1.5px solid rgba(251,250,246,0.4);
  font-size:0.8rem;
  font-weight:600;}
.ordre-item--selected{
  background:rgba(252,238,168,0.18);
  border-color:var(--yellow);}
.ordre-item--selected .ordre-badge{
  background:var(--yellow);
  color:var(--purple);
  border-color:var(--yellow);}
.ordre-actions{
  display:flex;
  flex-wrap:wrap;
  gap:0.75rem;
  margin-top:1.25rem;}

/* ---- Paramètres du compte (onglets latéraux + panneau de contenu) ---- */
.settings-shell{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:1.5rem;
  align-items:start;}
.settings-tabs{
  display:flex;
  flex-direction:column;
  border-radius:var(--radius-md);
  padding:0.5rem;
  gap:0.25rem;}
.settings-tab{
  display:flex;
  align-items:center;
  gap:0.6rem;
  padding:0.7rem 0.9rem;
  border-radius:8px;
  font-size:0.9rem;
  text-align:left;
  background:transparent;
  color:var(--black);
  width:100%;}
.settings-tab.active{
  background:var(--green);
  color:var(--cream);}
.settings-panel{
  display:none;}
.settings-panel.active{
  display:block;}
.settings-content{
  border-radius:var(--radius-md);
  padding:1.75rem;}
.settings-content h2{
  font-size:1.1rem;
  margin-bottom:1.25rem;}
.settings-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:1rem;}
.danger-zone{
  border:1px solid #f0b8b8;
  border-radius:var(--radius-md);
  padding:1.25rem;
  margin-top:1rem;}
.danger-zone p{
  font-size:0.85rem;
  color:var(--black);
  margin-bottom:0.75rem;}

/* ---- Barre latérale de l'espace connecté (formateur/école) ---- */
.app-shell{
  display:flex;
  align-items:flex-start;
  gap:0;
  max-width:1200px;
  margin:0;}
.app-sidebar{
  width:220px;
  flex-shrink:0;
  background:var(--purple);
  color:var(--cream);
  min-height:calc(100vh - 90px);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:1.5rem 1rem;
  position:sticky;
  top:90px;
  align-self:flex-start;}
.app-sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:0.4rem;}
.app-sidebar-link{
  display:flex;
  align-items:center;
  gap:0.7rem;
  padding:0.7rem 0.9rem;
  border-radius:10px;
  font-size:0.9rem;
  color:rgba(251,250,246,0.75);}
.app-sidebar-link.active{
  background:rgba(251,250,246,0.12);
  color:var(--cream);}
.app-sidebar-link--logout{
  border-top:1px solid rgba(251,250,246,0.15);
  padding-top:1.25rem;
  margin-top:1.25rem;
  color:rgba(251,250,246,0.75);}
.app-main{
  flex:1;
  min-width:0;}
.app-main .container{
  margin:0 auto;}

/* Variante élève */
.app-sidebar--eleve{
  width:220px;
  flex-shrink:0;
  background:var(--purple);
  color:var(--cream);
  min-height:calc(100vh - 90px);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:1.5rem 1rem;
  position:sticky;
  top:90px;
  align-self:flex-start;}

/* ---- Forfaits colonnes ---- */

    .forfait-columns{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:1rem;
  margin-bottom:1.25rem;}
.forfait-column{
  background:var(--cream);
  border:1px solid var(--cream-soft);
  border-radius:var(--radius-md);
  padding:1.25rem;
  display:flex;
  flex-direction:column;
  gap:0.6rem;}
.forfait-column-title{
  font-size:1rem;
  font-weight:700;
  text-align:center;
  margin-bottom:0.25rem;}

/* ---- Responsive ---- */
@media (max-width:740px){
  .path-node--offset-right,
  .path-node--offset-left{
    margin-left:0;}
  .stat-grid{
    grid-template-columns:1fr;}
  .settings-shell{
    grid-template-columns:1fr;}
  .settings-tabs{
    flex-direction:row;
    overflow-x:auto;}
  .settings-row{
    grid-template-columns:1fr;}
  .app-shell{
    flex-direction:column;}
  .app-main{
    width:100%;
    max-width:100%;}
  .app-sidebar-label{
    display:none;}
  .app-sidebar{
    position:sticky;
    top:0;
    z-index:35;
    width:100%;
    min-height:auto;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    padding:0.75rem 1rem;}
  .app-sidebar-nav{
    flex-direction:row;}
  .app-sidebar-link{
    padding:0.6rem;
    justify-content:center;}
  .app-sidebar-link--logout{
    border-top:none;
    border-left:1px solid rgba(251,250,246,0.15);
    padding-top:0.6rem;
    margin-top:0;
    padding-left:1rem;}

  .app-sidebar--eleve{
    position:fixed;
    top:auto;
    bottom:0;
    left:0;
    right:0;
    width:100%;
    min-height:auto;
    flex-direction:row;
    align-items:center;
    justify-content:space-around;
    padding:0.6rem 1rem;
    z-index:30;}
  .app-sidebar--eleve .app-sidebar-nav{
    flex-direction:row;
    gap:0.25rem;}
  .app-sidebar--eleve .app-sidebar-link--logout{
    border:none;
    padding:0.7rem 0.9rem;
    margin:0;}

  .panel{overflow-x:auto;}
  .data-table{min-width:480px;}

  .ordre-actions{
    flex-direction:column-reverse;}
  .ordre-actions .cta-btn{
    width:100%;
    text-align:center;}
    .forfait-columns{
  grid-template-columns:1fr;}
}

.vie-timer{
  font-size:0.75rem;
  color:var(--black);
  background:rgba(0,0,0,0.06);
  padding:0.2rem 0.55rem;
  border-radius:999px;
  white-space:nowrap;}

/* ---- Renommer une classe (bloc repliable dans chaque carte de classe) ---- */
.rename-class{
  margin-bottom:1.25rem;}
.rename-class summary{
  cursor:pointer;
  font-size:0.85rem;
  color:var(--black);
  text-decoration:underline;
  width:fit-content;}
.rename-class-form{
  margin-top:0.75rem;}


  .chip-form{
  display:contents;}

