/* ==========================================================================
   Académie Consulting — feuille de style de l'application
   CSS écrit sur mesure (aucun framework). Organisation :
   1. Jetons de design   2. Base   3. Mise en page   4. En-tête & pied
   5. Composants         6. Formulaires   7. Espaces connectés   8. Liseuse
   9. Fiche imprimable   10. Téléphones   11. Utilitaires
   ========================================================================== */

/* 1. Jetons de design ---------------------------------------------------- */
:root {
  --ink: #14213d;
  --ink-soft: #2a3a5f;
  --primary: #1b2f5e;
  --primary-hover: #12224a;
  --primary-tint: #eef1f8;
  --gold: #b48a3c;
  --gold-text: #8a6420;
  --gold-tint: #f7efdf;

  --paper: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e3dfd5;
  --line-strong: #cfc9bb;
  --text: #1c2233;
  --muted: #5d6474;

  --success: #1f6f47;  --success-bg: #e6f3ec;
  --warning: #835400;  --warning-bg: #fcf1d8;
  --danger:  #a8261d;  --danger-bg:  #fbe8e6;
  --info:    #1d4f91;  --info-bg:    #e7eef9;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, .06);
  --shadow: 0 1px 2px rgba(20, 33, 61, .05), 0 10px 30px -14px rgba(20, 33, 61, .22);
  --focus: 0 0 0 3px rgba(180, 138, 60, .45);

  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
}

/* 2. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; color: var(--ink); font-weight: 600; }
h1, h2 { font-family: var(--font-serif); letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
.h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
small { font-size: .875rem; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
::selection { background: var(--gold-tint); }

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; color: #fff; }

[hidden] { display: none !important; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3. Mise en page -------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 760px; }
.container--form { max-width: 980px; }

main { flex: 1 0 auto; }
.section { padding-block: clamp(40px, 6vw, 80px); }
.section--tight { padding-block: clamp(28px, 4vw, 48px); }
.section--white { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; justify-content: space-between; margin-bottom: 1.75rem; }
.section__head h2 { margin: 0; }
.section__intro { color: var(--muted); max-width: 60ch; margin: .35rem 0 0; }

.grid { display: grid; gap: clamp(16px, 2vw, 24px); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 260px)), 1fr)); }
.grid--2 { --min: 380px; }
.grid--3 { --min: 280px; }
.grid--4 { --min: 220px; }
.grid--wide { --min: 320px; }
.split { display: grid; gap: clamp(20px, 3vw, 32px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split--aside { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.stack > * + * { margin-top: var(--space, 1rem); }
.stack--lg { --space: 1.75rem; }
.stack--sm { --space: .5rem; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, .75rem); align-items: center; }
.cluster--end { justify-content: flex-end; }
.cluster--between { justify-content: space-between; }

/* 4. En-tête & pied ------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { height: 46px; width: auto; border-radius: var(--radius-sm); }
.brand__name { font-family: var(--font-serif); font-weight: 600; font-size: 1.15rem; line-height: 1.1; }
.brand__name small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); }

.main-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.main-nav__link {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .8rem; border-radius: var(--radius-sm);
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .97rem;
}
.main-nav__link:hover { background: var(--primary-tint); color: var(--ink); }
.main-nav__link[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.main-nav__actions { display: flex; gap: .5rem; align-items: center; margin-left: .75rem; }

/* Bouton menu : uniquement sur petits écrans (sélecteur renforcé, sinon .btn l'emporte) */
.site-header .nav-toggle { display: none; margin-left: auto; }
@media (max-width: 960px) {
  .site-header .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: .25rem;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: .75rem var(--gutter) 1.25rem;
  }
  .main-nav.is-open { display: flex; }
  .main-nav__link { padding: .8rem .75rem; font-size: 1.05rem; }
  .main-nav__link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); background: var(--surface-2); }
  .main-nav__actions { margin: .5rem 0 0; flex-direction: column; align-items: stretch; }
  .main-nav .dropdown__menu { position: static; box-shadow: none; border: 0; padding-left: 1rem; min-width: 0; }
}

/* Menus déroulants (balise <details>) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary .bi-chevron-down { font-size: .75em; transition: transform .2s; }
.dropdown[open] > summary .bi-chevron-down { transform: rotate(180deg); }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .4rem; margin: 0; list-style: none;
}
.dropdown__menu--left { left: 0; right: auto; }
.dropdown__item {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .6rem .75rem; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: .97rem; background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.dropdown__item:hover { background: var(--primary-tint); color: var(--ink); }
.dropdown__sep { height: 1px; background: var(--line); margin: .35rem .25rem; }
.dropdown__label { padding: .5rem .75rem .25rem; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: var(--size, 34px); height: var(--size, 34px); border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 600; font-size: calc(var(--size, 34px) * .38);
  letter-spacing: .02em;
}
.avatar--lg { --size: 64px; }

.site-footer { background: var(--ink); color: #c9cfdd; margin-top: auto; }
.site-footer a { color: #fff; }
.site-footer__inner { display: grid; gap: 2rem; padding-block: 48px 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h3 { color: #fff; font-family: var(--font-serif); font-size: 1.1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 18px; font-size: .875rem; color: #9aa3b8; }

/* 5. Composants ---------------------------------------------------------- */

/* Boutons */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem;
  font: 600 .97rem/1.2 var(--font-sans); text-decoration: none; white-space: nowrap;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-border); border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { color: var(--btn-fg); background: var(--surface-2); border-color: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn--primary { --btn-bg: var(--primary); --btn-fg: #fff; --btn-border: var(--primary); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn--gold { --btn-bg: var(--gold); --btn-fg: #1b1408; --btn-border: var(--gold); }
.btn--gold:hover { background: #a37a2f; border-color: #a37a2f; color: #1b1408; }
.btn--light { --btn-bg: #fff; --btn-fg: var(--ink); --btn-border: #fff; }
.btn--light:hover { background: var(--gold-tint); border-color: var(--gold-tint); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgba(255, 255, 255, .55); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; }
.btn--ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn--ghost:hover { background: var(--primary-tint); border-color: transparent; }
.btn--danger { --btn-fg: var(--danger); --btn-border: #e7b9b4; }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn--sm { min-height: 36px; padding: .35rem .75rem; font-size: .9rem; }
.btn--lg { min-height: 52px; padding: .75rem 1.5rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 44px; }
.btn--icon.btn--sm { width: 36px; }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card__body { padding: clamp(18px, 2.5vw, 28px); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 18px clamp(18px, 2.5vw, 28px); border-bottom: 1px solid var(--line); }
.card__head h2, .card__head h3 { margin: 0; font-size: 1.1rem; font-family: var(--font-sans); }
.card__foot { padding: 14px clamp(18px, 2.5vw, 28px); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card--link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card--link:hover { color: inherit; border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.card--flat { box-shadow: none; }
.card--muted { background: var(--surface-2); }

/* En-tête de page (titre + actions) */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.page-head h1 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.page-head__sub { margin: .35rem 0 0; color: var(--muted); }
.breadcrumb { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .5rem; font-size: .9rem; color: var(--muted); text-decoration: none; }
.breadcrumb:hover { color: var(--ink); }

.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-text); margin-bottom: .75rem; }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }

/* Héros */
.hero {
  position: relative; overflow: hidden; color: #e8ebf3;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(180, 138, 60, .22), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(86, 118, 196, .25), transparent 60%),
    var(--ink);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .eyebrow { color: #e3c487; }
.hero__lead { font-size: 1.15rem; color: #c7cede; max-width: 56ch; margin-bottom: 2rem; }
.hero--home { padding-block: clamp(56px, 9vw, 120px); }
.hero--page { padding-block: clamp(40px, 6vw, 72px); }
.hero--page h1 { max-width: none; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.hero__panel { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius-lg); padding: 28px; backdrop-filter: blur(6px); }
.hero__panel h2 { color: #fff; font-size: 1.2rem; font-family: var(--font-sans); }
.hero__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .14); text-align: center; }
.hero__facts strong { display: block; font-family: var(--font-serif); font-size: 1.5rem; color: #fff; }
.hero__facts span { font-size: .85rem; color: #aab3c7; }

/* Listes à coches */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
/* Coche positionnée à part : le texte (gras, liens…) reste un seul bloc */
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 0; color: var(--gold); font-size: 1.1rem; line-height: 1.5; }
.hero .checklist li::before { color: #e3c487; }

/* Pastilles / badges */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; max-width: 100%;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
  background: var(--primary-tint); color: var(--primary); border: 1px solid transparent;
}
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--muted { background: #eeece6; color: var(--muted); }
.badge--gold { background: var(--gold-tint); color: var(--gold-text); }
.badge--outline { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }

/* Alertes / messages */
.alert {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: start;
  padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--info-bg); color: var(--info); margin-bottom: 1rem;
}
.alert > .bi { font-size: 1.2rem; line-height: 1.4; }
.alert__close { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 .25rem; font-size: 1.25rem; line-height: 1; opacity: .7; }
.alert__close:hover { opacity: 1; }
.alert--success { background: var(--success-bg); color: var(--success); border-color: #c4e2d1; }
.alert--warning { background: var(--warning-bg); color: var(--warning); border-color: #f1dca8; }
.alert--danger { background: var(--danger-bg); color: var(--danger); border-color: #f2c6c1; }
.alert--info { border-color: #c9d8f0; }
.alert strong { color: inherit; }
.alert a { color: inherit; font-weight: 600; }
.flashes { margin-bottom: 1.25rem; }

/* Tuiles d'accès rapide */
.tile {
  display: flex; align-items: center; gap: 1rem; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tile:hover { color: var(--text); border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.tile__icon { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; background: var(--primary-tint); color: var(--primary); font-size: 1.35rem; }
.tile__title { display: block; font-weight: 600; color: var(--ink); }
.tile__text { display: block; font-size: .9rem; color: var(--muted); }
.tile__arrow { margin-left: auto; color: var(--muted); }

/* Indicateurs (tableau de bord admin) */
.stat { display: flex; flex-direction: column; gap: .25rem; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.stat:hover { color: inherit; border-color: var(--gold); box-shadow: var(--shadow); }
.stat__label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); }
.stat__value { font-family: var(--font-serif); font-size: 2.1rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.stat__link { font-size: .85rem; color: var(--primary); margin-top: .25rem; }

/* Cartes concours */
.concours-card { display: flex; flex-direction: column; height: 100%; padding: 24px; }
.concours-card__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-tint); color: var(--gold-text); font-size: 1.2rem; margin-bottom: 1rem; }
.concours-card h2, .concours-card h3 { font-family: var(--font-serif); font-size: 1.25rem; }
.concours-card p { color: var(--muted); font-size: .97rem; }
.concours-card__more { margin-top: auto; padding-top: 1rem; font-weight: 600; color: var(--primary); display: inline-flex; gap: .4rem; align-items: center; }

/* Cartes ressource (documents, vidéos, devoirs) */
.resource { display: flex; flex-direction: column; height: 100%; }
.resource__main { display: flex; gap: .9rem; padding: 18px 18px 12px; flex: 1; }
.resource__icon { display: grid; place-items: center; width: 46px; height: 54px; flex-shrink: 0; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 1.4rem; color: var(--ink-soft); position: relative; }
.resource__icon--pdf { color: #b3261e; }
.resource__icon--docx { color: #1d4f91; }
.resource__icon--image { color: #1f6f47; }
.resource__icon--video { color: var(--primary); width: 54px; height: 46px; }
.resource__title { font-weight: 600; color: var(--ink); line-height: 1.35; margin: 0 0 .35rem; font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.resource__meta { font-size: .85rem; color: var(--muted); }
.resource__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: 12px 18px 16px; }
.resource__actions .btn--primary { flex: 1; }
.resource__foot { display: flex; justify-content: space-between; gap: .5rem; padding: 10px 18px; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* Liste simple (lignes) */
.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; align-items: center; gap: .9rem; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list__item:last-child { border-bottom: 0; }
.list__item .bi { font-size: 1.2rem; color: var(--ink-soft); }
.list__title { font-weight: 600; color: var(--ink); text-decoration: none; }
.list__meta { font-size: .85rem; color: var(--muted); }
.list__end { margin-left: auto; flex-shrink: 0; }

/* Liste de définitions */
.dl { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: .75rem 1.25rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .92rem; }
.dl dd { margin: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 520px) { .dl { grid-template-columns: minmax(0, 1fr); gap: .15rem; } .dl dd { margin-bottom: .6rem; } }

/* Tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.table th, .table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbf8; }
.table .num { width: 64px; color: var(--muted); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * + * { margin-left: .35rem; }
.table__strong { font-weight: 600; color: var(--ink); }
/* Tableau empilé sur mobile */
@media (max-width: 720px) {
  .table--stack thead { display: none; }
  .table--stack tr { display: grid; gap: .55rem; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { display: block; padding: 0; border: 0; text-align: left; }
  .table--stack td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: .1rem; }
  .table--stack td:not([data-label])::before { content: none; }
  .table--stack td.actions::before { content: none; }
}

/* Barre de filtres */
.toolbar { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); align-items: end; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.5rem; }
@media (min-width: 720px) { .toolbar { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; } .toolbar--simple { grid-template-columns: minmax(0, 1fr) auto; } .toolbar--wide { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.toolbar .field { margin: 0; }
.results-count { color: var(--muted); font-size: .92rem; margin: -0.5rem 0 1rem; }

/* État vide */
.empty { text-align: center; padding: clamp(32px, 6vw, 64px) 24px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.empty > .bi { display: block; font-size: 2.4rem; color: var(--gold); margin-bottom: .75rem; }
.empty h2, .empty h3 { font-family: var(--font-sans); font-size: 1.1rem; color: var(--ink); margin-bottom: .35rem; }
.empty .btn { margin-top: 1rem; }

/* Étapes numérotées */
.steps { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 22px 22px 22px 70px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { content: counter(step); position: absolute; left: 22px; top: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--font-serif); font-weight: 600; }
.steps strong { display: block; color: var(--ink); margin-bottom: .2rem; }
.steps span { color: var(--muted); font-size: .95rem; }

/* Valeurs / atouts */
.feature { padding: 26px; }
.feature__icon { font-size: 1.6rem; color: var(--gold-text); margin-bottom: .75rem; display: inline-block; }
.feature h3 { font-family: var(--font-serif); font-size: 1.2rem; }
.feature p { color: var(--muted); }

/* FAQ (balise <details>) */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 18px 4px; cursor: pointer; list-style: none; font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "\F4FE"; font-family: "bootstrap-icons"; color: var(--gold-text); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 4px 20px; color: var(--muted); max-width: 70ch; }

/* Bandeau d'appel à l'action */
.cta { background: var(--ink); color: #c9cfdd; border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 48px); display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.cta h2 { color: #fff; margin: 0 0 .35rem; }
.cta p { margin: 0; }

/* Équipe */
.person { text-align: center; padding: 28px 22px; }
.person .avatar { --size: 76px; margin: 0 auto 1rem; background: var(--gold-tint); color: var(--gold-text); font-family: var(--font-serif); }
.person img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; }
.person h3 { margin-bottom: .1rem; }
.person__role { color: var(--gold-text); font-size: .9rem; font-weight: 600; margin-bottom: .5rem; }
.person p { color: var(--muted); font-size: .95rem; }

/* Lecteur vidéo / documents officiels */
.media { position: relative; aspect-ratio: 16 / 9; background: #0b1224; border-radius: var(--radius); overflow: hidden; }
.media iframe, .media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media--doc { aspect-ratio: 3 / 4; background: var(--surface-2); border: 1px solid var(--line); }

/* 6. Formulaires --------------------------------------------------------- */
.form { display: grid; gap: 1.25rem; }
.form-row { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.form-section { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.form-section__title { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); margin-bottom: 1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding-top: .5rem; }

.field { display: grid; gap: .4rem; }
.field__label { font-weight: 600; font-size: .95rem; color: var(--ink); }
.field__label .req { color: var(--danger); margin-left: .15rem; }
.field__help { font-size: .87rem; color: var(--muted); margin: 0; }
.field__errors { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: .9rem; font-weight: 500; }
.field__errors li { display: flex; gap: .35rem; align-items: center; }
.field__errors li::before { content: "\F33A"; font-family: "bootstrap-icons"; }
.form-errors { margin-bottom: 0; }

.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: .6rem .85rem;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235d6474' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; }
.input::placeholder, .textarea::placeholder { color: #9399a6; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-soft); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
input[type="file"].input { padding: .5rem; min-height: auto; cursor: pointer; }
input[type="file"].input::file-selector-button { margin-right: .75rem; padding: .45rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); font: 600 .9rem var(--font-sans); color: var(--ink); cursor: pointer; }

.input-group { position: relative; display: flex; }
.input-group .input { padding-left: 2.6rem; }
.input-group > .bi { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-group__btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.check { display: flex; align-items: flex-start; gap: .65rem; cursor: pointer; font-size: .97rem; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.choices { display: grid; gap: .5rem; }
.choices--grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.choice { display: flex; align-items: center; gap: .65rem; padding: .7rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.choice:hover { border-color: var(--ink-soft); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
.choice input { width: 19px; height: 19px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }
.choice span { font-weight: 500; }
.choices__tools { display: flex; gap: .5rem; margin-top: .5rem; }

/* Interrupteur (statut de paiement) */
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .9rem; font-weight: 500; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background-color .2s; margin: 0; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked { background: var(--success); }
.switch input:checked::after { transform: translateX(18px); }

/* Page d'authentification */
.auth { display: grid; gap: clamp(20px, 3vw, 32px); align-items: start; }
@media (min-width: 900px) { .auth { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); } }
.auth__card { padding: clamp(24px, 4vw, 40px); }
.auth__card h1 { font-size: 1.7rem; }
.auth__aside { padding: clamp(22px, 3vw, 32px); }
.auth__aside h2 { font-family: var(--font-sans); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* 7. Espaces connectés (admin / élève / formateur) ----------------------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
@media (min-width: 961px) { .app { grid-template-columns: 264px minmax(0, 1fr); } }
.app__side { background: var(--surface); border-right: 1px solid var(--line); min-width: 0; }
.app__side-inner { position: sticky; top: var(--header-h); padding: 24px 16px; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
.app__main { padding: clamp(20px, 3.5vw, 40px); min-width: 0; }
.app__main > .container { padding: 0; }
.app__who { display: flex; align-items: center; gap: .75rem; padding: 0 8px 18px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.app__who strong { display: block; color: var(--ink); line-height: 1.25; }
.app__who span { font-size: .85rem; color: var(--muted); }

.side-nav { display: grid; gap: 2px; }
.side-nav__label { padding: 14px 10px 6px; font-size: .72rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.side-nav__link { display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: var(--radius-sm); color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .97rem; }
.side-nav__link .bi { font-size: 1.1rem; width: 1.25rem; text-align: center; color: var(--muted); }
.side-nav__link:hover { background: var(--primary-tint); color: var(--ink); }
.side-nav__link[aria-current="page"] { background: var(--primary); color: #fff; }
.side-nav__link[aria-current="page"] .bi { color: #e3c487; }

@media (max-width: 960px) {
  .app__side { border-right: 0; border-bottom: 1px solid var(--line); }
  .app__side-inner { position: static; max-height: none; padding: 10px var(--gutter); }
  .app__who { display: none; }
  .app__side-inner { min-width: 0; overflow: hidden; }
  .side-nav { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; padding-block: 4px; max-width: 100%; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .side-nav__link { scroll-snap-align: start; flex-shrink: 0; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav__label { display: none; }
  .side-nav__link { white-space: nowrap; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .92rem; }
}

/* Bandeau de bienvenue (élève) */
.welcome { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius-lg); color: #dfe4ef; background: radial-gradient(600px 240px at 100% 0, rgba(180, 138, 60, .3), transparent 70%), var(--ink); margin-bottom: 1.75rem; }
.welcome h1 { color: #fff; margin: 0; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.welcome p { margin: .25rem 0 0; color: #b9c1d3; }
.welcome .badge { background: rgba(255, 255, 255, .12); color: #fff; }

/* Emploi du temps */
.timetable { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.timetable th, .timetable td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 14px; vertical-align: top; text-align: left; }
.timetable th:last-child, .timetable td:last-child { border-right: 0; }
.timetable thead th { background: var(--surface-2); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.timetable tbody th { width: 110px; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: .95rem; }
.timetable tbody tr:last-child > * { border-bottom: 0; }
.slot { display: grid; gap: .3rem; }
.slot__subject { font-weight: 600; color: var(--ink); line-height: 1.35; }
.slot__who { font-size: .88rem; color: var(--muted); }
.slot__time { font-size: .82rem; color: var(--gold-text); font-weight: 600; }
.slot__empty { color: #b8b3a6; }
.timetable .is-today { background: #fffaf0; }
.timetable thead .is-today { color: var(--gold-text); }
.day-list .is-today { border-color: var(--gold); }
.day-list { display: none; }
@media (max-width: 760px) {
  .timetable-wrap { display: none; }
  .day-list { display: grid; gap: 1rem; }
}

/* Planning hebdomadaire (élève et admin) */
.week { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .week { grid-template-columns: repeat(var(--days, 5), minmax(0, 1fr)); } }
.week__day { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.week__day.is-today { border-color: var(--gold); background: #fffaf0; }
.week__title { font-family: var(--font-sans); font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); margin: 0 0 2px; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.week__slot { display: grid; gap: .35rem; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.week__slot .btn { justify-self: start; }
.week__empty { margin: 0; font-size: .9rem; color: #a39d8f; }
.week__add { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: .9rem; margin-top: auto; }
.week__add:hover { border-color: var(--gold); color: var(--ink); background: var(--surface); }

/* Message « vidéos sur Telegram » */
.telegram { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; padding: clamp(20px, 3vw, 28px); background: linear-gradient(135deg, #e8f4fc, #f4f9fd); border: 1px solid #c4e1f5; border-radius: var(--radius-lg); }
.telegram > div { flex: 1 1 280px; min-width: 0; }
.telegram strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: .25rem; }
.telegram p { margin: 0; color: var(--muted); }
.telegram__icon { display: grid; place-items: center; width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; background: #229ed9; color: #fff; font-size: 1.6rem; }
.telegram .btn--primary { --btn-bg: #229ed9; --btn-border: #229ed9; }
.telegram .btn--primary:hover { background: #1b8bc0; border-color: #1b8bc0; }
.telegram--compact { align-content: center; }
.telegram--compact .telegram__icon { width: 46px; height: 46px; font-size: 1.3rem; }

/* Emploi du temps (vue élève, façon document imprimé) */
@page emploi { size: A4 landscape; margin: 10mm; }
.timetable-head, .timetable-grid { page: emploi; }
.timetable-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.timetable-head h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); color: var(--ink); }
.timetable-head .eyebrow { margin-bottom: .35rem; }
.timetable-head__dates { margin: .25rem 0 0; font-family: var(--font-serif); font-style: italic; font-size: 1.1rem; color: var(--gold-text); }
.timetable-grid { overflow-x: auto; padding-bottom: 4px; }
.timetable-days { display: none; }
@media (max-width: 760px) {
  .timetable-grid { display: none; }
  .timetable-days { display: block; }
}

.tt {
  display: grid; min-width: 760px;
  grid-template-columns: 112px repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--rows), minmax(42px, auto));
  column-gap: 8px; row-gap: 0;
  padding: 18px 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.tt__day { padding: 6px 4px 14px; text-align: center; font-weight: 700; font-size: .95rem; letter-spacing: .04em; color: var(--ink); }
.tt__day span { display: block; font-weight: 500; font-size: .8rem; letter-spacing: 0; color: var(--muted); }
.tt__day.is-today, .tt__day.is-today span { color: var(--gold-text); }
.tt__col { border-radius: 10px; }
.tt__col.is-today { background: #fffaf0; outline: 1px dashed var(--gold); }
.tt__hour { align-self: center; padding-right: 10px; font-weight: 700; font-size: .92rem; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tt__line { border-top: 1px dashed var(--line); align-self: start; height: 0; }
.tt__slot {
  position: relative; z-index: 1; margin: 3px 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .15rem;
  padding: 10px 8px; text-align: center; border-radius: 6px;
  color: #17142a; font-size: .9rem; line-height: 1.3;
  box-shadow: 0 1px 2px rgba(20, 33, 61, .06);
}
.tt__slot strong { font-size: .95rem; font-weight: 700; }
.tt__time { font-variant-numeric: tabular-nums; }
.tt__join { margin-top: .35rem; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; background: rgba(255, 255, 255, .85); color: var(--ink); font-size: .8rem; font-weight: 600; text-decoration: none; border: 1px solid rgba(20, 33, 61, .12); }
.tt__join:hover { background: #fff; color: var(--primary); }
.tt__room { margin-top: .25rem; font-size: .8rem; font-weight: 600; }
/* Palette pastel (une couleur par matière) */
.tt-c0 { background: linear-gradient(90deg, #ece9f1, #dcb6f5); }
.tt-c1 { background: linear-gradient(90deg, #efe8fb, #c8b0fb); }
.tt-c2 { background: linear-gradient(90deg, #f0eaf2, #e2b9f4); }
.tt-c3 { background: linear-gradient(90deg, #e3f3ea, #b9e2c9); }
.tt-c4 { background: linear-gradient(90deg, #e8e4fd, #c2a9fb); }
.tt-c5 { background: linear-gradient(90deg, #dff1e6, #bfe5cc); }
.tt-c6 { background: linear-gradient(90deg, #fde9f7, #fbb6ec); }
.tt-c7 { background: linear-gradient(90deg, #fdf0e1, #f7cf9e); }
.tt-c8 { background: linear-gradient(90deg, #e2f0fb, #a9d1f5); }
.tt-c9 { background: linear-gradient(90deg, #f1ecf8, #d6b9f7); }

@media print {
  .timetable-grid { overflow: visible; }
  .timetable-days, .weeknav { display: none !important; }
  .timetable-grid { display: block !important; }
  .tt { min-width: 0; box-shadow: none; border: 0; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tt__join { display: none; }
  .timetable-head { margin-bottom: 8mm; }
}

/* Navigation entre les semaines */
.weeknav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 10px 12px; margin-bottom: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.weeknav__label { flex: 1 1 220px; text-align: center; color: var(--ink); font-size: 1rem; }
.week__date { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }

/* Onglets */
.tabs { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin-bottom: 1.5rem; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__link { white-space: nowrap; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .95rem; }
.tabs__link:hover { border-color: var(--ink-soft); color: var(--ink); }
.tabs__link[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Fenêtre de dialogue */
.dialog { width: min(560px, calc(100vw - 32px)); padding: clamp(20px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 30px 80px -20px rgba(20, 33, 61, .45); color: var(--text); }
.dialog::backdrop { background: rgba(20, 33, 61, .45); backdrop-filter: blur(2px); }

/* Pages légales */
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal p, .legal li { color: var(--text); }
.legal ul { margin: 0 0 1rem; }
.legal .todo { background: var(--warning-bg); color: var(--warning); padding: 0 .3rem; border-radius: 4px; font-weight: 600; }

/* 8. Liseuse (consultation sans téléchargement) -------------------------- */
.reader-page { background: #e9e6df; }
.reader { min-height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; }
.reader__bar { position: sticky; top: var(--header-h); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: 10px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.reader__title { min-width: 0; flex: 1 1 260px; }
.reader__title strong { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader__title span { font-size: .85rem; color: var(--muted); }
.reader__tools { display: flex; align-items: center; gap: .4rem; }
.reader__zoom { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--muted); }
.reader__stage {
  flex: 1; padding: clamp(16px, 3vw, 40px) 12px 80px; display: flex; flex-direction: column; align-items: center; gap: 20px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.reader__page { position: relative; background: #fff; box-shadow: 0 2px 6px rgba(20, 33, 61, .12), 0 18px 40px -20px rgba(20, 33, 61, .35); max-width: 100%; }
.reader__page canvas, .reader__page img { display: block; max-width: 100%; height: auto; pointer-events: none; }
.reader__page--docx { width: min(100%, 860px); padding: 0; overflow: hidden; }
.reader__page--docx .docx-wrapper { background: transparent !important; padding: 0 !important; }
.reader__page--docx .docx-wrapper > section.docx { box-shadow: none !important; margin: 0 auto !important; max-width: 100%; }
.reader__watermark {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2;
  background-image: var(--wm);
  background-repeat: repeat; background-size: 340px 200px; opacity: .9;
}
.reader__status { display: grid; place-items: center; gap: .75rem; padding: 64px 16px; color: var(--muted); text-align: center; }
.reader__notice { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media print {
  .reader, .reader-page main, .protected-media { display: none !important; }
  .reader-page::after { content: "L'impression des documents de la bibliothèque n'est pas autorisée."; display: block; padding: 2rem; font: 16px sans-serif; }
}

/* 9. Fiche d'inscription imprimable -------------------------------------- */
.sheet { max-width: 210mm; margin: 0 auto; background: #fff; color: #111; padding: clamp(18px, 4vw, 14mm); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 14px; line-height: 1.45; }
.sheet__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--ink); color: #fff; border-radius: 6px; }
.sheet__brand { display: flex; align-items: center; gap: 12px; }
.sheet__brand img { height: 40px; width: auto; background: #fff; border-radius: 4px; padding: 2px; }
.sheet__brand strong { display: block; font-family: var(--font-serif); font-size: 16px; }
.sheet__brand span, .sheet__num span { font-size: 12px; color: #c9cfdd; }
.sheet__num { text-align: right; }
.sheet__num strong { display: block; font-size: 16px; }
.sheet h1 { font-family: var(--font-sans); font-size: 17px; text-transform: uppercase; letter-spacing: .06em; text-align: center; margin: 18px 0 6px; }
.sheet__rule { border: 0; border-top: 2px solid var(--gold); margin: 6px 0 16px; }
.sheet h2 { font-family: var(--font-sans); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; color: var(--ink); }
.sheet__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 18px; margin: 0; }
@media (min-width: 560px) { .sheet__grid { grid-template-columns: 150px minmax(0, 1fr); } }
.sheet__grid dt { font-weight: 600; }
.sheet__grid dd { margin: 0 0 4px; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { border: 1px solid #d8d4ca; padding: 7px 9px; text-align: left; vertical-align: top; }
.sheet th { background: #f5f3ee; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.sheet__sign { display: grid; gap: 14px; margin-top: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .sheet__sign { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sheet__sign div { border: 1px dashed #bbb; min-height: 100px; padding: 10px; border-radius: 4px; }
.sheet__sign strong { display: block; font-size: 13px; margin-bottom: 4px; }
.sheet__sign .sheet__visa { position: relative; min-height: 130px; }
.sheet__approval { display: block; margin-top: 10px; font-style: italic; }
.sheet__esign { display: block; margin-top: 2px; font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 22px; color: #1d3f8f; }
.sheet__note { display: block; margin-top: 6px; font-size: 11px; color: #666; }
.sheet__stamp { position: absolute; right: 14px; bottom: 6px; width: 118px; height: 118px; transform: rotate(-8deg); opacity: .9; }
.sheet__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 16px; font-size: 12px; color: #555; }
.sheet .pill { display: inline-block; padding: 1px 8px; border: 1px solid #bbb; border-radius: 4px; font-size: 13px; }

@page { size: A4 portrait; margin: 10mm; }
@media print {
  body { background: #fff; display: block; }
  .site-header, .site-footer, .app__side, .no-print, .flashes { display: none !important; }
  .app { display: block; min-height: 0; }
  .app__main { padding: 0; }
  .sheet { border: 0; box-shadow: none; border-radius: 0; padding: 0; max-width: none; font-size: 11.5px; }
  .sheet__head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 10. Téléphones et petits écrans -------------------------------------- */
html, body { overflow-x: clip; }
h1, h2, h3, .dl dd, .table td, .alert, .list__title, .resource__title, .card__body, .slot__subject, .tile__title, .page-head__sub { overflow-wrap: anywhere; }
.list__item > div, .resource__main > div, .tile > span, .alert > div, .welcome > div, .cluster > *, .page-head > div { min-width: 0; }

@media (max-width: 960px) {
  .main-nav { max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .main-nav__actions .btn { width: 100%; }
}

@media (max-width: 720px) {
  .table--stack td.actions, .table .actions { white-space: normal; display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .25rem; }
  .table--stack td.actions > * + * { margin-left: 0; }
  .table--stack td.actions .btn { flex: 1 1 auto; }
  .table--stack .nowrap { white-space: normal; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 1rem; }
  .brand img { height: 38px; }
  .brand__name { font-size: 1.02rem; }
  .brand__name small { font-size: .66rem; }

  .btn { white-space: normal; text-align: center; line-height: 1.25; }
  .btn--sm { min-height: 40px; }
  .badge { white-space: normal; text-align: left; }

  .section { padding-block: 32px; }
  .section__head { margin-bottom: 1.25rem; }
  .card__body, .card__head, .card__foot { padding-left: 16px; padding-right: 16px; }
  .card__head { flex-wrap: wrap; }
  .app__main { padding: 18px 16px 32px; }

  /* Titres de page : actions en pleine largeur, faciles à toucher */
  .page-head { align-items: stretch; margin-bottom: 1.25rem; }
  .page-head > .btn, .page-head > .cluster { width: 100%; }
  .page-head > .cluster > .btn, .page-head > .cluster > form, .page-head > .cluster > form .btn { flex: 1 1 auto; }
  .form-actions > .btn, .form-actions > a.btn { flex: 1 1 100%; }
  .toolbar .cluster > .btn { flex: 1 1 auto; }
  .cta { padding: 24px 18px; }
  .cta .cluster, .cta .cluster > .btn { width: 100%; }
  .hero__lead { font-size: 1.02rem; }
  .hero__panel { padding: 20px; }
  .hero__facts strong { font-size: 1.15rem; }
  .hero .cluster > .btn { flex: 1 1 100%; }

  .welcome { gap: .9rem; }
  .welcome > div[style] { margin-left: 0 !important; }
  .tile { padding: 14px 16px; }
  .stat__value { font-size: 1.7rem; }
  .resource__actions .btn { flex: 1 1 auto; }
  .list__item { flex-wrap: wrap; }
  .list__end { margin-left: 0; }
  .week__slot .btn { justify-self: stretch; }

  .reader__bar { padding: 8px 12px; gap: .5rem; }
  .reader__title { flex-basis: calc(100% - 120px); order: 2; }
  .reader__tools { margin-left: auto; }
  .reader__stage { padding: 12px 6px 60px; }

  .sheet { font-size: 13px; }
  .sheet__head { flex-direction: column; align-items: flex-start; }
  .sheet__num { text-align: left; }
  .dialog { padding: 18px; }
}

@media (max-width: 380px) {
  .brand__name small { display: none; }
  .hero__facts { gap: .5rem; }
  .hero__facts strong { font-size: 1rem; }
  .side-nav__link { font-size: .88rem; padding: .45rem .7rem; }
}

/* 11. Utilitaires -------------------------------------------------------- */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-small { font-size: .9rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2.5rem; }
.w-100 { width: 100%; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.hidden { display: none !important; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
@media (min-width: 961px) { .hide-lg { display: none !important; } }
