/* Aide à l'anonymisation : feuille de style. Polices du système, aucune ressource appelée. */

:root {
  --encre: #1b2430;
  --encre-douce: #4a5563;
  --fond: #f6f5f1;
  --papier: #ffffff;
  --trait: #c8c4ba;
  --accent: #1f3a5f;
  --accent-clair: #e6edf5;
  --alerte: #8a1c1c;
  --alerte-fond: #fbeaea;
  --succes: #1d5b33;
  --succes-fond: #e6f3ea;
  --avis-fond: #fff6dc;
  --avis-trait: #b98900;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

.largeur {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.evitement {
  position: absolute;
  left: -999rem;
  top: 0;
  background: var(--papier);
  color: var(--accent);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.evitement:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.hors-ecran {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid #b45f06;
  outline-offset: 2px;
}

/* Titre d'étape : il reçoit le focus par programme à chaque changement de temps, sans cadre. */
h2[tabindex="-1"]:focus {
  outline: none;
}

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

/* ---------- Bandeau ---------- */

.bandeau {
  background: var(--accent);
  color: #ffffff;
  padding: 1.25rem 0 1rem;
}

.bandeau h1 {
  margin: 0 0 0.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bandeau p {
  margin: 0.25rem 0;
  max-width: 62rem;
}

.bandeau .rappel {
  color: #dbe5f1;
  font-size: 0.95rem;
}

.bandeau a {
  color: #ffffff;
}

/* ---------- Étapes ---------- */

.etapes {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 1.25rem 0 1rem;
  padding: 0;
}

.etapes li {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--trait);
  border-radius: 4px;
  background: var(--papier);
  color: var(--encre-douce);
  font-weight: 600;
}

.etapes li[aria-current="step"] {
  border-color: var(--accent);
  background: var(--accent-clair);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.etapes .numero {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--encre-douce);
  color: #ffffff;
  text-align: center;
  line-height: 1.6rem;
  font-size: 0.9rem;
}

.etapes li[aria-current="step"] .numero {
  background: var(--accent);
}

.etape {
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: 6px;
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1.5rem;
}

h2 {
  margin: 0 0 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  color: var(--accent);
}

h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1.05rem;
}

h4 {
  margin: 0.9rem 0 0.25rem;
  font-size: 0.95rem;
}

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

.deux-colonnes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
}

fieldset {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem 0.9rem;
  border: 1px solid var(--trait);
  border-radius: 4px;
  min-width: 0;
}

legend {
  padding: 0 0.4rem;
  font-weight: 700;
}

label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #6f7783;
  border-radius: 4px;
  background: #ffffff;
  color: var(--encre);
  font: inherit;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.aide {
  margin: 0.3rem 0;
  color: var(--encre-douce);
  font-size: 0.9rem;
  font-weight: 400;
}

.zone-depot {
  padding: 0.75rem 0.9rem;
  border: 2px dashed #6f7783;
  border-radius: 6px;
  background: #fbfaf7;
}

.zone-depot.survol {
  border-color: var(--accent);
  background: var(--accent-clair);
}

.zone-depot label {
  margin-top: 0;
  font-weight: 400;
}

.choix {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.3rem 0;
}

.choix input {
  margin-top: 0.3rem;
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
}

.choix label {
  margin: 0;
  font-weight: 400;
}

.choix.en-ligne {
  display: inline-flex;
  margin-right: 1.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.9rem 0 0.3rem;
}

button {
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: #ffffff;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-clair);
}

button.principal {
  background: var(--accent);
  color: #ffffff;
}

button.principal:hover:not(:disabled) {
  background: #162b47;
}

button.discret {
  border-color: var(--trait);
  color: var(--encre-douce);
  font-weight: 400;
}

button.petit {
  padding: 0.1rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 400;
}

button:disabled {
  border-color: var(--trait);
  background: #ecebe7;
  color: #5d6570;
  cursor: not-allowed;
}

.ligne-saisie {
  display: flex;
  gap: 0.5rem;
}

.ligne-saisie input {
  flex: 1;
}

/* ---------- Messages ---------- */

.alerte {
  margin: 0.75rem 0;
  padding: 0.7rem 0.9rem;
  border-left: 5px solid var(--alerte);
  background: var(--alerte-fond);
  color: #5c1010;
}

.alerte p,
.avis p {
  margin: 0.3rem 0;
}

.avis {
  margin: 0.5rem 0 0.75rem;
  padding: 0.6rem 0.9rem;
  border-left: 5px solid var(--avis-trait);
  background: var(--avis-fond);
}

.resume {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.controle {
  margin: 0.5rem 0;
  padding: 0.7rem 0.9rem;
  border-left: 5px solid var(--trait);
  background: #f1f0ec;
  font-weight: 600;
}

.controle.passe {
  border-color: var(--succes);
  background: var(--succes-fond);
  color: #123d22;
}

.controle.bloque {
  border-color: var(--alerte);
  background: var(--alerte-fond);
  color: #5c1010;
}

.restes {
  margin: 0.5rem 0;
  padding-left: 1.2rem;
}

.restes li {
  margin: 0.35rem 0;
}

.restes .extrait {
  display: block;
  color: var(--encre-douce);
  font-family: ui-monospace, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
}

/* ---------- Relecture ---------- */

.relecture {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr);
  gap: 1.25rem;
  align-items: start;
}

.vue {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.75rem;
}

.texte-relu {
  height: 60vh;
  min-height: 16rem;
  overflow: auto;
  padding: 0.9rem 1.1rem;
  border: 1px solid #6f7783;
  border-radius: 4px;
  background: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.7;
}

.texte-relu .bloc {
  margin: 0 0 0.6rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.texte-relu .partie {
  margin: 1.1rem 0 0.4rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--trait);
  color: var(--encre-douce);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.texte-relu .partie:first-child {
  margin-top: 0;
}

.genre {
  margin-right: 0.4rem;
  padding: 0 0.35rem;
  border: 1px solid var(--trait);
  border-radius: 3px;
  color: var(--encre-douce);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.75rem;
}

mark {
  padding: 0.05em 0.15em;
  border-radius: 3px;
  color: #111111;
  cursor: default;
}

mark.groupe-nom { background: #ffe58f; box-shadow: inset 0 -2px 0 #a37b00; }
mark.groupe-contact { background: #cfe2ff; box-shadow: inset 0 -2px 0 #2c5aa0; }
mark.groupe-identifiant { background: #f8d3e2; box-shadow: inset 0 -2px 0 #9c2f5f; }
mark.groupe-date { background: #cdebd2; box-shadow: inset 0 -2px 0 #2b6e3b; }
mark.groupe-montant { background: #e2dcf7; box-shadow: inset 0 -2px 0 #5a45a8; }

mark.gardee {
  background: transparent;
  box-shadow: none;
  outline: 1px dashed #5d6570;
}

mark.posee {
  background: #e7e6e2;
  box-shadow: inset 0 0 0 1px #6f7783;
  font-family: ui-monospace, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.legende {
  margin: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--encre-douce);
}

.legende mark {
  margin-right: 0.5rem;
}

.ajout {
  margin-top: 0.5rem;
  padding: 0.6rem 0.9rem 0.8rem;
  border: 1px solid var(--trait);
  border-radius: 4px;
  background: #fbfaf7;
}

.colonne-liste {
  max-height: calc(60vh + 16rem);
  overflow: auto;
  padding: 0 0.9rem 0.9rem;
  border: 1px solid var(--trait);
  border-radius: 4px;
  background: #fbfaf7;
}

.categorie {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.9rem 0 0.2rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--trait);
}

.categorie h4 {
  margin: 0;
}

.lignes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lignes li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: start;
  padding: 0.25rem 0;
  border-bottom: 1px dotted #dcd9d1;
}

.lignes input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.3rem;
}

.lignes label {
  margin: 0;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.lignes .valeur {
  font-weight: 600;
  white-space: pre-wrap;
}

.lignes .detail {
  display: block;
  color: var(--encre-douce);
  font-size: 0.85rem;
}

.lignes .detail .etiquette {
  font-family: ui-monospace, Consolas, "Liberation Mono", monospace;
  color: var(--encre);
  white-space: nowrap;
}

.reste-a-voir {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
}

.reste-a-voir li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.2rem 0.1rem 0.5rem;
  border: 1px solid var(--trait);
  border-radius: 4px;
  background: #ffffff;
  font-size: 0.9rem;
}

/* ---------- Encadrés ---------- */

.encadre {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--avis-trait);
  border-left-width: 6px;
  border-radius: 4px;
  background: var(--avis-fond);
}

.encadre.neutre {
  border-color: var(--trait);
  border-left-color: var(--accent);
  background: var(--papier);
}

.encadre h2 {
  color: var(--encre);
}

.encadre dl {
  margin: 0;
}

.encadre dt {
  margin-top: 0.6rem;
  font-weight: 700;
}

.encadre dd {
  margin: 0.15rem 0 0;
}

.encadre ul {
  margin: 0.25rem 0;
  padding-left: 1.2rem;
}

.encadre li {
  margin: 0.3rem 0;
}

code {
  font-family: ui-monospace, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

/* ---------- Pied de page ---------- */

.pied {
  border-top: 1px solid var(--trait);
  padding: 1rem 0 2rem;
  color: var(--encre-douce);
  font-size: 0.9rem;
}

.pied p {
  margin: 0.3rem 0;
}

/* ---------- Écrans étroits ---------- */

@media (max-width: 60rem) {
  .deux-colonnes,
  .relecture {
    grid-template-columns: minmax(0, 1fr);
  }

  .colonne-liste {
    max-height: none;
  }

  .texte-relu {
    height: 50vh;
  }
}

@media print {
  .bandeau,
  .etapes,
  .actions,
  .pied {
    display: none;
  }
}
