/* CorrecIA — feuille de style */
:root {
  --bleu: #1f4e78; --bleu-fonce: #163a5a; --bleu-clair: #e8f0f7; --rouge: #c8102e;
  --vert: #1e7a46; --vert-clair: #e5f4ec; --jaune: #fff2cc; --jaune-fonce: #8a6100;
  --texte: #1b2530; --doux: #5b6773; --bord: #d9e0e6; --fond: #f4f6f8; --carte: #fff;
  --rayon: 10px; --ombre: 0 1px 2px rgba(16, 32, 48, .08), 0 1px 1px rgba(16, 32, 48, .04);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texte); background: var(--fond); font-size: 15px; line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--fond); }
body:not(.pret) main { visibility: hidden; }
a { color: var(--bleu); }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.doux { color: var(--doux); }
.petit { font-size: 13px; }

/* barre du haut */
.barre { display: flex; align-items: center; gap: 24px; background: var(--bleu); color: #fff; padding: 0 24px; min-height: 58px; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.marque small { display: block; font-weight: 400; font-size: 11px; opacity: .8; }
.marque img { border-radius: 6px; background: #fff; }
.menu { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.menu a { color: #dbe7f2; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
.menu a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.menu a[aria-current] { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }
.compte { display: flex; align-items: center; gap: 12px; }
.compte #utilisateur { color: #fff; text-decoration: none; text-align: right; line-height: 1.2; }
.compte #utilisateur .nom { display: block; font-weight: 600; }
.compte #utilisateur .role { font-size: 12px; opacity: .8; }
.compte .lien { color: #dbe7f2; }

main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.entete-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.fil { font-size: 13px; color: var(--doux); margin-bottom: 6px; }
.fil a { color: var(--doux); }

/* cartes et grilles */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; margin-bottom: 20px; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 20px; }
.chiffre { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px; }
.chiffre b { display: block; font-size: 28px; color: var(--bleu); }
.chiffre span { color: var(--doux); font-size: 13px; }
.vide { text-align: center; padding: 36px 16px; color: var(--doux); }

/* boutons et champs */
button, .bouton { font: inherit; background: var(--bleu); color: #fff; border: 1px solid var(--bleu); border-radius: 7px; padding: 8px 15px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; }
button:hover, .bouton:hover { background: var(--bleu-fonce); }
button:disabled { opacity: .55; cursor: not-allowed; }
button[data-occupe]::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: tourne .7s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
button.secondaire, .bouton.secondaire { background: #fff; color: var(--bleu); border-color: var(--bord); }
button.secondaire:hover, .bouton.secondaire:hover { background: var(--bleu-clair); }
button.danger { background: #fff; color: var(--rouge); border-color: #f0c4cb; }
button.danger:hover { background: #fdecef; }
button.lien { background: none; border: 0; color: var(--bleu); padding: 0; text-decoration: underline; }
button.petit, .bouton.petit { padding: 4px 10px; font-size: 13px; }
button.grand { padding: 12px 22px; font-size: 16px; font-weight: 600; }
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
label .doux { font-weight: 400; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid #c3ccd5; border-radius: 7px; background: #fff; color: var(--texte); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid #9cc3e6; outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }
input[type="checkbox"] { width: auto; margin-right: 6px; }
.ligne-champs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.avec-bouton { display: flex; gap: 8px; }
.avec-bouton select, .avec-bouton input { flex: 1; }
.case { display: flex; align-items: center; font-weight: 400; font-size: 14px; }

/* tableaux */
.tableau { width: 100%; border-collapse: collapse; background: #fff; }
.tableau th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--doux); border-bottom: 2px solid var(--bord); padding: 8px 10px; white-space: nowrap; }
.tableau td { border-bottom: 1px solid #edf0f3; padding: 9px 10px; vertical-align: middle; }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: #f7fafc; }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; }
.defile { overflow-x: auto; }

/* pastilles */
.pastille { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef1f4; color: var(--doux); }
.pastille.ok, .pastille.auto, .pastille.validee { background: var(--vert-clair); color: var(--vert); }
.pastille.attention, .pastille.a_verifier, .pastille.a_noter { background: var(--jaune); color: var(--jaune-fonce); }
.pastille.bleu, .pastille.corrigee { background: var(--bleu-clair); color: var(--bleu); }
.pastille.rouge, .pastille.absente { background: #fdecef; color: var(--rouge); }

/* onglets / étapes */
.etapes { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 20px; overflow-x: auto; }
.etapes button { background: none; color: var(--doux); border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 16px; font-weight: 600; white-space: nowrap; }
.etapes button:hover { color: var(--bleu); background: none; }
.etapes button[aria-selected="true"] { color: var(--bleu); border-bottom-color: var(--bleu); }
.etapes .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e4e9ee; font-size: 12px; margin-right: 6px; }
.etapes button.fait .n { background: var(--vert); color: #fff; }
[role="tabpanel"][hidden] { display: none; }

/* dépôt de fichiers */
.depot { border: 2px dashed #b4c2cf; border-radius: var(--rayon); padding: 30px; text-align: center; background: #fafcfd; cursor: pointer; transition: .15s; }
.depot.survol { border-color: var(--bleu); background: var(--bleu-clair); }
.depot strong { display: block; font-size: 16px; margin-bottom: 4px; }

/* progression */
.progression { height: 10px; background: #e4e9ee; border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progression > div { height: 100%; background: var(--bleu); width: 0; transition: width .2s; }

/* corrigé */
.questions .question { display: grid; grid-template-columns: 64px 190px 1fr 92px 36px; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid #edf0f3; }
.questions .question input, .questions .question select, .questions .question textarea { padding: 6px 8px; }
.questions .entetes { font-size: 12px; font-weight: 600; color: var(--doux); text-transform: uppercase; padding-bottom: 4px; }
.questions .detail { display: grid; gap: 6px; }
.questions .detail .sous { display: grid; gap: 6px; grid-template-columns: 1fr 1fr 1fr; }
.questions textarea { min-height: 60px; }
.total-corrige { font-size: 16px; font-weight: 700; text-align: right; margin-top: 12px; }

/* codes */
.codes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.codes figure { margin: 0; border: 1px solid var(--bord); border-radius: 8px; padding: 8px; background: #fff; }
.codes img { width: 100%; display: block; border-radius: 4px; background: #eee; }
.codes figcaption { font-size: 12px; color: var(--doux); margin: 6px 0; }

/* vérification d'une copie */
.copie-detail { display: grid; grid-template-columns: minmax(300px, 430px) 1fr; gap: 20px; align-items: start; }
.copie-detail .liste-q { max-height: 72vh; overflow: auto; }
.q-ligne { border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.q-ligne[aria-current="true"] { border-color: var(--bleu); box-shadow: 0 0 0 2px #9cc3e6; }
.q-ligne .haut { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.q-ligne .pts { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.q-ligne .pts input { width: 74px; }
.q-ligne .pts input.lu { width: 90px; }
.q-ligne .raison { font-size: 12px; color: var(--doux); margin-top: 4px; }
.visionneuse { background: #3a4048; border-radius: var(--rayon); padding: 10px; max-height: 76vh; overflow: auto; text-align: center; }
.visionneuse canvas, .visionneuse img { max-width: 100%; background: #fff; border-radius: 4px; }
.visionneuse .info { color: #e4e9ee; font-size: 13px; margin-bottom: 8px; }

.v-entete { display: flex; gap: 16px; align-items: end; justify-content: space-between; flex-wrap: wrap; margin: 10px 0 14px; }
.v-note { text-align: center; }
.v-note span { display: block; font-size: 12px; color: var(--doux); text-transform: uppercase; }
.v-note strong { font-size: 19px; color: var(--rouge); }

/* dialogues */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
dialog.large { width: min(1000px, 96vw); }
dialog::backdrop { background: rgba(20, 30, 40, .45); }
dialog header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--bord); }
dialog header h2 { margin: 0; }
dialog .fermer { background: none; border: 0; color: var(--doux); font-size: 24px; padding: 0 6px; }
dialog .contenu { padding: 4px 20px 20px; max-height: 80vh; overflow: auto; }

/* notifications */
#notifications { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 1000; max-width: min(420px, 92vw); }
.notif { padding: 12px 16px; border-radius: 8px; color: #fff; background: var(--vert); box-shadow: var(--ombre); animation: arrive .2s; }
.notif-erreur { background: var(--rouge); }
.notif-info { background: var(--bleu); }
@keyframes arrive { from { transform: translateY(8px); opacity: 0; } }

.alerte { padding: 12px 14px; border-radius: 8px; background: var(--bleu-clair); color: var(--bleu-fonce); margin-bottom: 14px; }
.alerte.attention { background: var(--jaune); color: #5e4300; }
.alerte.ok { background: var(--vert-clair); color: #145230; }

/* connexion */
.page-connexion { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, #1f4e78, #2c6aa0); padding: 16px; }
.boite-connexion { background: #fff; border-radius: 14px; padding: 32px; width: min(400px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.boite-connexion .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.boite-connexion button { width: 100%; justify-content: center; margin-top: 20px; padding: 11px; }

@media (max-width: 860px) {
  .copie-detail { grid-template-columns: 1fr; }
  .questions .question { grid-template-columns: 56px 1fr; }
  .questions .question > :nth-child(n+3) { grid-column: 1 / -1; }
  main { padding: 16px; }
}
@media print {
  .barre, .etapes, .actions, button { display: none !important; }
  body { background: #fff; }
}
