/* Espace étudiant — style inspiré du Système de Design de l'État (DSFR).
   NB : le DSFR officiel (Marianne, bloc « République Française ») est réservé
   aux services de l'État ; on en reprend ici les conventions visuelles avec
   l'identité de l'établissement (table Grist ETABLISSEMENT via /api/config). */

:root {
  --bleu: #000091;
  --bleu-hover: #1212ff;
  --rouge: #ce0500;
  --gris-fond: #f6f6f6;
  --gris-contraste: #eeeeee;
  --gris-bordure: #ddd;
  --bordure-champ: #3a3a3a;
  --texte: #161616;
  --texte-doux: #666;
  --blanc: #fff;
  --radius: 0;
  --focus: #0a76f6;
  --info: #0063cb;
  --info-bg: #e8edff;
  --succes: #18753c;
  --succes-bg: #b8fec9;
  --alerte: #b34000;
  --alerte-bg: #ffe9e6;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Marianne", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--gris-fond);
  color: var(--texte);
  line-height: 1.5;
}

h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 1rem; }

.subtitle { color: var(--texte-doux); margin: 0.2rem 0 0; font-size: 0.95rem; }

.student-contact { color: var(--texte-doux); margin: 0.15rem 0 0; font-size: 0.85rem; }
.student-contact .btn-link { margin-left: 0.6rem; }

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.screen > .content, .screen > .login-wrap { flex: 1; }

a { color: var(--bleu); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- En-tête institutionnel (façon fr-header) ---------- */

.fr-header {
  background: var(--blanc);
  box-shadow: 0 1px 0 0 var(--gris-bordure), 0 8px 8px -8px rgba(0, 0, 0, 0.10);
  position: relative;
  z-index: 2;
}

.fr-header-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Bloc-marque de l'établissement (rempli dynamiquement via /api/config) */
.brand-block { display: flex; align-items: center; gap: 1.25rem; min-width: 0; }

/* Monogramme d'application (généré par layout.js) : masqué en thème public
   (DSFR) ; stylé en thème moderne (voir theme-modern.css). */
.brand-mark { display: none; }

/* Logo de l'établissement (pièce jointe Grist, table ETABLISSEMENT) */
.js-etab-logo {
  display: block;
  max-height: 4.5rem;
  max-width: 11rem;
  object-fit: contain;
}
.fr-footer .js-etab-logo { max-height: 3rem; }

.brand-logo {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  max-width: 11rem;
}
.brand-logo .js-etab-nom { display: block; }
.brand-logo .motto {
  display: block;
  font-weight: 400;
  font-style: italic;
  font-size: 0.62rem;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0.2rem;
}

.brand-service .service-title {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--texte);
}
.brand-service .service-title a { color: inherit; text-decoration: none; }
.brand-service .service-tagline {
  font-size: 0.8rem;
  color: var(--texte-doux);
  margin-top: 0.1rem;
}

.fr-header-tools {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.fr-header-tools a { text-decoration: none; }

/* ---------- Bandeau d'information (façon fr-notice) ---------- */

.fr-notice { background: var(--info-bg); color: var(--texte); }
.fr-notice-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.55rem 1.5rem;
  font-size: 0.85rem;
}

/* ---------- Connexion ---------- */

.login-wrap { padding: 2.5rem 1.5rem 3.5rem; }
.login-inner { max-width: 40rem; margin: 0 auto; }
.login-inner h1 { margin: 0 0 0.5rem; }
.login-inner .lead { color: var(--texte-doux); margin: 0 0 1.5rem; }

.login-card {
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
  padding: 2rem;
  width: 100%;
}
.login-card h2 { font-size: 1.2rem; margin: 0 0 1.25rem; }

.login-card form { display: flex; flex-direction: column; gap: 0.75rem; }

.login-sep {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0; color: var(--texte-doux); font-size: 0.875rem;
}
.login-sep::before, .login-sep::after {
  content: ""; flex: 1; border-top: 1px solid var(--gris-bordure);
}

.hint { font-size: 0.8rem; color: var(--texte-doux); margin-top: 1.25rem; }

.login-privacy {
  font-size: 0.8rem; color: var(--texte-doux);
  margin-top: 1.75rem; padding-top: 1rem;
  border-top: 1px solid var(--gris-bordure);
}

/* Tuiles d'accès secondaires (façon fr-tile) */
.fr-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.25rem; }
.fr-tile {
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
  border-bottom: 4px solid var(--bleu);
  padding: 1.1rem 1.25rem;
}
.fr-tile:hover { background: var(--gris-fond); }
.fr-tile h3 { font-size: 1rem; margin: 0 0 0.25rem; }
.fr-tile h3 a { color: var(--texte); text-decoration: none; }
.fr-tile h3 a::after { content: " →"; color: var(--bleu); }
.fr-tile p { font-size: 0.85rem; color: var(--texte-doux); margin: 0; }

/* ---------- Page d'accueil (écran de connexion d'index.html) ----------
   Objectif : qu'un étudiant qui arrive sans contexte comprenne d'emblée
   sur quel site il est et ce qu'il peut y faire, sans perdre l'accès
   direct au formulaire de connexion (colonne de droite sur grand écran).
   Les nouveaux blocs n'utilisent que les jetons existants (dont
   var(--radius) : 0 en thème public, 14px en thème moderne), donc ils
   suivent les deux habillages et le mode sombre sans réglage dédié. */

.home-inner { max-width: 68rem; margin: 0 auto; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(21rem, 0.95fr);
  gap: 2.5rem;
  align-items: start;
}

.home-eyebrow {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.5rem; margin: 0 0 0.75rem;
}
.home-etab {
  font-size: 0.8rem; font-weight: 600; color: var(--texte-doux);
  text-transform: uppercase; letter-spacing: 0.02em;
}

.home-hero h1 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.25rem); line-height: 1.2; }

.home-lead { font-size: 1.05rem; color: var(--texte-doux); margin: 0.75rem 0 0; }

.home-checks { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.home-checks li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.home-checks li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  font-weight: 700;
  color: var(--bleu);
}

.home-cta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.home-cta .btn { text-decoration: none; }
/* Sur grand écran, le formulaire est déjà à côté : l'ancre ne sert qu'en
   version empilée (mobile), où la connexion passe sous le texte. */
.home-cta-jump { display: none; }

.home-login-note {
  font-size: 0.85rem; color: var(--texte-doux);
  margin: 0.75rem 0 0; text-align: center;
}

.home-section { margin-top: 3rem; }
.home-section > h2 { font-size: 1.3rem; margin: 0 0 1rem; }
.home-section h3 { font-size: 1rem; margin: 0 0 0.3rem; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1rem;
}
.home-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); }
/* Posé sur le fond gris de la page, un fr-callout doit rester détaché :
   fond blanc + filet, là où il s'appuie d'ordinaire sur une carte blanche. */
.home-grid-2 .fr-callout {
  margin: 0;
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
  border-left: 4px solid var(--bleu);
  border-radius: var(--radius);
}

.home-card {
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.home-card p { font-size: 0.875rem; color: var(--texte-doux); margin: 0; }
.home-card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  margin-bottom: 0.7rem;
  background: var(--info-bg);
  border-radius: 0.25rem;
  font-size: 1.1rem;
  line-height: 1;
}

.home-steps {
  list-style: none; counter-reset: home-step;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 1rem;
}
.home-steps li {
  counter-increment: home-step;
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
  border-left: 4px solid var(--bleu);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.home-steps li::before {
  content: counter(home-step);
  display: flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem;
  margin-bottom: 0.6rem;
  background: var(--bleu); color: var(--blanc);
  border-radius: 50%;
  font-size: 0.85rem; font-weight: 700;
}
.home-steps p { font-size: 0.875rem; color: var(--texte-doux); margin: 0 0 0.4rem; }
.home-steps p:last-child { margin-bottom: 0; }
.home-steps a { color: var(--bleu); }

.home-more { font-size: 0.875rem; color: var(--texte-doux); margin: 1rem 0 0; }

.home .login-privacy { margin-top: 3rem; }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; gap: 2rem; }
  .home-cta-jump { display: inline-block; }
}

/* Mise en avant (façon fr-callout) */
.fr-callout {
  background: var(--gris-fond);
  border-left: 4px solid var(--bleu);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 0;
  font-size: 0.875rem;
}
.fr-callout .fr-callout-title { font-weight: 700; margin: 0 0 0.25rem; }
.fr-callout p { margin: 0; }

/* ---------- Formulaires ---------- */

label { font-weight: 600; font-size: 0.9rem; }
label .fr-hint-text {
  display: block; font-weight: 400; font-size: 0.75rem;
  color: var(--texte-doux); margin-top: 0.15rem;
}

input, textarea, select {
  font: inherit;
  padding: 0.55rem 0.75rem;
  background: var(--gris-contraste);
  border: none;
  border-radius: 0.25rem 0.25rem 0 0;
  box-shadow: inset 0 -2px 0 0 var(--bordure-champ);
  width: 100%;
  color: var(--texte);
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  background: initial;
  box-shadow: none;
  accent-color: var(--bleu);
}

.error { color: var(--rouge); font-size: 0.9rem; margin: 0.25rem 0 0; }

/* ---------- Boutons (façon fr-btn, angles droits) ---------- */

.btn {
  font: inherit;
  font-weight: 500;
  padding: 0.55rem 1.25rem;
  border-radius: 0;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary { background: var(--bleu); color: #f5f5fe; }
.btn-primary:hover { background: var(--bleu-hover); }
.btn-primary:disabled { background: #999; cursor: wait; }

.btn-ghost { background: transparent; color: var(--bleu); }
.btn-ghost:hover { background: rgba(0, 0, 145, 0.06); }

/* Action secondaire cerclée (façon fr-btn--secondary) : le liseré est posé
   en box-shadow pour ne pas changer la hauteur d'un .btn sans bordure. */
.btn-secondary { background: transparent; color: var(--bleu); box-shadow: inset 0 0 0 1px currentColor; }
.btn-secondary:hover { background: rgba(0, 0, 145, 0.06); }

.btn-danger { background: transparent; color: #c9191e; border: 1px solid #c9191e; }
.btn-danger:hover { background: rgba(201, 25, 30, 0.08); }

.btn-link {
  background: none; border: none; color: var(--bleu);
  text-decoration: underline; cursor: pointer; font-size: 0.85rem;
}

/* ---------- Barre de contexte des écrans applicatifs ---------- */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--blanc);
  border-bottom: 1px solid var(--gris-bordure);
  padding: 0.8rem 1.5rem;
}

.header-actions { display: flex; gap: 0.25rem; align-items: center; }

/* Titre de page dans le contenu */
.page-title { margin: 0.5rem 0 0.25rem; }
.page-title h1 { font-size: 1.5rem; }

/* ---------- Contenu ---------- */

.content {
  width: 100%;
  max-width: 900px;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* Espace étudiant : un peu plus de respiration entre les sections que sur
   les écrans plus denses (cadre, admin). */
#app-screen .content { gap: 1.75rem; }

.empty {
  text-align: center;
  color: var(--texte-doux);
  padding: 2rem 1rem;
}

/* ---------- Période de stage ---------- */

.periode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--gris-bordure);
}
.periode-tabs:empty { display: none; }

.periode-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  background: var(--gris-contraste);
  border: 1px solid var(--gris-bordure);
  border-bottom: none;
  border-radius: 0.25rem 0.25rem 0 0;
  padding: 0.5rem 0.9rem;
  margin-bottom: -1px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.periode-tab:hover { background: var(--gris-fond); }
.periode-tab.active {
  background: var(--blanc);
  box-shadow: inset 0 2px 0 0 var(--bleu);
}
.periode-tab.active .tab-service { color: var(--bleu); }
.tab-service { font-weight: 700; font-size: 0.9rem; }
.tab-dates {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--texte-doux);
}
.tab-dates .badge { font-size: 0.6rem; padding: 0.05rem 0.35rem; }

.periode-card {
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
  padding: 1.25rem 1.5rem;
}

.periode-service { font-weight: 700; font-size: 1.1rem; }
.periode-dates { color: var(--texte-doux); font-size: 0.9rem; margin-top: 0.2rem; }

/* Indicateurs chiffrés (heures effectuées / à réaliser / solde) : de simples
   nombres mis en valeur plutôt que des badges, pour ne pas noyer les alertes
   ci-dessous sous une rangée de pastilles toutes identiques. */
.periode-kpis { display: flex; flex-wrap: wrap; gap: 1.75rem; margin-top: 1.1rem; }
.periode-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.periode-kpi-value.ok { color: var(--succes); }
.periode-kpi-value.warn { color: var(--rouge); }
.periode-kpi-label { font-size: 0.78rem; color: var(--texte-doux); margin-top: 0.1rem; }

/* Alertes ponctuelles (récupération à poser, absences, présence, franchise) :
   gardent le badge, réservé désormais à ce qui mérite vraiment l'attention. */
.periode-alerts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }

.periode-cadre {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--texte-doux);
}
.periode-cadre strong { color: var(--texte); }

/* Stage terminé : rappel à la place du bouton « + Déclarer » */
.closed-note {
  background: var(--alerte-bg);
  border-left: 4px solid var(--alerte);
  padding: 0.6rem 0.9rem;
}

/* Accès au questionnaire de satisfaction et prise de rendez-vous, en bas de
   la carte de période : un seul filet au-dessus de la zone d'action, pas un
   par bouton, pour que les deux CTA restent groupés visuellement. */
.periode-eval,
.periode-rdv {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gris-bordure);
}
.periode-rdv + .periode-eval {
  margin-top: 0.6rem;
  padding-top: 0;
  border-top: none;
}
.periode-eval .btn,
.periode-rdv .btn { text-decoration: none; display: inline-flex; align-items: center; }
.eval-note { margin: 0.5rem 0 0; font-size: 0.82rem; color: var(--texte-doux); }
.periode-eval .eval-note:only-child { margin-top: 0; }

.cadre-label { color: var(--texte-doux); }
.cadre-link { color: var(--bleu); text-decoration: none; white-space: nowrap; }
.cadre-link:hover { text-decoration: underline; }

.cadre-contact {
  background: var(--info-bg);
  border-left: 4px solid var(--info);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.cadre-contact a { color: var(--bleu); white-space: nowrap; }

/* ---------- Badges (façon fr-badge : majuscules, angles doux) ---------- */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  background: var(--gris-contraste);
  border: none;
  color: var(--texte);
}

.badge.info { background: var(--info-bg); color: var(--info); }
.badge.ok { background: var(--succes-bg); color: var(--succes); }
.badge.warn { background: #ffe9e9; color: var(--rouge); }
.badge.pending { background: var(--alerte-bg); color: var(--alerte); }

/* ---------- Mon planning du jour ---------- */

.today-card {
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
  padding: 1.25rem 1.5rem;
}

.today-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.today-date { font-weight: 700; font-size: 1.05rem; }
.today-service { color: var(--texte-doux); font-size: 0.9rem; }

.today-journee {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.today-journee.repos { color: var(--texte-doux); font-size: 0.9rem; }

.today-code {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--bleu);
  background: var(--info-bg);
  border-radius: 0.25rem;
  padding: 0.2rem 0.6rem;
}
.today-libelle { font-weight: 600; }
.today-horaires {
  font-size: 0.9rem;
  color: var(--texte-doux);
  font-variant-numeric: tabular-nums;
}
/* Les marques (heures comptées, férié) se calent à droite quand la place le
   permet, et repassent à la ligne sinon. */
.today-marques { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-left: auto; }

.today-bloc {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--gris-bordure);
}

.today-bloc-titre {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--texte-doux);
}
.today-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.2rem 0;
}
.today-item-titre { font-weight: 600; }
.today-item-meta { font-size: 0.85rem; color: var(--texte-doux); }

/* ---------- Semaines ---------- */

#weeks { display: flex; flex-direction: column; gap: 1rem; }

.week-card {
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
  padding: 1rem 1.25rem;
}

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.week-header h3 { margin: 0; font-size: 1rem; }
.week-total { font-weight: 700; color: var(--bleu); }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.day-cell.today .day-label { color: var(--bleu); }

.day-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.day-cell.readonly {
  background: var(--gris-fond);
  border-radius: 0;
  padding: 0.4rem;
  text-align: center;
}
.day-cell.today.readonly {
  box-shadow: inset 0 2px 0 0 var(--bleu);
  background: var(--info-bg);
}

.day-chip {
  font-weight: 700;
  font-size: 1rem;
  color: var(--bleu);
  margin-top: 0.2rem;
}

.day-hours { font-size: 0.72rem; color: var(--texte-doux); font-weight: 600; }

/* Créneau horaire du code, sous le code lui-même */
.day-time {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.7rem;
  color: var(--texte-doux);
  font-variant-numeric: tabular-nums;
}

.day-cell.ferie {
  background: var(--alerte-bg);
  outline: 1px solid #ffd9a0;
}
.ferie-tag {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--alerte);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.day-cell.ferie .day-hours,
.day-cell.ferie .day-time { color: var(--alerte); }

.day-cell.recup {
  background: var(--succes-bg);
  outline: 1px solid #b8eec6;
}
.recup-tag {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--succes);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.week-comment {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--texte-doux);
  font-style: italic;
}

/* ---------- Sections ---------- */

.content section h2 { font-size: 1.15rem; margin: 0.5rem 0; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.section-note { font-size: 0.85rem; color: var(--texte-doux); margin: 0.25rem 0 0.75rem; }

/* ---------- Listes (rendez-vous, déclarations, évaluations & tests) ----------
   Une seule carte par liste, les lignes séparées par un filet plutôt que
   chacune dans sa propre boîte : moins de bordures empilées, plus léger. */

.list-card {
  background: var(--blanc);
  border: 1px solid var(--gris-bordure);
}

.rdv-item,
.sortie-row {
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--gris-bordure);
}
.rdv-item:last-child,
.sortie-row:last-child { border-bottom: none; }
.rdv-item:hover,
.sortie-row:hover { background: var(--gris-fond); }

.sortie-hours { min-width: 4rem; text-align: center; }
.sortie-main { flex: 1; }
.sortie-title { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sortie-meta { font-size: 0.85rem; color: var(--texte-doux); }

.sortie-delete {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: 0.3rem; border-radius: 0;
}
.sortie-delete:hover { background: var(--gris-fond); }

/* ---------- Mes résultats (évaluations de stage + tests de connaissances) ---------- */

.eval-rep { padding: 0.5rem 0; border-bottom: 1px solid var(--gris-bordure); }
.eval-rep:last-child { border-bottom: none; }
.eval-rep label { font-weight: 600; display: block; margin-bottom: 0.3rem; }

#test-dialog, #test-resultat-dialog, #eval-dialog { max-width: 560px; max-height: 85vh; overflow-y: auto; }
#test-questions { display: flex; flex-direction: column; gap: 0.9rem; }

/* ---------- Rendez-vous du stage ---------- */

/* Un rendez-vous passé reste consultable, mais ne doit plus attirer l'œil. */
.rdv-item.passe { opacity: 0.6; }
.rdv-date { min-width: 9rem; font-weight: 600; }
.rdv-corps { flex: 1; }
.rdv-titre { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rdv-meta { font-size: 0.85rem; color: var(--texte-doux); }

@media (max-width: 640px) {
  .rdv-item { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .rdv-date { min-width: 0; }
  /* Sept colonnes sur un écran de téléphone : le créneau passe sur deux
     lignes plutôt que de déborder de sa case. */
  .day-time { flex-direction: column; gap: 0; line-height: 1.15; }
  .day-time-sep { display: none; }
  .today-marques { margin-left: 0; }
}

/* ---------- Dialogue ---------- */

dialog {
  border: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
}

dialog::backdrop { background: rgba(22, 22, 22, 0.55); }

dialog form { display: flex; flex-direction: column; gap: 0.6rem; }

dialog h2 { margin: 0 0 0.5rem; }

.type-options { display: flex; flex-direction: column; gap: 0.5rem; }

.type-option {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border: 1px solid var(--gris-bordure);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-weight: 400;
}

.type-option:has(input:checked) {
  border-color: var(--bleu);
  outline: 1px solid var(--bleu);
  background: rgba(0, 0, 145, 0.03);
}

.type-option input { width: auto; margin-top: 0.2rem; }
.type-option small { display: block; color: var(--texte-doux); }

.optional { font-weight: 400; color: var(--texte-doux); font-size: 0.85em; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin-top: 0.5rem;
}
.checkbox-label input { width: auto; }

.row { display: flex; gap: 0.75rem; }
.row > div { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ---------- Entrée en stage ---------- */

.login-inner.wide { max-width: 46rem; }
.login-card.wide { max-width: none; }

.login-card.wide form h2,
.login-card form h2 {
  font-size: 1rem;
  margin: 1rem 0 0.25rem;
  color: var(--bleu);
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}

.code-display {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-align: center;
  color: var(--bleu);
  background: var(--gris-fond);
  border: 1px solid var(--gris-bordure);
  padding: 0.75rem;
  margin: 1rem 0;
}

.btn-block {
  display: block;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 720px) {
  .week-grid { grid-template-columns: repeat(4, 1fr); }
  .fr-tiles { grid-template-columns: 1fr; }
  .fr-header-body { padding: 0.75rem 1rem; gap: 0.75rem; }
  .fr-header-tools { margin-left: 0; }
}

/* ---------- Pied de page (façon fr-footer) ---------- */

.fr-footer {
  border-top: 2px solid var(--bleu);
  background: var(--blanc);
  padding: 1.6rem 1.5rem 1.25rem;
  margin-top: auto;
}

.fr-footer-inner { max-width: 1200px; margin: 0 auto; }

.fr-footer-top {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.fr-footer-desc {
  font-size: 0.85rem;
  color: var(--texte-doux);
  max-width: 36rem;
  margin: 0;
  line-height: 1.6;
}

.fr-footer-links {
  margin: 1.25rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--gris-bordure);
  font-size: 0.75rem;
  color: var(--texte-doux);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.fr-footer-links a { color: var(--texte-doux); text-decoration: none; }
.fr-footer-links a:hover { text-decoration: underline; }
.fr-footer-links .sep { color: var(--gris-bordure); }

.fr-footer-mention {
  font-size: 0.75rem;
  color: var(--texte-doux);
  margin: 0.75rem 0 0;
}

/* Ancien pied de page (conservé pour compatibilité éventuelle) */
.app-footer {
  text-align: center;
  color: var(--texte-doux);
  font-size: 0.78rem;
  padding: 1.5rem 1rem 2rem;
  line-height: 1.6;
}

.beta-tag {
  display: inline-block;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--alerte);
  background: var(--alerte-bg);
  border-radius: 0.25rem;
  padding: 0.1rem 0.5rem;
}

/* ---------- Mode sombre ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bleu: #8585f6;
    --bleu-hover: #a3a3fb;
    --rouge: #ff5655;
    --gris-fond: #161616;
    --gris-contraste: #2a2a2a;
    --gris-bordure: #3a3a3a;
    --bordure-champ: #9c9c9c;
    --texte: #e6e6e6;
    --texte-doux: #a5a5a5;
    --blanc: #242424;
    --info: #9db4ff;
    --info-bg: #1a2c5c;
    --succes: #7ee2a0;
    --succes-bg: #123c22;
    --alerte: #ffcf87;
    --alerte-bg: #4a2f00;
  }
  .badge.warn { background: #4a1210; color: #ffb3b0; }
  .day-cell.ferie { background: #3a2a10; outline-color: #6b4a1a; }
  .ferie-tag, .day-cell.ferie .day-hours, .day-cell.ferie .day-time { color: #ffb377; }
  .day-cell.recup { background: #123c22; outline-color: #1d5c35; }
  .recup-tag { color: #7ee2a0; }
  .type-option:has(input:checked) { background: rgba(133, 133, 246, 0.08); }
  .btn-primary { color: #0b0b0b; }
  .fr-header { box-shadow: 0 1px 0 0 var(--gris-bordure); }
  /* Un logo couleur reste lisible sur une pastille claire en mode sombre */
  .js-etab-logo { background: #f5f5fe; padding: 0.3rem; }
}

/* ---------- Impression / export PDF ---------- */

@media print {
  body { background: #fff; }
  .fr-header, .fr-notice, .fr-footer, .app-header, .app-footer,
  .header-actions, .fr-header-tools, #add-sortie-btn, .sortie-delete,
  .periode-tabs, #login-screen, dialog, .periode-eval, .periode-rdv { display: none !important; }
  .periode-card, .week-card, .list-card, .today-card { border: 1px solid #999; }
  .week-card { break-inside: avoid; }
  .content { max-width: none; margin: 0; }
}
