/* Tokens Ly.MG (valeurs reprises de CLAUDE.md §4). Aucune couleur en dehors de ces tokens. */
:root {
  --encre: #1B2430;
  --canevas: #FAF7F1;
  --corail: #E8623D;
  --sable: #D9C7A3;
  --bleu-logo: #7FA3C8;
  --rose-pale: #F3C6D5;

  /* Polices : fichiers du portfolio à fournir ; en attendant, repli système. */
  --police-titre: "Bricolage Grotesque", system-ui, sans-serif;
  --police-texte: "Inter", system-ui, sans-serif;
  --police-etiquette: "JetBrains Mono", ui-monospace, monospace;

  /* Texte secondaire : mélange d'encre et de canevas, contraste vérifié en test (≥ 4,5:1). */
  --encre-douce: color-mix(in srgb, var(--encre) 72%, var(--canevas));

  --cible-min: 44px;
  --largeur-texte: 38rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--canevas);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.entete {
  background: var(--encre);
  padding: 0.75rem 1rem;
}

.entete img {
  display: block;
  height: 64px;
  width: auto;
}

.page {
  max-width: var(--largeur-texte);
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}

h1 {
  font-family: var(--police-titre);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1.25rem;
}

/* Trait souligné : une seule touche « carnet d'atelier » par écran. */
.souligne {
  text-decoration: underline;
  text-decoration-color: var(--corail);
  text-decoration-thickness: 0.18em;
  text-underline-offset: 0.18em;
}

.etiquette {
  font-family: var(--police-etiquette);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

a {
  color: var(--encre);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
  display: inline-block;
  min-height: var(--cible-min);
  padding-block: 0.6rem;
}

a:hover {
  text-decoration-color: var(--corail);
}

:focus-visible {
  outline: 3px solid var(--encre);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--canevas);
}

[hidden] {
  display: none !important;
}

.visuellement-masque {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Questionnaire : volet sous la question sur mobile, à côté sur grand écran. */
.questionnaire {
  display: grid;
  gap: 2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

@media (min-width: 60rem) {
  .questionnaire {
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: start;
  }
}

.questionnaire-principal {
  max-width: var(--largeur-texte);
}

.progression-bloc progress {
  width: 100%;
  height: 0.5rem;
  accent-color: var(--encre);
}

.avertissement,
.erreurs {
  border-left: 4px solid var(--corail);
  padding: 0.75rem 1rem;
  margin: 0 0 1.5rem;
  background: var(--canevas);
}

.erreurs ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

.aide,
.exemple {
  color: var(--encre-douce);
}

.exemple {
  font-size: 0.9375rem;
  margin: 0.35rem 0 0;
}

.champ {
  margin: 0 0 1.5rem;
}

.champ > label,
legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="date"],
textarea,
select {
  width: 100%;
  min-height: var(--cible-min);
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--encre);
  background: var(--canevas);
  border: 2px solid var(--encre);
  border-radius: 6px;
}

::placeholder {
  color: var(--encre-douce);
  opacity: 1;
}

[aria-invalid="true"] input,
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--corail);
  border-width: 3px;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--cible-min);
  padding-block: 0.25rem;
  cursor: pointer;
}

.option input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  flex: none;
  accent-color: var(--encre);
}

.ne-sait-pas {
  margin: 0.5rem 0 1.5rem;
  font-style: italic;
}

.liens {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bouton-principal,
.bouton-secondaire {
  min-height: var(--cible-min);
  min-width: var(--cible-min);
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

/* Texte encre sur corail : 4,66:1 (AA). Jamais de texte blanc sur corail. */
.bouton-principal {
  background: var(--corail);
  color: var(--encre);
  border: 2px solid var(--corail);
  margin-left: auto;
}

.bouton-secondaire {
  background: transparent;
  color: var(--encre);
  border: 2px solid var(--encre);
}

.infobulle {
  margin: 0 0 1rem;
}

.infobulle-texte {
  margin: 0.5rem 0 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--sable);
  border-radius: 6px;
}

.fin {
  margin-top: 1.5rem;
  font-weight: 600;
}

.statut {
  min-height: 1.6em;
  margin: 1rem 0 0;
  color: var(--encre-douce);
}

/* Tableau de bord (réservé à Lesly). */
.page-large {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.filtres .champ {
  flex: 1 1 12rem;
}

.tableau-defilant {
  overflow-x: auto;
  margin: 0 0 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

caption {
  text-align: left;
  font-weight: 600;
  padding: 0.5rem 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--sable);
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  font-family: var(--police-etiquette);
  font-size: 0.8125rem;
  border: 1px solid var(--encre);
  border-radius: 4px;
  padding: 0 0.4rem;
}

.alertes li {
  margin-bottom: 0.5rem;
}

.fiche-section {
  margin: 2rem 0;
}

.fiche-identite {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.35rem 1rem;
}

.fiche-identite dt {
  font-weight: 600;
}

.fiche-identite dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.action p,
.action label,
.action textarea {
  flex: 1 1 100%;
  margin: 0;
}

.lien-tiers-texte {
  overflow-wrap: anywhere;
}

/* Page de suivi : frise horizontale, verticale sur mobile ; l'état est écrit, pas seulement coloré. */
.frise {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 48rem) {
  .frise {
    grid-template-columns: repeat(6, 1fr);
  }
}

.frise-etape {
  border-left: 4px solid var(--sable);
  padding: 0.4rem 0.75rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 48rem) {
  .frise-etape {
    border-left: 0;
    border-top: 4px solid var(--sable);
  }
}

.frise-etape.etape_terminee {
  border-color: var(--encre);
}

.frise-etape[aria-current="step"] {
  border-color: var(--corail);
  font-weight: 600;
}

.frise-statut {
  font-family: var(--police-etiquette);
  font-size: 0.8125rem;
}

.action-attendue,
.complement {
  border-left: 4px solid var(--corail);
  padding: 0.75rem 1rem;
  margin: 0 0 1.5rem;
}

.message-lesly {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.liste-complement li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.complement textarea {
  margin-bottom: 0.75rem;
}

.recap-section.surlignee {
  border-left: 4px solid var(--corail);
  padding-left: 0.75rem;
}

.fiche-titre {
  margin-top: 2rem;
}

.suppression {
  margin-top: 2.5rem;
  border-top: 2px solid var(--sable);
  padding-top: 1rem;
}

/* Fichiers joints. */
.liste-fichiers {
  padding-left: 1.25rem;
}

.liste-fichiers li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.zone-fichiers input[type="file"] {
  display: block;
  min-height: var(--cible-min);
  margin: 0.4rem 0;
  max-width: 100%;
}

.apercus {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.apercus img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 16rem;
  object-fit: contain;
  border: 1px solid var(--sable);
}

.recap-section {
  border-top: 1px solid var(--sable);
  padding: 1rem 0;
}

.recap-section h2 {
  font-size: 1.0625rem;
  margin: 0 0 0.5rem;
}

.recap-section ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  overflow-wrap: anywhere;
}

/* Bouton présenté comme un lien (liste des questions sans réponse). */
.lien-bouton {
  min-height: var(--cible-min);
  padding: 0.4rem 0;
  font: inherit;
  color: var(--encre);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  text-align: left;
}

.turnstile {
  margin-top: 1rem;
}

.volet {
  border-top: 2px solid var(--sable);
  padding-top: 1rem;
}

@media (min-width: 60rem) {
  .volet {
    border-top: 0;
    border-left: 2px solid var(--sable);
    padding: 0 0 0 1.5rem;
    position: sticky;
    top: 1rem;
  }
}

.volet h2 {
  font-family: var(--police-titre);
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.volet dt {
  font-family: var(--police-etiquette);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.75rem;
}

.volet dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
