/* Table d'inspection (V2.4), feuilles pleine écran, lettre sur papier, réglages (V2.5). */

/* ---- Feuille pleine écran (partagée : table, réglages, lettre en grand) ---- */

.feuille-plein {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--creme);
  color: var(--encre);
  font-family: var(--police);
  overflow-wrap: anywhere;
}

.feuille-plein__entete {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 14px;
  background: var(--papier);
  border-bottom: 1px solid rgba(43, 36, 32, .15);
}

.feuille-plein__entete .entete__retour {
  grid-column: 1;
  grid-row: 1;
}

.feuille-plein__titre {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-family: var(--police-titre);
  font-size: 20px;
  line-height: 1.25;
}

.feuille-plein__titre:focus {
  outline: none;
}

.feuille-plein__fermer {
  grid-column: 2;
  grid-row: 1;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
}

.feuille-plein__corps {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 28px;
}

.feuille-plein--lettre .feuille-plein__corps {
  padding: 18px 16px 32px;
  background: #F1EADC;
}

.feuille-plein :focus-visible:not([tabindex="-1"]) {
  outline: 3px solid var(--ciel);
  outline-offset: 2px;
}

/* ---- Table : corps et compteur ---- */

.table {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.table__vide {
  margin: 0;
  color: var(--encre-douce);
}

.table__compteur {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.table__compteur-texte {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.table__points {
  display: flex;
  gap: 8px;
  margin: 0;
}

.table__point {
  width: 14px;
  height: 14px;
  border: 2px solid var(--encre);
  border-radius: 50%;
}

.table__point--plein {
  background: var(--encre);
}

.table__titre-section {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

.table__alerte {
  margin: 0;
  padding: 12px 14px;
  border-left: 5px solid var(--moutarde);
  border-radius: 12px;
  background: #F6E6B8;
  color: var(--encre);
  font-weight: 700;
}

/* Outils désactivés : fond et texte gardent un contraste suffisant, sans opacité. */
.table .outil:disabled {
  cursor: default;
  border-style: dashed;
  background: #EFE8DC;
  color: var(--encre-outil);
}

.table .outil:disabled:hover {
  border-color: var(--encre-douce);
  background: #EFE8DC;
}

.table .outil:disabled .outil__icone {
  color: var(--encre-outil);
}

.table .outil {
  min-height: 44px;
}

.table__questions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table__choix {
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid var(--terracotta);
  border-radius: 12px;
  background: var(--papier);
  color: var(--encre);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.table__choix:hover {
  background: rgba(180, 70, 46, .08);
}

/* ---- Réponses : un seul jeu de boutons dans la table ---- */

.table__reponses {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table__reponses .reponses--feuille {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table__reponse {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 2px solid var(--encre-douce);
  border-radius: 12px;
  background: var(--papier);
  color: var(--encre);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.table__reponse:hover {
  border-color: var(--encre);
  background: #F4EEE3;
}

/* ---- Résultats : carte de résultat, pleine largeur ---- */

.table .resultat {
  outline: none;
}

.table .resultat:focus-visible {
  outline: 3px solid var(--ciel);
  outline-offset: 2px;
}

/* ---- Mail : vue d'une application de messagerie ---- */

.objet-mail {
  overflow: hidden;
  background: var(--papier);
  border: 1px solid rgba(43, 36, 32, .16);
  border-radius: 14px;
  box-shadow: var(--ombre-1);
}

.objet-mail__entete {
  padding: 14px 16px;
  background: #F4EEE3;
  border-bottom: 1px solid rgba(43, 36, 32, .12);
}

.objet-mail__ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0 0 6px;
  font-size: 14.5px;
}

.objet-mail__ligne:last-child {
  margin-bottom: 0;
}

.objet-mail__cle {
  min-width: 36px;
  color: var(--encre-douce);
}

.objet-mail__nom {
  font-weight: 700;
}

.objet-mail__adresse {
  color: var(--encre-douce);
  overflow-wrap: anywhere;
}

.objet-mail__corps {
  padding: 14px 16px 18px;
  font-size: 15px;
  line-height: 1.6;
}

.objet-mail__corps p {
  margin: 0;
}

.objet-mail__piece {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid rgba(43, 36, 32, .12);
  font-size: 14px;
  color: var(--encre-douce);
}

/* Lien affiché : souligné, jamais le vrai lien. */
.lien-affiche {
  color: var(--ciel);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* ---- Lettre : une feuille de papier, en vrai HTML ---- */

.objet-lettre {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lettre {
  padding: 22px 20px 26px;
  background: var(--papier);
  color: #2B2420;
  border: 1px solid rgba(43, 36, 32, .18);
  border-radius: 4px;
  box-shadow: var(--ombre-1);
  font-family: var(--police-titre);
  font-size: 15px;
  line-height: 1.55;
  max-width: 100%;
}

.lettre__entete {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #2B2420;
}

.lettre__blason {
  flex: 0 0 auto;
  display: block;
  width: 32px;
  height: 32px;
}

.lettre__blason svg {
  display: block;
  width: 32px;
  height: 32px;
}

.lettre__organisme {
  margin: 0;
  padding-top: 4px;
  font-size: 15.5px;
  font-weight: 700;
}

.lettre__lieu {
  margin: 16px 0 10px;
  text-align: right;
}

.lettre__destinataire {
  margin: 0 0 12px;
}

.lettre__objet {
  margin: 0 0 12px;
}

.lettre__corps p {
  margin: 0 0 12px;
}

.lettre__qr {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 14px 0 0;
}

.lettre__qr-image svg {
  display: block;
  width: min(168px, 100%);
  height: auto;
}

.lettre__qr-legende {
  margin: 0;
  font-family: var(--police);
  font-size: 14px;
  color: #5E534B;
}

.lettre__ligne {
  margin: 4px 0 0;
  font-size: 14.5px;
}

.lettre__signature {
  margin: 18px 0 0;
  text-align: right;
  font-style: italic;
}

.lettre-grand__bouton {
  width: 100%;
  min-height: 48px;
}

/* Lire en grand : la lettre seule, texte à 18 px au minimum. */
.lettre--grand {
  padding: 24px 22px 30px;
  font-size: 18px;
  line-height: 1.6;
}

.lettre--grand .lettre__organisme {
  font-size: 19px;
}

.lettre--grand .lettre__corps p,
.lettre--grand .lettre__ligne,
.lettre--grand .lettre__destinataire,
.lettre--grand .lettre__objet {
  font-size: 18px;
}

.lettre--grand .lettre__qr-legende {
  font-size: 16px;
}

/* ---- Réglages du compte ---- */

.reglages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reglages .etape {
  padding: 0;
}

.reglages .etape__bouton {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--encre);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.reglages .etape--faite .etape__bouton {
  cursor: default;
}

.reglages .etape__libelle {
  font-size: 15.5px;
}

.reglages .etape--faite .etape__libelle {
  color: var(--sauge);
}

.reglages .etapes__fin {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-left: 5px solid var(--sauge);
  border-radius: 12px;
  background: rgba(63, 101, 68, .08);
  color: var(--encre);
  font-weight: 700;
}

.reglages .etapes__fin:focus {
  outline: none;
}

/* ---- Mouvement réduit : pas d'animation ni de défilement lissé ---- */

@media (prefers-reduced-motion: reduce) {
  .feuille-plein *,
  .feuille-plein__corps,
  .table * {
    transition: none;
    animation: none;
    scroll-behavior: auto;
  }
}
