/* ============================================================
   Calendrier de Progression — feuille de style centralisée
   Toutes les couleurs de l'application (y compris calendrier_voir.php)
   passent par les variables ci-dessous. Un seul thème clair/sombre,
   activé manuellement via [data-theme="dark"] sur <html>
   (voir assets/theme.js).
   ============================================================ */

:root {
  /* Surfaces */
  --bg-page: #f0f4f8;
  --bg-card: #ffffff;
  --bg-card-alt: #f8fafc;
  --bg-accent-soft: #e7f0f9;

  /* Texte */
  --text-primary: #0b2a3c;
  --text-secondary: #335f77;
  --text-muted: #7d93a3;

  /* Bordures */
  --border: #dce5ed;

  /* Marque (bleu-pétrole, inchangé) */
  --brand: #1a5f7a;
  --brand-hover: #0f4a62;
  --brand-light: #3b8cbf;
  --brand-tint: rgba(26, 95, 122, 0.08);
  --on-brand: #ffffff;

  /* États sémantiques */
  --danger: #b33333;
  --danger-bg: #fbeaea;
  --on-danger: #ffffff;
  --success-text: #0f6e56;
  --success-bg: #dff3e6;
  --warning-text: #8a6d15;
  --warning-bg: #fdf3c9;
  --muted-badge-bg: #f0f0f0;

  /* Badges de thème (chapitres) — codes connus du programme de maths */
  --theme-n-bg: #fdead9; --theme-n-fg: #9a4b16;
  --theme-o-bg: #dcebfa; --theme-o-fg: #2a5b8a;
  --theme-m-bg: #dff3e6; --theme-m-fg: #2c7a4b;
  --theme-g-bg: #f6def0; --theme-g-fg: #93348a;
  --theme-a-bg: #fdf3c9; --theme-a-fg: #8a7315;
  /* Palette générique (tout autre code de thème, matière/niveau différents) */
  --theme-generic-0-bg: #d9f2f0; --theme-generic-0-fg: #1f6e68;
  --theme-generic-1-bg: #fbe0dd; --theme-generic-1-fg: #a34a3d;
  --theme-generic-2-bg: #e6e0fa; --theme-generic-2-fg: #5b4a9e;
  --theme-generic-3-bg: #eef7d0; --theme-generic-3-fg: #5a6e1f;
  --theme-generic-4-bg: #fbe0ec; --theme-generic-4-fg: #9e3d6e;
  --theme-generic-5-bg: #e0ecfa; --theme-generic-5-fg: #2f5a9e;

  /* Calendrier (calendrier_voir.php) */
  --cal-bg-vacances: #e8e0d8; --cal-text-vacances: #3a2a1a;
  --cal-bg-ferie: #f5f0ec; --cal-hachure: #888888; --cal-hachure-print: #666666;
  --cal-bg-cours: #f0f0f0;
  --cal-bg-objectif: #f0ece8; --cal-text-objectif: #6a4a3a;
  --cal-bg-special: #ece4f7;
  --cal-bg-today: #b7d7e8;
  --cal-bg-week-num: #f3f8fe;
}

[data-theme="dark"] {
  --bg-page: #0f1720;
  --bg-card: #16212c;
  --bg-card-alt: #1a2733;
  --bg-accent-soft: #1c2e3a;

  --text-primary: #e2e8ee;
  --text-secondary: #9fb3c2;
  --text-muted: #7f97a8;

  --border: #2a3742;

  --brand: #4a9fc0;
  --brand-hover: #6cb6d4;
  --brand-light: #4a9fc0;
  --brand-tint: rgba(74, 159, 192, 0.14);
  --on-brand: #0f1720;

  --danger: #e6716f;
  --danger-bg: #3a1f1f;
  --on-danger: #1a0a0a;
  --success-text: #7fd9a0;
  --success-bg: #1e3d2c;
  --warning-text: #e0c26a;
  --warning-bg: #3a301a;
  --muted-badge-bg: #23303a;

  --theme-n-bg: #4a3319; --theme-n-fg: #f5c98a;
  --theme-o-bg: #1c3247; --theme-o-fg: #9cc7ec;
  --theme-m-bg: #1e3d2c; --theme-m-fg: #8fe0ae;
  --theme-g-bg: #3d2340; --theme-g-fg: #e8b3e0;
  --theme-a-bg: #3a301a; --theme-a-fg: #e6cd7a;
  --theme-generic-0-bg: #163934; --theme-generic-0-fg: #8fd9cf;
  --theme-generic-1-bg: #3a231f; --theme-generic-1-fg: #e8a292;
  --theme-generic-2-bg: #29223f; --theme-generic-2-fg: #c1b6ec;
  --theme-generic-3-bg: #2c3315; --theme-generic-3-fg: #cbe08a;
  --theme-generic-4-bg: #3a2130; --theme-generic-4-fg: #eba9c9;
  --theme-generic-5-bg: #1c2c40; --theme-generic-5-fg: #9cc0ec;

  --cal-bg-vacances: #332a20; --cal-text-vacances: #d8c4a8;
  --cal-bg-ferie: #241f1a; --cal-hachure: #6a6a6a; --cal-hachure-print: #888888;
  --cal-bg-cours: #202a33;
  --cal-bg-objectif: #2c2521; --cal-text-objectif: #d3ac91;
  --cal-bg-special: #2a2035;
  --cal-bg-today: #234a5e;
  --cal-bg-week-num: #17222c;
}

* { box-sizing: border-box; font-family: system-ui, 'Segoe UI', Roboto, sans-serif; }

body {
  background: var(--bg-page);
  margin: 0;
  padding: 20px;
  color: var(--text-primary);
}

.app {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 32px;
  padding: 28px 26px 32px;
  box-shadow: 0 20px 40px rgba(0, 20, 40, 0.12);
}

.app.app-large { max-width: none; width: 97%; }

h1 {
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 18px 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Menu horizontal fixe — identique sur toutes les pages authentifiées.
   Sticky (pas fixed) : se colle en haut du viewport au défilement sans
   nécessiter de padding-top compensatoire sur le reste de la page. */
.topnav {
  position: sticky;
  top: 12px;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(0, 20, 40, 0.10);
  max-width: 1400px;
  width: 97%;
  margin: 12px auto 20px;
}
@media print { .topnav { display: none; } }
.topnav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.topnav-brand {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.topnav-links { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.topnav-link {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.topnav-link:hover { background: var(--bg-accent-soft); color: var(--brand); }
.topnav-link.active { background: var(--brand-tint); color: var(--brand); }
.topnav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topnav-who {
  background: var(--bg-accent-soft);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.82rem;
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}
.topnav-who .badge-admin { margin-left: 6px; }
@media (max-width: 720px) {
  .topnav-who { display: none; }
}

/* Menus déroulants (Progressions, avatar) */
.topnav-dropdown { position: relative; }
.topnav-dropdown-trigger {
  background: none; border: none; cursor: pointer; font: inherit;
}
.topnav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 20, 40, 0.14);
  min-width: 190px;
  padding: 6px;
  z-index: 300;
}
.topnav-dropdown.open .topnav-dropdown-menu { display: block; }
.topnav-dropdown-menu-right { left: auto; right: 0; min-width: 220px; }
.topnav-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.topnav-dropdown-item:hover { background: var(--bg-accent-soft); }
.topnav-dropdown-header {
  padding: 6px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.topnav-dropdown-header strong { display: block; font-size: 0.88rem; color: var(--text-primary); }
.topnav-dropdown-header span { font-size: 0.75rem; color: var(--text-secondary); }
.topnav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.topnav-avatar:hover { background: var(--brand-hover); }

form { display: flex; flex-direction: column; gap: 14px; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px 16px;
}

legend {
  padding: 0 8px;
  font-weight: 600;
  color: var(--brand);
  font-size: 0.85rem;
}

label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background: var(--bg-card-alt);
  color: var(--text-primary);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--brand-light);
  background: var(--bg-card);
}

.field { display: flex; flex-direction: column; gap: 2px; }

.row { display: flex; flex-direction: row; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; }

.btn {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: 0.15s;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-accent-soft); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }

.btn-sm { padding: 5px 12px; font-size: 0.75rem; }

.toggle-group { display: flex; gap: 8px; margin-bottom: 4px; }
.toggle-group button {
  flex: 1;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card-alt);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.toggle-group button.active {
  background: var(--bg-accent-soft);
  border-color: var(--brand-light);
  color: var(--brand);
}

.alert {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.alert-erreur { background: var(--danger-bg); color: var(--danger); border-left: 4px solid var(--danger); }
.alert-info { background: var(--bg-accent-soft); color: var(--brand); border-left: 4px solid var(--brand-light); }

.lien-bas { text-align: center; font-size: 0.85rem; margin-top: 6px; color: var(--text-secondary); }
.lien-bas a { color: var(--brand); font-weight: 600; text-decoration: none; }
.lien-bas a:hover { text-decoration: underline; }

.suggestions {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 4px;
  max-height: 160px;
  overflow-y: auto;
  background: var(--bg-card);
}
.suggestions .sugg-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.suggestions .sugg-item:hover { background: var(--bg-accent-soft); }
.suggestions .sugg-item small { display: block; color: var(--text-muted); }

.card-liste {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.card-liste .titre { font-weight: 700; color: var(--text-primary); }
.card-liste .sous-titre { font-size: 0.78rem; color: var(--text-secondary); }
.sous-titre { font-size: 0.85rem; color: var(--text-secondary); }

.badge-admin {
  background: var(--brand);
  color: var(--on-brand);
  padding: 3px 12px;
  border-radius: 30px;
  font-size: 0.72rem;
  font-weight: 600;
}

.btn-group-nav { display: flex; gap: 8px; flex-wrap: wrap; }
/* Dans une carte de liste, les boutons d'action ne doivent jamais passer
   à la ligne sous le titre — seule la barre du haut (topbar) a besoin
   de ce comportement pour ses liens de navigation. */
.card-liste .btn-group-nav { flex-wrap: nowrap; flex-shrink: 0; }
/* Grille plutôt que flex ici : immunisé contre la règle globale
   form{flex-direction:column} qui nous a déjà piégés deux fois — grid
   n'a pas d'équivalent "direction héritée d'un sélecteur générique". */
.card-liste-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.card-liste-row .titre-date { display: flex; align-items: baseline; gap: 10px; min-width: 0; overflow: hidden; }
.card-liste-row .titre-date .titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-liste-row .titre-date .sous-titre { white-space: nowrap; flex-shrink: 0; }

/* Mes progressions (mes_progressions.php) — accent couleur par matière,
   même principe que la bibliothèque et l'emploi du temps. */
.progression-carte { border-left: 4px solid hsl(var(--teinte, 205), 50%, 42%); flex-wrap: wrap; }
.progression-mini-track {
  width: 140px;
  height: 5px;
  background: var(--bg-accent-soft);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}
.progression-mini-fill { height: 100%; background: hsl(var(--teinte, 205), 55%, 45%); border-radius: 4px; }

.theme-toggle {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 30px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { background: var(--bg-accent-soft); }

.vide {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.text-success { color: var(--success-text); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.stat-mini {
  flex: 1;
  background: var(--bg-card-alt);
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
}
.stat-mini .label { font-size: 0.75rem; color: var(--text-muted); }
.stat-mini .valeur { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }

.progress-track {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-card-alt);
  overflow: hidden;
  margin: 4px 0 18px;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  transition: width 0.15s;
}

.chapitre-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.chapitre-row .num { font-size: 0.75rem; color: var(--text-muted); width: 22px; flex-shrink: 0; }
.chapitre-row .titre-chap { flex: 1; font-size: 0.85rem; }
.chapitre-row .hval { width: 38px; text-align: right; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.chapitre-row input[type="range"] { width: 150px; flex-shrink: 0; }

.theme-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  flex-shrink: 0;
}
.theme-n { background: var(--theme-n-bg); color: var(--theme-n-fg); }
.theme-o { background: var(--theme-o-bg); color: var(--theme-o-fg); }
.theme-m { background: var(--theme-m-bg); color: var(--theme-m-fg); }
.theme-g { background: var(--theme-g-bg); color: var(--theme-g-fg); }
.theme-a { background: var(--theme-a-bg); color: var(--theme-a-fg); }
.theme-generic-0 { background: var(--theme-generic-0-bg); color: var(--theme-generic-0-fg); }
.theme-generic-1 { background: var(--theme-generic-1-bg); color: var(--theme-generic-1-fg); }
.theme-generic-2 { background: var(--theme-generic-2-bg); color: var(--theme-generic-2-fg); }
.theme-generic-3 { background: var(--theme-generic-3-bg); color: var(--theme-generic-3-fg); }
.theme-generic-4 { background: var(--theme-generic-4-bg); color: var(--theme-generic-4-fg); }
.theme-generic-5 { background: var(--theme-generic-5-bg); color: var(--theme-generic-5-fg); }

.chap-bloc { border-bottom: 1px solid var(--border); padding: 10px 0; }
.chap-ligne { display: flex; align-items: center; gap: 10px; }
.chap-ligne .num { font-size: 0.75rem; color: var(--text-muted); width: 26px; flex-shrink: 0; }
.chap-ligne .titre-chap { flex: 1; font-size: 0.85rem; }
.chap-ligne .chev { color: var(--text-muted); font-style: normal; transition: transform 0.15s; }

.chap-panel {
  margin: 10px 0 4px 36px;
  padding: 10px 14px;
  background: var(--bg-card-alt);
  border-radius: 12px;
}

.obj-ligne { display: flex; align-items: center; gap: 8px; padding: 6px 0 2px; }
.obj-ligne .obj-texte { flex: 1; font-size: 0.85rem; }
.obj-suivi { font-size: 0.78rem; color: var(--text-secondary); font-style: italic; padding: 0 30px 8px 0; }
.obj-suivi-date { color: var(--text-muted); font-style: normal; }

.badge-etat {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-non_fait { background: var(--muted-badge-bg); color: var(--text-muted); }
.badge-partiel { background: var(--warning-bg); color: var(--warning-text); }
.badge-fait { background: var(--success-bg); color: var(--success-text); }

.biblio-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.biblio-stat { font-size: 0.78rem; color: var(--text-muted); background: var(--bg-accent-soft); padding: 3px 10px; border-radius: 999px; }
.biblio-stat-fort { color: var(--brand); font-weight: 600; background: var(--bg-accent-soft); }

.btn-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--brand);
}
.btn-icon:hover { background: var(--bg-accent-soft); }
.btn-icon-danger { color: var(--danger); }
.btn-icon:disabled { opacity: 0.35; cursor: default; }
.btn-icon:disabled:hover { background: var(--bg-card); }
.chap-reorder { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.chap-reorder .btn-icon { width: 24px; height: 20px; font-size: 0.7rem; }
.reorder-inline { display: flex; gap: 4px; flex-shrink: 0; }
.reorder-inline form { display: contents; }
.reorder-inline .btn-icon { width: 24px; height: 24px; font-size: 0.7rem; }

.suivi-form {
  display: none;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  padding: 8px 0 10px 0;
  margin-left: 4px;
}
.suivi-form.ouvert { display: flex; flex-direction: row; }
.suivi-form input[type="date"] { width: 130px; flex-shrink: 0; }
.suivi-form select { width: 110px; flex-shrink: 0; }
.suivi-form input[type="text"] { flex: 1 1 auto; min-width: 60px; }
.suivi-form button { flex-shrink: 0; white-space: nowrap; }

.objectif-add-row { display: flex; flex-direction: row; gap: 8px; align-items: center; flex-wrap: nowrap; margin-top: 10px; }
.objectif-add-row input[type="text"] { flex: 1 1 auto; min-width: 60px; }
.objectif-add-row button { flex-shrink: 0; white-space: nowrap; }
.obj-edit-form { flex-wrap: nowrap; }
.obj-edit-form input[type="text"] { flex: 1 1 auto; min-width: 60px; font-size: 0.85rem; }
.chap-edit-form { padding: 10px 0; }
.modele-infos-edit { margin-bottom: 18px; }
.modele-infos-edit summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modele-infos-edit form { margin-top: 10px; }

/* Champ date personnalisé — voir assets/datepicker.js */
[x-cloak] { display: none !important; }
.date-field { position: relative; display: inline-flex; align-items: center; }
.date-field input[type="text"] { width: 110px; padding-right: 26px; }
.date-field-icon { position: absolute; right: 4px; background: none; border: none; cursor: pointer; font-size: 0.8rem; padding: 2px; line-height: 1; }
.date-popup {
  position: absolute; z-index: 60; left: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); padding: 10px; width: 230px;
}
.date-popup.below { top: calc(100% + 4px); }
.date-popup.above { bottom: calc(100% + 4px); }
.date-popup-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.82rem; font-weight: 600; }
.date-popup-nav button { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 2px 8px; color: var(--text-primary); }
.date-popup-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-popup-dow { text-align: center; font-size: 0.66rem; color: var(--text-muted); padding: 2px 0; }
.date-popup-day { text-align: center; font-size: 0.75rem; padding: 5px 0; border-radius: 6px; cursor: pointer; }
.date-popup-day:hover { background: var(--bg-accent-soft); }
.date-popup-day.vide { cursor: default; }
.date-popup-day.vide:hover { background: none; }
.date-popup-day.selectionne { background: var(--brand); color: var(--on-brand); font-weight: 600; }

/* Contenu de présentation (presentation.html) — réutilisé sur index.php et aide.php */
.pres-wrap { max-width: 900px; margin: 0 auto; padding: 20px; }
.pres-avantages { margin: 40px 0; }
.pres-avantages h2, .pres-features h2 { font-size: 1.15rem; margin-bottom: 14px; }
.pres-liste { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pres-liste li { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-size: 0.88rem; line-height: 1.5; color: var(--text-secondary); }
.pres-liste li strong { color: var(--text-primary); }
.pres-features { margin: 40px 0; }
.pres-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.pres-feature { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 8px 20px rgba(0, 20, 40, 0.05); }
.pres-feature-icon { font-size: 1.6rem; margin-bottom: 8px; }
.pres-feature h3 { margin: 0 0 6px; font-size: 1rem; }
.pres-feature p { margin: 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.pres-cta { text-align: center; padding: 20px 0 48px; }

/* FAQ (aide.php) */
.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-question { font-weight: 700; color: var(--text-primary); margin: 0 0 6px; font-size: 0.92rem; }
.faq-reponse { margin: 0; color: var(--text-secondary); font-size: 0.86rem; line-height: 1.55; }

/* Emploi du temps hebdomadaire consolidé (emploi_du_temps.php) */
.edt-grille {
  display: grid;
  gap: 3px;
  overflow-x: auto;
  margin-bottom: 14px;
}
.edt-coin { background: transparent; }
.edt-jour-header {
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
  padding: 6px 4px;
  color: var(--text-primary);
  position: sticky;
  top: 0;
}
.edt-heure-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: right;
  padding: 2px 6px 0 0;
  white-space: nowrap;
}
.edt-bloc { min-width: 0; position: relative; }
.edt-bloc-simple,
.edt-split-half {
  height: 100%;
  border-radius: 8px;
  background: hsl(var(--edt-teinte, 205), 55%, 92%);
  border: 1px solid hsl(var(--edt-teinte, 205), 40%, 78%);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.76rem;
  line-height: 1.25;
  position: relative;
  overflow: hidden;
}
.edt-bloc-simple .edt-heure {
  font-size: 0.68rem;
  color: var(--text-secondary);
}
.edt-bloc-simple .edt-classe,
.edt-split-half .edt-classe {
  font-weight: 600;
  color: var(--text-primary);
}
.edt-bloc-split {
  height: 100%;
  display: flex;
  gap: 3px;
}
.edt-bloc-split .edt-split-half { flex: 1; min-width: 0; }
.edt-semaine-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--brand);
  opacity: 0.75;
}
.edt-vide { color: var(--text-secondary); opacity: 0.5; font-size: 0.72rem; }
.edt-conflit-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.7rem;
}
.edt-bloc-simple.edt-conflit,
.edt-split-half.edt-conflit {
  background: var(--danger-bg);
  border-color: var(--danger);
  box-shadow: 0 0 0 2px var(--bg-card), 0 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 2;
}
[data-theme="dark"] .edt-bloc-simple,
[data-theme="dark"] .edt-split-half {
  background: hsl(var(--edt-teinte, 205), 35%, 22%);
  border-color: hsl(var(--edt-teinte, 205), 35%, 34%);
}
.edt-legende-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--brand-tint) 50%, var(--bg-card-alt) 50%);
}
.edt-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
}
.edt-legende-item { display: inline-flex; align-items: center; gap: 6px; }
@media print {
  .edt-jour-header { position: static; }
}
@media (max-width: 640px) {
  .edt-jour-header { font-size: 0.72rem; }
  .edt-bloc-simple, .edt-split-half { font-size: 0.66rem; padding: 3px 4px; }
  .edt-semaine-tag { display: block; }
}

/* Page publique de partage (modele_partage.php) */
.partage-bandeau {
  background: var(--brand-tint);
  color: var(--brand);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  margin-bottom: 14px;
}
.partage-pied {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Icônes SVG en ligne (remplacent les emoji) */
.icone {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.22em;
  flex-shrink: 0;
}
h1 .icone { width: 0.8em; height: 0.8em; }

/* Bibliothèque de progressions — cartes (bibliotheque_progressions.php) */
.biblio-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.biblio-carte {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid hsl(var(--teinte, 205), 50%, 42%);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.biblio-niveau { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.biblio-ref { font-size: 0.72rem; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.biblio-matiere {
  font-size: 0.8rem;
  font-weight: 600;
  color: hsl(var(--teinte, 205), 55%, 36%);
}
[data-theme="dark"] .biblio-matiere { color: hsl(var(--teinte, 205), 65%, 68%); }
.biblio-description { font-size: 0.82rem; color: var(--text-secondary); }
.biblio-systeme { font-size: 0.72rem; color: var(--text-muted); }
.biblio-soumis-par { font-size: 0.74rem; color: var(--text-muted); }
.biblio-meta { display: flex; gap: 16px; font-size: 0.76rem; color: var(--text-muted); }
.biblio-meta span { display: inline-flex; align-items: center; gap: 5px; }
.biblio-meta .icone { width: 1.05em; height: 1.05em; }
.biblio-adoptions { font-size: 0.78rem; color: var(--text-secondary); }
.biblio-adoptions summary { cursor: pointer; color: var(--brand); }
.biblio-adoption-ligne { padding: 4px 0 4px 4px; }
.biblio-adopter { display: flex; gap: 8px; }
.biblio-adopter input[type="text"] { flex: 1; min-width: 0; }
.biblio-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.biblio-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.biblio-icon-btn:hover { background: var(--bg-accent-soft); color: var(--brand); }

/* Fenêtre modale (aperçu d'un modèle) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 21, 30, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  z-index: 50;
  overflow-y: auto;
}
.modal-panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px 26px;
  max-width: 640px;
  width: 100%;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.modal-fermer {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.modal-fermer:hover { background: var(--bg-accent-soft); color: var(--text-primary); }
.modal-fermer .icone { width: 1.2em; height: 1.2em; }
.modal-pied {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Comparaison progression <-> bibliothèque (progression_publier.php) */
.diff-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.diff-ligne:last-child { border-bottom: none; }
.diff-etiquette {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 30px;
  white-space: nowrap;
}
.diff-modifie { background: var(--warning-bg); color: var(--warning-text); }
.diff-ajoute { background: var(--success-bg); color: var(--success-text); }
.diff-supprime { background: var(--danger-bg); color: var(--danger); }
.diff-contexte { color: var(--text-muted); font-size: 0.76rem; }
.diff-avant { color: var(--text-muted); text-decoration: line-through; }
.diff-fleche { color: var(--text-muted); }
.diff-apres { color: var(--text-primary); font-weight: 600; }

/* Aperçu en lecture seule d'une progression (modal "Voir" de la
   bibliothèque, page publique de partage) — distinct de .chap-bloc
   qui sert aux pages d'édition (réordonnancement, cases à cocher). */
.apercu-chapitre { margin-bottom: 18px; }
.apercu-titre-ligne {
  font-weight: 700;
  font-size: 1.08em;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.apercu-objectifs {
  margin: 0;
  padding-left: 2em;
  list-style: disc;
}
.apercu-objectifs li {
  font-size: 0.92em;
  color: var(--text-secondary);
  padding: 3px 0;
  line-height: 1.4;
}

/* Écran de succès après inscription (register.php) */
.inscription-succes-cta { margin-top: 14px; text-align: center; }
.inscription-succes-cta .btn { display: inline-block; }
.inscription-succes-cta .sous-titre { margin-top: 10px; }

/* Page de présentation (presentation.html) — refonte avec captures
   d'écran encadrées et animation au défilement. */
.pres-hero { text-align: center; padding: 44px 20px 30px; }
.pres-ring-zone { display: flex; justify-content: center; margin-bottom: 14px; }
.pres-ring-zone svg { width: 84px; height: 84px; }
.pres-ring-seg {
  fill: none;
  stroke: var(--brand-tint);
  stroke-width: 9;
  stroke-linecap: round;
  animation: pres-ring-allumage 0.5s ease forwards;
}
@keyframes pres-ring-allumage {
  from { stroke: var(--brand-tint); }
  to { stroke: var(--brand); }
}
.pres-hero h1 { font-size: 2rem; margin: 0 0 12px; }
.pres-tagline { color: var(--text-secondary); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }
.pres-cta-hero { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

.pres-moment {
  max-width: 760px;
  margin: 0 auto 64px;
  padding: 0 20px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.pres-moment.visible { opacity: 1; transform: translateY(0); }
.pres-moment-texte { text-align: center; max-width: 560px; margin: 0 auto 22px; }
.pres-moment-texte h2 { font-size: 1.3rem; margin: 0 0 8px; }
.pres-moment-texte p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; margin: 0; }

.navigateur-cadre {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(20, 40, 45, 0.10);
  background: var(--bg-card);
}
[data-theme="dark"] .navigateur-cadre { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.navigateur-barre {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border);
}
.navigateur-bouton { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.navigateur-bouton.rouge { background: #ff5f57; }
.navigateur-bouton.jaune { background: #febc2e; }
.navigateur-bouton.vert { background: #28c840; }
.navigateur-corps img { display: block; width: 100%; height: auto; }

.pres-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 640px) { .pres-duo { grid-template-columns: 1fr; } }
.pres-cadre-etroit { max-width: 300px; margin: 0 auto; }

.pres-cta-finale { text-align: center; padding: 30px 20px 56px; }
.pres-cta-finale h2 { font-size: 1.2rem; margin: 0 0 16px; }
