/* Espace apprentis Boost Up Academy — présentation sobre, type document administratif */
:root {
  --marine: #1F3864;
  --bleu: #2E75B6;
  --texte: #1b1f24;
  --texte-2: #555c66;
  --trait: #d3d7de;
  --trait-fort: #9aa3af;
  --fond: #ffffff;
  --fond-2: #f7f8fa;
  --erreur: #9b1c1c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: .9375rem/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--bleu); }
a:hover { color: var(--marine); }
h1 { font-size: 1.45rem; font-weight: 600; color: var(--marine); margin: 0 0 .6rem; }
h2 { font-size: 1.1rem; font-weight: 600; color: var(--marine); margin: 1.6rem 0 .5rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.2rem 0 .4rem; }
p { margin: .4rem 0 .7rem; }
.discret { color: var(--texte-2); font-size: .86rem; }
.masque { position: absolute; left: -9999px; }
.inline { display: inline; margin: 0; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* En-tête et pied */
.entete { border-bottom: 1px solid var(--trait); border-top: 3px solid var(--marine); background: var(--fond); }
.entete-int { max-width: 1180px; margin: 0 auto; padding: .55rem 1rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.marque { text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; }
.marque-nom { color: var(--marine); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .92rem; }
.marque-sous { color: var(--texte-2); font-size: .8rem; }
.nav { display: flex; gap: .2rem 1rem; flex-wrap: wrap; align-items: center; font-size: .9rem; }
.nav a { color: var(--texte); text-decoration: none; }
.nav a:hover { color: var(--bleu); text-decoration: underline; }
.pied { border-top: 1px solid var(--trait); margin-top: 2.5rem; }
.pied-int { max-width: 1180px; margin: 0 auto; padding: .8rem 1rem; color: var(--texte-2); font-size: .8rem; }

.page { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1rem; }
.page.etroite { max-width: 460px; padding-top: 3rem; }
.page.lecture { max-width: 780px; }
.intro { color: var(--texte-2); }

/* Boutons et formulaires */
.bouton {
  font: inherit; font-size: .92rem; padding: .45rem .9rem; border: 1px solid var(--marine); background: var(--fond);
  color: var(--marine); border-radius: 3px; cursor: pointer; white-space: nowrap;
}
.bouton:hover { background: var(--fond-2); }
.bouton.principal { background: var(--marine); color: #fff; }
.bouton.principal:hover { background: #172b4d; }
.bouton:disabled { opacity: .55; cursor: default; }
.bouton.petit { padding: .2rem .55rem; font-size: .82rem; }
.lien, .lien-discret { font: inherit; background: none; border: 0; padding: 0; color: var(--bleu); cursor: pointer; text-decoration: underline; }
.lien { color: var(--texte); text-decoration: none; font-size: .9rem; }
.lien:hover { color: var(--bleu); text-decoration: underline; }
.lien-discret { font-size: .84rem; color: var(--texte-2); }
.formulaire { display: flex; flex-direction: column; gap: .3rem; margin: 1rem 0; }
.formulaire label, .champ label { font-size: .88rem; font-weight: 600; margin-top: .5rem; }
.formulaire button { margin-top: 1rem; align-self: flex-start; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  font: inherit; padding: .45rem .55rem; border: 1px solid var(--trait-fort); border-radius: 3px; background: #fff; color: var(--texte); width: 100%;
}
textarea { resize: vertical; }
.ligne-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin: .6rem 0 1rem; }
.ligne-form .champ { display: flex; flex-direction: column; min-width: 140px; flex: 1 1 140px; }
.ligne-form .champ label { margin-top: 0; font-weight: 600; font-size: .82rem; }
.flash { border-left: 3px solid var(--marine); padding: .35rem .7rem; margin: 0 0 1rem; }
.avertissement { border-left: 3px solid #a15c00; padding: .35rem .7rem; margin: 0 0 1rem; font-size: .9rem; }
.erreur { color: var(--erreur); border-left: 3px solid var(--erreur); padding: .3rem .7rem; }

/* Tableaux */
table { border-collapse: collapse; width: 100%; font-size: .9rem; margin: .5rem 0 1.2rem; }
th, td { border-bottom: 1px solid var(--trait); padding: .4rem .5rem; text-align: left; vertical-align: top; }
th { font-weight: 600; color: var(--marine); border-bottom: 2px solid var(--marine); white-space: nowrap; }
td.nombre, th.nombre { text-align: right; white-space: nowrap; }
tr.inactif td { color: var(--texte-2); }
.table-defile { overflow-x: auto; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); margin: 1rem 0 1.5rem; }
.chiffres div { padding: .7rem .8rem; border-right: 1px solid var(--trait); }
.chiffres div:last-child { border-right: 0; }
.chiffres strong { display: block; font-size: 1.5rem; font-weight: 600; color: var(--marine); }
.chiffres span { color: var(--texte-2); font-size: .85rem; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 900px) { .deux-colonnes { grid-template-columns: 1fr; } }
.fiche { border-top: 1px solid var(--trait); padding: .7rem 0; }
.meta { color: var(--texte-2); font-size: .85rem; margin: 0 0 .3rem; }
.texte { white-space: pre-wrap; margin: 0 0 .4rem; }
.reponse-formateur { border-left: 3px solid var(--marine); padding-left: .7rem; }
.lien-acces { font-size: .85rem; letter-spacing: 0; word-break: break-all; }
.code-acces { font-family: Consolas, "Courier New", monospace; font-size: 1.1rem; letter-spacing: .08em; }
.encadre-code { border: 1px solid var(--trait-fort); padding: .7rem 1rem; margin: 0 0 1.2rem; }
.etat { font-size: .82rem; white-space: nowrap; }
details summary { cursor: pointer; color: var(--bleu); font-size: .85rem; }
.question-cellule { max-width: 420px; }
.onglets { display: flex; gap: 1rem; border-bottom: 1px solid var(--trait); margin-bottom: 1rem; font-size: .92rem; }
.onglets a { padding: .3rem 0; text-decoration: none; color: var(--texte); }
.onglets a[aria-current] { border-bottom: 2px solid var(--marine); color: var(--marine); font-weight: 600; }

/* ---------------- Discussion ---------------- */
.chat-page { max-width: 860px; margin: 0 auto; padding: 1rem 1rem 0; }
.chat { display: flex; flex-direction: column; min-height: calc(100vh - 80px); }
.chat-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--trait); padding-bottom: .6rem; }
.chat-titre { font-size: 1.3rem; margin: 0; }
.chat-sous-titre { margin: .15rem 0 0; color: var(--texte-2); font-size: .9rem; }
.chat-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.etiquette-ia { font-size: .7rem; font-weight: 600; border: 1px solid var(--marine); color: var(--marine); padding: 0 .35rem; border-radius: 2px; vertical-align: middle; letter-spacing: .05em; }
.apercu { font-size: .85rem; color: var(--texte-2); border-bottom: 1px solid var(--trait); padding: .4rem 0; margin: 0; }
.apercu a[aria-current] { font-weight: 700; color: var(--marine); }
.fil { flex: 1; padding: .6rem 0 1rem; }
.msg { padding: .7rem 0 .6rem; border-bottom: 1px solid #eceef2; }
.msg-auteur { font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-2); margin: 0 0 .2rem; }
.msg-assistant .msg-auteur { color: var(--marine); }
.msg-apprenti { padding-left: 18%; }
.msg-apprenti .msg-texte { border-left: 2px solid var(--trait-fort); padding-left: .7rem; }
.msg-texte p { margin: .3rem 0 .55rem; }
.msg-texte ul { margin: .2rem 0 .6rem 1.1rem; padding: 0; }
.msg-quiz .msg-texte { border-left: 3px solid var(--marine); padding-left: .7rem; }
.msg-systeme .msg-texte { border-left: 3px solid var(--bleu); padding-left: .7rem; }
.attente .msg-texte { color: var(--texte-2); font-style: italic; }
.sources { margin: .3rem 0 .2rem; font-size: .86rem; }
.sources-titre { font-weight: 600; margin: 0 0 .15rem; font-size: .8rem; color: var(--texte-2); text-transform: uppercase; letter-spacing: .05em; }
.sources ol { margin: 0 0 0 1.2rem; padding: 0; }
.sources li { margin: .1rem 0; }
.source-libelle { color: var(--marine); }
.sources blockquote { margin: .3rem 0 .4rem; padding-left: .7rem; border-left: 2px solid var(--trait); color: var(--texte-2); }
.msg-pied { margin: .3rem 0 0; display: flex; gap: .2rem 1rem; flex-wrap: wrap; justify-content: space-between; }
.suggestions { padding: .8rem 0; display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.suggestions-titre { margin: 0; font-size: .85rem; color: var(--texte-2); }
.suggestion { font: inherit; font-size: .92rem; text-align: left; background: #fff; border: 1px solid var(--trait-fort); border-radius: 3px; padding: .4rem .7rem; color: var(--texte); cursor: pointer; }
.suggestion:hover { border-color: var(--marine); color: var(--marine); }
.saisie { position: sticky; bottom: 0; background: var(--fond); border-top: 1px solid var(--trait); padding: .7rem 0 .9rem; }
.saisie textarea { font-size: 1rem; min-height: 4.6rem; border-color: var(--trait-fort); }
.saisie textarea:focus { border-color: var(--marine); }
.saisie-pied { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .45rem; }
.dialogue { border: 1px solid var(--trait-fort); border-radius: 4px; padding: 1.1rem 1.3rem; max-width: 560px; width: calc(100% - 2rem); }
.dialogue::backdrop { background: rgba(20, 30, 50, .35); }
.dialogue h2 { margin-top: 0; }
.dialogue label { font-weight: 600; font-size: .88rem; display: block; margin: .6rem 0 .25rem; }
.dialogue-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .9rem; }

/* Petite fenêtre (future bulle Métis) */
body.compact { font-size: .875rem; }
body.compact .chat-page { padding: .5rem .7rem 0; }
body.compact .chat { min-height: 100vh; }
body.compact .chat-titre { font-size: 1.02rem; }
body.compact .chat-sous-titre { font-size: .8rem; }
body.compact .msg-apprenti { padding-left: 8%; }
body.compact .saisie textarea { min-height: 3.4rem; }
body.compact .saisie-pied .discret { display: none; }
body.compact .msg-texte p { margin: .3rem 0; }
body.compact .suggestions { padding: .4rem 0; gap: .3rem; }
body.compact .suggestion { font-size: .85rem; padding: .3rem .55rem; }
.msg-intertitre { margin-bottom: .2rem; }
.msg-texte ol, .msg-texte ul { margin: .3rem 0 .5rem; padding-left: 1.3rem; }
@media (max-width: 560px) {
  .msg-apprenti { padding-left: 8%; }
  .saisie-pied .discret { font-size: .76rem; }
}

/* ---------------- Accessibilité : taille du texte, contraste renforcé ---------------- */
html[data-taille="1"] { font-size: 112.5%; }
html[data-taille="2"] { font-size: 125%; }
html[data-taille="3"] { font-size: 150%; }
.acces-barre { display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: center; font-size: .82rem; color: var(--texte-2); }
.acces-titre { margin-right: .2rem; }
.acces-barre .bouton[aria-pressed="true"] { background: var(--marine); color: #fff; }
.entete-acces { padding-top: 0; padding-bottom: .4rem; }
.chat-acces { flex-basis: 100%; }
body.compact .acces-titre { display: none; }
html[data-contraste="1"] {
  --marine: #000; --bleu: #00267a; --texte: #000; --texte-2: #1a1a1a; --trait: #4a4a4a; --trait-fort: #000;
  --fond: #fff; --fond-2: #ececec; --erreur: #7a0000;
}
html[data-contraste="1"] a { text-decoration: underline; }
html[data-contraste="1"] .bouton, html[data-contraste="1"] input, html[data-contraste="1"] textarea,
html[data-contraste="1"] select, html[data-contraste="1"] .suggestion { border: 2px solid #000; }
html[data-contraste="1"] .msg { border-bottom-color: #000; }
html[data-contraste="1"] :focus-visible { outline: 3px solid #000; outline-offset: 2px; box-shadow: 0 0 0 6px #fff; }
html[data-contraste="1"] .bouton.principal, html[data-contraste="1"] .acces-barre .bouton[aria-pressed="true"] { background: #000; color: #fff; }

/* ---------------- Évaluation, lien Métis, lecture ---------------- */
.msg-actions { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: .35rem 0 0; font-size: .86rem; }
.msg-actions .bouton.petit[aria-pressed="true"] { background: var(--marine); color: #fff; }
.lien-metis { margin: .4rem 0 0; font-size: .9rem; }
.eval-commentaire { margin: .4rem 0; max-width: 520px; }
.eval-commentaire textarea { min-height: 3.2rem; }
.eval-merci { color: var(--texte-2); font-size: .86rem; }
