/* =====================================================================
   BIM-FCS — Portal UI (complement additif a styles.css)
   Definit les composants utilises par index / connexion / elearning /
   formation. Reutilise les variables du theme de styles.css.
   ===================================================================== */

/* ---------- 1. Structure ---------- */
.shell { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar-header {
  padding: 16px 18px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-logo {
  height: 40px; width: auto; max-width: 180px; object-fit: contain;
  background: #fff; padding: 4px 8px; border-radius: 10px;
}

.sidebar-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }

.sidebar-user { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }

.sidebar-user-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 10px; background: rgba(255, 255, 255, .05); text-decoration: none;
}
.sidebar-user-card:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.sidebar-user-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  color: #fff; font-size: .82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role { color: #7c8db0; font-size: .72rem; }

/* ---------- 2. Navigation ---------- */
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: 9px; color: #c3cfe3; font-size: .875rem; margin-bottom: 2px;
  text-decoration: none; transition: background .12s; cursor: pointer;
  background: none; border: 0; width: 100%; font-family: inherit; text-align: left;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(230, 57, 70, .9), rgba(230, 57, 70, .55));
  color: #fff; font-weight: 600;
}
.nav-icon { width: 18px; flex: 0 0 18px; text-align: center; font-size: .95rem; }
.nav-label { flex: 1; }
.nav-chevron { font-size: .7rem; opacity: .7; transition: transform .15s; }
.nav-group-open > .nav-group-toggle .nav-chevron { transform: rotate(180deg); }
.nav-children { display: none; padding-left: 26px; }
.nav-group-open > .nav-children { display: block; }
.nav-child { font-size: .83rem; padding: 7px 11px; }

/* ---------- 3. Topbar ---------- */
.topbar-title { font-size: 1.02rem; margin: 0; font-weight: 650; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; font-size: .95rem; transition: background .15s;
}
.btn-icon:hover { background: var(--surface-2); }

/* ---------- 4. Boutons (alias) ---------- */
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: .79rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- 5. Badges (alias) ---------- */
.badge-success { background: var(--ok-soft); color: var(--ok); }
.badge-qualiopi { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(16,185,129,.35); }
.badge-demo { background: var(--warn-soft); color: var(--warn); }
.badge-locked { background: var(--danger-soft); color: var(--danger); }

/* ---------- 6. Contenus generiques ---------- */
.content h2 { font-size: 1.15rem; margin: 0 0 8px; }
.content h3 { font-size: .95rem; margin: 22px 0 10px; color: var(--ink-2); }
.content > section { margin-bottom: 26px; }

.empty-state {
  text-align: center; padding: 30px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  font-size: .87rem;
}
.empty-state a { color: var(--accent); }

.welcome-section {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(230,57,70,.12), rgba(59,130,246,.10));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px;
}
.welcome-text { flex: 1; min-width: 260px; }
.welcome-text h2 { margin: 0 0 6px; }
.welcome-text p { margin: 0; color: var(--ink-2); font-size: .88rem; line-height: 1.6; }

/* ---------- 7. KPI ---------- */
.kpi-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.kpi-value { font-size: 1.55rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-label { font-size: .76rem; color: var(--muted); margin-top: 4px; }

/* ---------- 8. Cartes info societe ---------- */
.card-header { padding: 0 0 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.card-header h3 { margin: 0; font-size: .92rem; }
.card-body { font-size: .86rem; }

.info-grid { display: grid; gap: 10px 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.info-value { color: var(--ink); font-weight: 500; }
.info-value a { color: var(--accent); }

/* ---------- 9. Acces rapide ---------- */
.quick-access-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.quick-access-card {
  display: flex; flex-direction: column; gap: 3px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; transition: border-color .15s, transform .1s;
}
.quick-access-card:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.qa-icon { font-size: 1.3rem; }
.qa-label { color: var(--ink); font-weight: 650; font-size: .9rem; }
.qa-desc { color: var(--muted); font-size: .76rem; }

/* ---------- 10. Domaines ---------- */
.domains-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.domain-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.domain-card-header {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; color: #fff;
}
.domain-card-header h4 { margin: 0; font-size: .9rem; color: #fff; }
.domain-card-icon { font-size: 1.05rem; }
.domain-card-body { padding: 14px 16px; }
.domain-card-desc { margin: 0 0 10px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.domain-card-count { font-size: .78rem; color: var(--ink-2); margin-bottom: 10px; font-weight: 600; }

/* ---------- 11. Progression ---------- */
.progress-list { display: flex; flex-direction: column; gap: 10px; }
.progress-list-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s;
}
.progress-list-item:hover { border-color: var(--accent); }
.progress-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.progress-list-info strong { color: var(--ink); font-size: .86rem; }
.progress-list-info span { color: var(--muted); font-size: .75rem; }
.progress-bar-track {
  height: 7px; border-radius: 99px; background: var(--line); overflow: hidden;
  width: 160px; flex: 0 0 160px;
}
.progress-bar-track.large { width: 100%; flex: 1; height: 10px; }
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .4s;
}
.progress-percent { font-size: .78rem; font-weight: 700; color: var(--ink); width: 42px; text-align: right; }

/* ---------- 12. Connexion ---------- */
.page-connexion { margin: 0; background: var(--bg); color: var(--ink); }
.connexion-wrapper { display: flex; min-height: 100vh; }

.connexion-left {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px;
  background:
    radial-gradient(circle at 20% 20%, rgba(230,57,70,.18), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(59,130,246,.18), transparent 45%),
    #001B44;
}
.connexion-brand { max-width: 420px; text-align: center; }
.connexion-logo {
  max-width: 200px; height: auto; background: #fff; padding: 14px 18px;
  border-radius: 16px; margin-bottom: 22px;
}
.connexion-brand h1 { color: #fff; font-size: 1.5rem; margin: 0 0 4px; }
.connexion-tagline { color: #8fa4c8; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 18px; }
.connexion-desc { color: #b9c8e0; font-size: .87rem; line-height: 1.7; margin: 0; }

.connexion-right {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px;
  background: var(--bg);
}
.connexion-card {
  width: 100%; max-width: 440px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 30px;
}
.connexion-card h2 { margin: 0 0 4px; font-size: 1.2rem; }
.connexion-subtitle { margin: 0 0 22px; color: var(--muted); font-size: .84rem; }

.field-group { margin-bottom: 14px; }
.field-group label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--ink-2); margin-bottom: 5px;
}
.field-group input, .field-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--field); color: var(--ink);
  font-family: inherit; font-size: .88rem;
}
.field-group input:focus, .field-group select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}

.connexion-demo { margin-top: 24px; }
.demo-divider {
  display: flex; align-items: center; gap: 12px; color: var(--muted);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px;
}
.demo-divider::before, .demo-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.demo-accounts h3 { font-size: .84rem; margin: 0 0 6px; color: var(--ink-2); }
.demo-hint { font-size: .75rem; color: var(--muted); margin: 0 0 12px; }
.demo-hint code {
  background: var(--field); padding: 2px 6px; border-radius: 5px;
  color: var(--brand); font-weight: 700;
}
.demo-account-list { display: flex; flex-direction: column; gap: 8px; }
.demo-account-btn {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--field); cursor: pointer; font-family: inherit; transition: border-color .15s;
}
.demo-account-btn:hover { border-color: var(--accent); background: var(--surface-2); }
.demo-account-role { font-size: .8rem; font-weight: 700; color: var(--ink); }
.demo-account-email { font-size: .75rem; color: var(--accent); font-family: ui-monospace, monospace; }
.demo-account-desc { font-size: .72rem; color: var(--muted); }

.connexion-footer {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-2);
  font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.7;
}
.connexion-footer p { margin: 0; }
.connexion-footer a { color: var(--accent); }

/* ---------- 13. Onglets ---------- */
.tabs-container { width: 100%; }
.tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px;
  border-bottom: 1px solid var(--line); padding-bottom: 0;
}
.tab {
  padding: 9px 14px; border: 0; background: none; color: var(--muted);
  font-family: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 14. E-learning ---------- */
.elearning-welcome {
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(16,185,129,.10));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px;
}
.elearning-welcome h2 { margin: 0 0 8px; }
.elearning-welcome p { margin: 0 0 16px; color: var(--ink-2); font-size: .88rem; line-height: 1.65; }
.elearning-cta { display: flex; gap: 10px; flex-wrap: wrap; }

.formations-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* carte formation */
.formation-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: border-color .15s, transform .1s; display: flex; flex-direction: column;
}
.formation-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.formation-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 14px; border-bottom: 2px solid var(--line);
}
.formation-domain-tag {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: #fff; padding: 3px 9px; border-radius: 99px;
}
.formation-card-body { padding: 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.formation-title { margin: 0; font-size: .93rem; line-height: 1.35; color: var(--ink); }
.formation-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.meta-item { font-size: .74rem; color: var(--muted); }
.formation-price { font-size: .86rem; font-weight: 700; color: var(--brand); }
.formation-progress-bar { display: flex; align-items: center; gap: 9px; }
.formation-progress-bar .progress-bar-track { flex: 1; width: auto; }
.progress-bar-label { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.formation-qcm-score { font-size: .74rem; color: var(--ok); font-weight: 600; }

/* mini carte */
.formation-card-mini {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; margin-bottom: 8px; transition: border-color .15s;
}
.formation-card-mini:hover { border-color: var(--accent); }
.fcm-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fcm-info strong { font-size: .86rem; color: var(--ink); }
.fcm-info span { font-size: .74rem; color: var(--muted); }
.fcm-progress { display: flex; align-items: center; gap: 8px; }
.fcm-progress .progress-bar-track { width: 110px; flex: 0 0 110px; }
.fcm-progress span { font-size: .74rem; font-weight: 700; color: var(--ink); }

/* filtres */
.formation-filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-input, .select-input {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--field); color: var(--ink); font-family: inherit; font-size: .86rem;
}
.search-input { flex: 1; min-width: 200px; }
.search-input-large { width: 100%; font-size: .95rem; padding: 12px 15px; }
.select-input { min-width: 170px; }
.search-input:focus, .select-input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.search-bar { margin-bottom: 18px; }
.search-count { font-size: .8rem; color: var(--muted); margin: 0 0 14px; }
.search-results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.domain-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.domain-filter-btn {
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-family: inherit;
  font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.domain-filter-btn:hover { border-color: var(--accent); color: var(--ink); }
.domain-filter-btn.active {
  background: var(--brand); border-color: var(--brand); color: #fff;
}

/* ---------- 15. Detail formation ---------- */
.detail-back { margin-bottom: 16px; }
.formation-detail { display: flex; flex-direction: column; gap: 24px; }
.formation-detail-header {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
}
.formation-detail-header h2 { margin: 10px 0 12px; font-size: 1.25rem; }
.formation-meta-detail {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: .8rem; color: var(--muted); margin-bottom: 12px;
}
.formation-objectif {
  margin: 0; font-size: .86rem; color: var(--ink-2); line-height: 1.65;
  background: var(--field); padding: 12px 14px; border-radius: 9px;
  border-left: 3px solid var(--brand);
}
.formation-progress-section { display: flex; flex-direction: column; gap: 8px; }
.formation-progress-section span { font-size: .78rem; color: var(--muted); }

.formation-sequences { display: flex; flex-direction: column; gap: 10px; }
.sequence-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.sequence-item.locked { opacity: .72; }
.sequence-item.completed { border-color: rgba(16,185,129,.4); }
.sequence-header {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  cursor: pointer; transition: background .12s;
}
.sequence-header:hover { background: var(--surface-2); }
.sequence-number {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: .76rem; font-weight: 700;
  background: var(--brand-soft); color: var(--brand);
}
.sequence-item.completed .sequence-number { background: var(--ok-soft); color: var(--ok); }
.sequence-title { flex: 1; font-size: .87rem; font-weight: 600; color: var(--ink); }
.sequence-badges { display: flex; align-items: center; gap: 7px; }
.sequence-chevron { font-size: .72rem; color: var(--muted); }
.sequence-content {
  padding: 4px 18px 18px 54px; border-top: 1px solid var(--line-2);
  font-size: .84rem; color: var(--ink-2);
}
.sequence-lock-msg {
  background: var(--warn-soft); color: var(--warn); border-radius: 9px;
  padding: 11px 14px; font-size: .82rem; margin: 12px 0;
}
.seq-section { margin-top: 14px; }
.seq-section h4 {
  margin: 0 0 6px; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.seq-section ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.seq-section p { margin: 0; line-height: 1.65; }

/* ressources */
.resources-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.resource-card {
  display: flex; flex-direction: column; gap: 6px; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; transition: border-color .15s;
}
.resource-card:hover { border-color: var(--accent); text-decoration: none; }
.resource-type { font-size: .68rem; font-weight: 700; letter-spacing: .05em; }
.resource-type-pdf { color: var(--danger); }
.resource-type-ppt { color: var(--warn); }
.resource-type-video { color: var(--accent); }
.resource-label { font-size: .82rem; color: var(--ink); }
.ressource-formation { margin-bottom: 22px; }
.ressource-formation h4 { margin: 0 0 10px; font-size: .88rem; color: var(--ink); }

/* ---------- 16. QCM ---------- */
.qcm-score-display {
  background: var(--accent-soft); color: var(--accent); border-radius: 9px;
  padding: 10px 14px; font-size: .82rem; font-weight: 600; margin-bottom: 16px;
}
.qcm-list { display: flex; flex-direction: column; gap: 16px; }
.qcm-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.qcm-question { font-size: .88rem; color: var(--ink); line-height: 1.6; margin-bottom: 12px; }
.qcm-options { display: flex; flex-direction: column; gap: 7px; }
.qcm-option {
  display: flex; align-items: flex-start; gap: 9px; padding: 9px 13px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--field);
  cursor: pointer; font-size: .84rem; color: var(--ink-2); transition: border-color .12s;
}
.qcm-option:hover { border-color: var(--accent); }
.qcm-option input { margin-top: 3px; accent-color: var(--brand); }
.qcm-option.selected { border-color: var(--accent); }
.qcm-option.correct { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.qcm-option.incorrect { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.qcm-option-text { flex: 1; line-height: 1.5; }
.qcm-feedback {
  margin-top: 12px; padding: 11px 14px; border-radius: 9px; font-size: .82rem; line-height: 1.6;
}
.qcm-correct { background: var(--ok-soft); color: var(--ok); }
.qcm-incorrect { background: var(--danger-soft); color: var(--danger); }
.qcm-explanation { margin: 7px 0 0; color: var(--ink-2); font-size: .79rem; }

.quiz-formation-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px;
}
.quiz-formation-info { flex: 1; }
.quiz-formation-info h4 { margin: 0 0 3px; font-size: .88rem; color: var(--ink); }
.quiz-formation-info span { font-size: .76rem; color: var(--muted); }

/* ---------- 17. Catalogue ---------- */
.catalogue-domains { display: flex; flex-direction: column; gap: 26px; }
.catalogue-domain-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 2px solid var(--domain-color, var(--line));
}
.catalogue-domain-header h3 { margin: 0; font-size: .98rem; }
.domain-icon { font-size: 1.1rem; }
.domain-count { font-size: .75rem; color: var(--muted); margin-left: auto; }
.catalogue-formations {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ---------- 18. Modales ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(3, 8, 20, .72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  z-index: 200; opacity: 0; transition: opacity .18s; backdrop-filter: blur(3px);
}
.modal-overlay.modal-open { opacity: 1; }
.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 85vh; display: flex; flex-direction: column;
  transform: translateY(8px); transition: transform .18s;
}
.modal-overlay.modal-open .modal { transform: translateY(0); }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 760px; }
.modal-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.modal-title { margin: 0; font-size: .96rem; flex: 1; }
.modal-close {
  border: 0; background: none; color: var(--muted); font-size: 1rem;
  cursor: pointer; padding: 4px 8px; border-radius: 7px;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; font-size: .86rem; color: var(--ink-2); line-height: 1.65; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 20px; border-top: 1px solid var(--line-2);
}
.modal-confirm-text, .modal-alert-text { margin: 0; }

/* ---------- 19. Toasts ---------- */
.toast-container {
  position: fixed; bottom: 22px; right: 22px; z-index: 300;
  display: flex; flex-direction: column; gap: 9px; max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: 9px; padding: 12px 16px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: .84rem; color: var(--ink);
  opacity: 0; transform: translateX(16px); transition: all .22s;
}
.toast.toast-show { opacity: 1; transform: translateX(0); }
.toast-icon { flex: 0 0 auto; }
.toast-msg { flex: 1; line-height: 1.5; }
.toast-info { border-left: 3px solid var(--accent); }
.toast-success { border-left: 3px solid var(--ok); }
.toast-warning { border-left: 3px solid var(--warn); }
.toast-error { border-left: 3px solid var(--danger); }

/* ---------- 20. Bandeau demo ---------- */
#demo-banner-container:empty { display: none; }
#demo-banner-container .banner {
  margin: 16px 26px 0; border-radius: var(--radius-sm);
}
#demo-banner-container .banner.warn {
  background: var(--warn-soft); border-color: rgba(245, 158, 11, .4); color: var(--warn);
}
#demo-banner-container .banner.danger {
  background: var(--danger-soft); border-color: rgba(239, 68, 68, .4); color: var(--danger);
}
#demo-banner-container .banner .spacer { flex: 1; }
#demo-banner-container .banner a.btn { text-decoration: none; }

/* ---------- 21. Responsive ---------- */
@media (max-width: 980px) {
  .connexion-left { display: none; }
  .connexion-right { flex: 1; }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    max-height: none;
  }
  .sidebar-nav { max-height: 0; overflow: hidden; transition: max-height .25s; padding: 0 10px; }
  .shell:not(.sidebar-collapsed) .sidebar-nav { max-height: 70vh; overflow-y: auto; padding: 12px 10px; }
  .sidebar-collapsed .sidebar-nav { max-height: 0; }
  .progress-bar-track { width: 90px; flex: 0 0 90px; }
  .content { padding: 18px 16px 50px; }
  .formations-grid, .catalogue-formations, .search-results {
    grid-template-columns: 1fr;
  }
}
