:root {
  --papier: #f6f8fc;
  --feuille: #ffffff;
  --encre: #1d3e8a;
  --encre-claire: #e8eefb;
  --texte: #1b2230;
  --discret: #566074;
  --ligne-forte: #c4cde6;
  --ligne-fine: #e6eaf5;
  --marge: #d2433a;
  --erreur: #a8261d;
  --ui: "Atkinson Hyperlegible", system-ui, sans-serif;
  --lecture: "Spectral", Georgia, serif;
  --interligne: 32px;
}


* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--texte);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a { color: var(--encre); }
a:focus-visible, button:focus-visible, input:focus-visible, .zone:focus-within {
  outline: 3px solid var(--encre);
  outline-offset: 3px;
}

.bandeau, .heros, main, .pied {
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.bandeau {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.marque {
  font-family: var(--lecture);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--texte);
  text-decoration: none;
}
.phase { color: var(--discret); font-size: 0.9rem; }

/* Accueil : bandeau bleu pleine largeur, titre et extrait annoté. */
.haut-accueil { background: #1d3e8a; color: #fff; }
.haut-accueil .bandeau, .heros { max-width: 64rem; }
.haut-accueil .marque { color: #fff; }
.haut-accueil .phase { color: #c9d6f5; }
.heros {
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}
.haut-accueil h1 { color: #fff; }
.haut-accueil .chapeau { color: #dfe7fb; max-width: 30em; }
.genres { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.genres li { border: 1px solid rgba(255,255,255,0.45); border-radius: 999px; padding: 0.25rem 0.8rem; font-size: 0.9rem; color: #fff; }
.extrait {
  margin: 0;
  background: #fff;
  color: var(--texte);
  border-radius: 6px;
  padding: 1.4rem 1.5rem 1rem;
  box-shadow: 0 18px 40px rgba(6, 18, 52, 0.35);
  transform: rotate(-1.2deg);
}
.extrait-doc { font-family: var(--lecture); font-size: 1.12rem; line-height: 1.55; margin: 0 0 0.35rem; }
.extrait mark { background: linear-gradient(transparent 12%, #ffe066 12%, #ffe066 88%, transparent 88%); color: inherit; padding: 0 0.12em; }
.extrait-note { margin: 0 0 1.1rem; padding-left: 0.75rem; border-left: 3px solid #e0a800; font-size: 0.88rem; color: var(--discret); }
.extrait-note span { display: block; font-weight: 700; color: #8a5a00; }
.extrait figcaption { font-size: 0.78rem; color: var(--discret); border-top: 1px solid var(--ligne-fine); padding-top: 0.6rem; }

/* Les trois étapes : une vraie séquence, d'où la numérotation. */
.parcours { margin: 2.5rem 0 0; }
.etapes { list-style: none; counter-reset: etape; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.etapes li { counter-increment: etape; display: flex; flex-direction: column; gap: 0.3rem; }
.etapes li::before {
  content: counter(etape);
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--encre-claire); color: var(--encre); font-weight: 700;
}
.etapes strong { color: var(--encre); font-size: 1.05rem; }
.etapes span { color: var(--discret); font-size: 0.95rem; }

@media (max-width: 860px) {
  .heros { grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2.5rem; }
  .extrait { transform: none; }
}
@media (max-width: 640px) {
  .etapes { grid-template-columns: 1fr; }
}
h1 {
  font-family: var(--lecture);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
  max-width: 18em;
}
.chapeau { font-size: 1.2rem; margin: 0 0 0.75rem; max-width: 34em; }
.precision { color: var(--discret); margin: 0; max-width: 34em; }

/* Dépôt : une feuille quadrillée, comme un cahier de mathématiques. */
.depot { margin: 1.5rem 0 3rem; }
.zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 2.25rem 1.75rem;
  border: 2px dashed var(--encre);
  border-radius: 6px;
  cursor: pointer;
  background-color: var(--feuille);
  background-image:
    linear-gradient(var(--ligne-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--ligne-fine) 1px, transparent 1px);
  background-size: 20px 20px;
}
.zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.zone.survol, .zone.choisi { background-color: var(--encre-claire); }
.zone-titre { font-weight: 700; font-size: 1.15rem; color: var(--encre); }
.zone-aide { color: var(--discret); }

.consigne { font-size: 0.95rem; color: var(--discret); margin: 1rem 0; max-width: 40em; }

.accord { display: flex; gap: 0.75rem; align-items: flex-start; margin: 1.25rem 0; max-width: 40em; }
.accord input { margin-top: 0.3rem; width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--encre); }
.accord.petit { font-size: 0.92rem; color: var(--discret); margin: 0.75rem 0 0; }

.action { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
button {
  font: inherit;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.8rem 1.6rem;
  border: 2px solid var(--encre);
  background: var(--encre);
  color: var(--feuille);
  cursor: pointer;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.secondaire { background: transparent; color: var(--encre); padding: 0.6rem 1.1rem; }
.mention { color: var(--discret); font-size: 0.92rem; margin: 0; }

.message { margin: 1rem 0 0; font-weight: 700; }
.message.erreur { color: var(--erreur); }

.attente { margin: 0 0 3rem; padding: 1.5rem 1.75rem; border-left: 3px solid var(--encre); background: var(--feuille); }
.attente p { margin: 0; }
.chrono { color: var(--discret); margin-top: 0.5rem !important; font-variant-numeric: tabular-nums; }

/* Le rapport : une feuille blanche, bandeau à l'encre, comme le PDF. */
.resultat { margin: 0 0 3rem; }
.resultat-outils { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.avis-unique { color: var(--discret); font-size: 0.92rem; margin: 0 0 1rem; }

.copie {
  background: var(--feuille);
  border: 1px solid var(--ligne-forte);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.6;
}
.rapport-entete { background: #1d3e8a; color: #fff; padding: 1.1rem 1.5rem 1rem; }
.rapport-entete p { margin: 0; }
.rapport-marque { font-family: var(--lecture); font-weight: 600; font-size: 1.5rem; line-height: 1.2; }
.rapport-titre { font-size: 0.92rem; opacity: 0.9; }
.rapport-meta { font-size: 0.8rem; opacity: 0.75; margin-top: 0.35rem !important; }
.rapport-corps { padding: 0.5rem 1.5rem 0.5rem; }
.rapport-corps p, .rapport-corps ul, .rapport-corps ol, .rapport-corps blockquote { margin: 0 0 0.8rem; }
.rapport-corps ul, .rapport-corps ol { padding-left: 1.25rem; }
.rapport-corps li { margin-bottom: 0.25rem; }
.rapport-corps li::marker { color: var(--encre); }
.rapport-corps h3 {
  font-family: var(--lecture);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--encre);
  margin: 1.4rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--ligne-forte);
}
.rapport-corps h4 { font-size: 1rem; color: var(--encre); margin: 1rem 0 0.4rem; }
.rapport-corps strong { font-weight: 700; }
.rapport-corps blockquote { border-left: 3px solid var(--ligne-forte); padding-left: 1rem; color: var(--discret); }
.rapport-corps .tableau { overflow-x: auto; margin: 0 0 1rem; border: 1px solid var(--ligne-forte); border-radius: 3px; }
.rapport-corps table { border-collapse: collapse; width: 100%; font-size: 0.9rem; line-height: 1.4; }
.rapport-corps th, .rapport-corps td { text-align: left; padding: 0.5rem 0.65rem; vertical-align: top; }
.rapport-corps th { background: var(--encre-claire); color: var(--encre); font-weight: 700; border-bottom: 2px solid var(--encre); }
.rapport-corps td { border-bottom: 1px solid var(--ligne-fine); }
.rapport-corps tbody tr:nth-child(even) td { background: var(--papier); }
.rapport-alerte { margin: 1rem 1.5rem 0; border-left: 4px solid var(--marge); background: color-mix(in srgb, var(--marge) 8%, var(--feuille)); padding: 0.7rem 1rem; line-height: 1.5; }
.rapport-alerte p, .rapport-alerte ul { margin: 0.2rem 0; }
.rapport-pied { margin: 0.5rem 1.5rem 1.2rem; padding-top: 0.75rem; border-top: 1px solid var(--ligne-forte); font-size: 0.82rem; color: var(--discret); line-height: 1.5; }

@media (max-width: 560px) {
  .rapport-entete, .rapport-corps { padding-left: 1rem; padding-right: 1rem; }
  .rapport-alerte, .rapport-pied { margin-left: 1rem; margin-right: 1rem; }
}

.retour, .alerte {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ligne-forte);
}
.retour h2, .alerte h2 { font-family: var(--lecture); font-weight: 600; font-size: 1.35rem; margin: 0 0 0.5rem; }
.retour-aide, .alerte > p { color: var(--discret); margin: 0 0 1rem; max-width: 40em; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-weight: 700; margin-bottom: 0.4rem; }
fieldset label { display: inline-flex; gap: 0.4rem; align-items: center; margin: 0 1.25rem 0.4rem 0; }
fieldset input[type=radio] { accent-color: var(--encre); }
input[type=text], input[type=email] {
  font: inherit;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--ligne-forte);
  border-radius: 6px;
  background: var(--feuille);
  color: var(--texte);
  width: 100%;
  max-width: 26rem;
  margin-top: 0.4rem;
}
.alerte { margin-bottom: 3rem; }
.alerte-ligne { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.alerte-ligne input { margin-top: 0; flex: 1 1 16rem; }

.pied {
  border-top: 1px solid var(--ligne-forte);
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  color: var(--discret);
  font-size: 0.9rem;
}
.pied nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 0.5rem; }

/* Pages légales */
.legal { padding: 2rem 0 3rem; max-width: 42em; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-family: var(--lecture); font-weight: 600; font-size: 1.2rem; margin: 2rem 0 0.5rem; }
.legal table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 1rem 0; }
.legal th, .legal td { border-bottom: 1px solid var(--ligne-forte); text-align: left; padding: 0.5rem; vertical-align: top; }
.legal .date { color: var(--discret); }
.tableau-defilant { overflow-x: auto; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  body { background: #fff; }
  .haut, .pied, .parcours, .depot, .attente, .resultat-outils, .avis-unique, .retour, .alerte { display: none !important; }
  main { max-width: none; padding: 0; }
  .copie { border: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rapport-corps .tableau { overflow: visible; }
}

/* Tableau de bord privé */
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tb { padding: 1.5rem 0 3rem; }
.tb-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.tb-tete h1 { font-size: 2rem; margin: 0; }
.tb-maj { color: var(--discret); font-size: 0.9rem; margin: 0; }
.tb-bloc { border-top: 1px solid var(--ligne-forte); margin-top: 1.75rem; padding-top: 1rem; }
.tb-bloc h2 { font-family: var(--lecture); font-weight: 600; font-size: 1.2rem; margin: 0 0 0.75rem; }
.tb-bloc h3 { font-size: 0.95rem; margin: 1.25rem 0 0.4rem; color: var(--discret); font-weight: 700; }
.tb-grand { font-family: var(--lecture); font-size: 2.4rem; line-height: 1; color: var(--encre); font-variant-numeric: tabular-nums; }
.tb-direct, .tb-budget { margin: 0 0 0.25rem; }
.tb-note { color: var(--discret); font-size: 0.9rem; margin: 0.4rem 0 0; }
.tb-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.tb-chiffres div { border-left: 2px solid var(--ligne-forte); padding-left: 0.75rem; }
.tb-chiffres dt { color: var(--discret); font-size: 0.85rem; }
.tb-chiffres dd { margin: 0.15rem 0 0; font-family: var(--lecture); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.tb-jauge { height: 10px; background: var(--ligne-fine); border-radius: 5px; overflow: hidden; margin: 0.6rem 0 0; max-width: 28rem; }
.tb-jauge span { display: block; height: 100%; background: var(--encre); border-radius: 5px; }
.tb-jauge.alerte span { background: var(--marge); }
.tb-table { border-collapse: collapse; width: 100%; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.tb-table th, .tb-table td { border-bottom: 1px solid var(--ligne-fine); padding: 0.4rem 0.5rem; text-align: left; }
.tb-table thead th { color: var(--discret); font-weight: 700; font-size: 0.85rem; border-bottom-color: var(--ligne-forte); }
.tb-table tbody th { font-weight: 400; white-space: nowrap; }
.tb-nombre { text-align: right !important; }
.tb-barre-col { width: 22%; min-width: 4rem; }
.tb-barre { display: block; height: 8px; min-width: 0; background: var(--encre); border-radius: 0 4px 4px 0; }
.tb-etroite { max-width: 26rem; }
.tb-retours { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 1.5rem; }
.tb-liste { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.tb-liste li { border-bottom: 1px solid var(--ligne-fine); padding: 0.4rem 0; overflow-wrap: anywhere; }
.tb-date { color: var(--discret); font-variant-numeric: tabular-nums; }
.tb-vide, .tb-vide td { color: var(--discret); }
@media (max-width: 480px) { .tb-barre-col { display: none; } }

/* Encart « comparez » sous le rapport */
.comparer { border-left: 3px solid var(--encre); background: var(--encre-claire); padding: 1rem 1.25rem; margin: 1.5rem 0 0; }
.comparer h2 { font-family: var(--lecture); font-weight: 600; font-size: 1.2rem; margin: 0 0 0.4rem; }
.comparer p { margin: 0; max-width: 40em; }
.comparer .comparer-note { color: var(--discret); font-size: 0.9rem; margin-top: 0.5rem; }
@media print { .comparer { display: none !important; } }

.rapport-note { margin: 0.9rem 1.5rem 0; padding: 0.55rem 0.9rem; background: var(--encre-claire); border-radius: 3px; font-size: 0.88rem; color: var(--encre); }

/* Conseils d'anonymisation, repliés par défaut */
.anonymiser { margin: 0 0 1rem; max-width: 40em; border: 1px solid var(--ligne-forte); border-radius: 6px; background: var(--feuille); }
.anonymiser summary { cursor: pointer; padding: 0.65rem 1rem; font-weight: 700; color: var(--encre); }
.anonymiser ul { margin: 0; padding: 0 1rem 0.9rem 2.1rem; font-size: 0.93rem; color: var(--texte); }
.anonymiser li { margin-bottom: 0.45rem; }

.haut-accueil .methode { color: #c9d6f5; font-size: 0.95rem; max-width: 34em; margin: 0.9rem 0 0; padding-left: 0.8rem; border-left: 2px solid #ffe066; }
