/* Signalisation : bandeau bleu à listel blanc, jaune réservé à la fiche de demande, fond béton. */
@font-face { font-family: Archivo; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/assets/fonts/archivo-latin-standard-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Archivo; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/assets/fonts/archivo-latin-ext-standard-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bleu: #0b4a8f; --bleu-nuit: #07335f; --bleu-pale: #dfeaf7;
  --jaune: #ffd21e; --jaune-vif: #fff0a6;
  --encre: #14171c; --gris: #454d59; --trait: #7d8693; --trait-doux: #c3c9d2;
  --beton: #e9ebee; --plaque: #fff;
  --vert: #0a6b40; --rouge: #b80f28; --rouge-pale: #fdebee;
  --sortie: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--trait) var(--beton); }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--beton); color: var(--encre); font: 450 1.0625rem/1.5 Archivo, "Helvetica Neue", Arial, sans-serif; caret-color: var(--bleu); accent-color: var(--bleu); }
::selection { background: var(--jaune); color: var(--encre); }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }
h1, h2, p, dl, dd, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--bleu); text-underline-offset: .18em; }
svg { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
.cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.piege { position: absolute; left: -9999px; }

/* Mention des maquettes et des exemples */
.mention { background: var(--encre); color: #fff; font-size: .9375rem; line-height: 1.4; padding: .6rem max(1rem, env(safe-area-inset-left)); text-align: center; text-wrap: balance; }
.mention strong { color: var(--jaune); font-weight: 750; }
.mention a { color: #fff; }

/* Bandeau : un panneau d'information */
.bandeau { background: var(--bleu); color: #fff; padding: .5rem; padding-top: max(.5rem, env(safe-area-inset-top)); }
.bandeau-listel { max-width: 70rem; margin: 0 auto; border: 2px solid #fff; border-radius: 10px; padding: .6rem .9rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.bandeau-nom { font-weight: 800; font-stretch: 112%; font-size: 1.0625rem; line-height: 1.2; overflow-wrap: anywhere; text-wrap: balance; }
.bandeau-sous { margin-top: .1rem; font-size: .8125rem; line-height: 1.35; color: #e4eefb; }
.appel { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .9rem; background: #fff; color: var(--bleu-nuit); border-radius: 8px; font-weight: 750; text-decoration: none; white-space: nowrap; }

.chantier { flex: 1 0 auto; width: 100%; max-width: 40rem; margin: 0 auto; padding: .75rem 1rem 2rem; }
.cote { display: none; }

/* Itinéraire : les étapes comme des bornes sur un trajet */
.itineraire { display: grid; grid-template-columns: repeat(6, 1fr); }
.itineraire li { position: relative; display: flex; justify-content: center; }
.itineraire li + li::before { content: ""; position: absolute; top: 21px; right: calc(50% + 18px); width: calc(100% - 36px); height: 4px; border-radius: 2px; background: var(--trait-doux); }
.itineraire li.fait + li::before { background: var(--vert); }
.itineraire li > * { display: flex; flex-direction: column; align-items: center; gap: .25rem; min-height: 56px; padding: 7px 0 0; border: 0; background: none; width: 100%; }
.borne { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--plaque); border: 2px solid var(--trait); color: var(--gris); font-weight: 750; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.fait .borne { background: var(--vert); border-color: var(--vert); color: #fff; }
.ici .borne { background: var(--bleu); border-color: var(--bleu); color: #fff; box-shadow: 0 0 0 3px var(--beton), 0 0 0 5px var(--bleu); }
.borne-nom { font-size: .75rem; font-weight: 550; color: var(--gris); font-stretch: 94%; }
.ici .borne-nom { color: var(--encre); font-weight: 800; }

.etape { padding-top: 1rem; }
.question { font-size: 1.625rem; line-height: 1.12; font-weight: 800; font-stretch: 108%; letter-spacing: -.015em; text-wrap: balance; margin: .25rem 0 .5rem; }
.question:focus { outline: none; }
.chapo { color: var(--gris); max-width: 60ch; margin-bottom: .75rem; font-size: 1rem; line-height: 1.45; text-wrap: pretty; }
.facultatif { font-weight: 450; font-size: .875rem; color: var(--gris); }
.aide { color: var(--gris); font-size: .9375rem; line-height: 1.45; }

/* Choix principal : plaques à pictogramme */
.groupe { border: 0; margin: 1.5rem 0 0; padding: 0; min-width: 0; }
.groupe legend:not(.cache) { padding: 0; margin-bottom: .6rem; font-weight: 700; line-height: 1.35; float: left; width: 100%; }
.groupe legend + * { clear: both; }
.groupe-tuiles { margin-top: .75rem; }
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; }
.option { position: relative; display: flex; }
.tuile { position: relative; flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: .6rem; min-height: 7rem; padding: .85rem; background: var(--plaque); border: 2px solid var(--trait-doux); border-radius: 12px; font-weight: 650; line-height: 1.22; cursor: pointer; transition: background-color .18s var(--sortie), color .18s var(--sortie), border-color .18s; }
.tuile:hover { border-color: var(--bleu); }
a.tuile { color: inherit; text-decoration: none; }
.tuile-texte { text-wrap: balance; }
.disque { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--bleu); color: #fff; flex: none; }
.disque svg { width: 1.6rem; height: 1.6rem; }
.tuile-coche { position: absolute; top: 1rem; right: 1rem; width: 1.5rem; height: 1.5rem; opacity: 0; }
input:checked + .tuile { background: var(--bleu); border-color: var(--bleu); color: #fff; outline: 2px solid #fff; outline-offset: -7px; }
input:checked + .tuile .disque { background: #fff; color: var(--bleu); }
input:checked + .tuile .tuile-coche { opacity: 1; }
input:focus-visible + .tuile, input:focus-visible + .jeton { box-shadow: 0 0 0 3px var(--beton), 0 0 0 6px var(--encre); }

/* Réponses courtes */
.jetons { display: flex; flex-wrap: wrap; gap: .5rem; }
.jeton { display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; padding: .55rem .95rem; background: var(--plaque); border: 2px solid var(--trait-doux); border-radius: 10px; font-weight: 550; line-height: 1.25; cursor: pointer; transition: background-color .15s var(--sortie), color .15s, border-color .15s; }
.jeton:hover { border-color: var(--bleu); }
.jeton-coche { display: none; }
input:checked + .jeton { background: var(--bleu); border-color: var(--bleu); color: #fff; }
input:checked + .jeton .jeton-coche { display: block; }
input:checked + .jeton-urgent { background: var(--rouge); border-color: var(--rouge); }

.conseil { display: flex; gap: .6rem; margin-top: .75rem; padding: .8rem .9rem; background: var(--bleu-pale); border: 2px solid var(--bleu); border-radius: 10px; font-weight: 550; line-height: 1.4; }
.conseil svg { color: var(--bleu); width: 1.5rem; height: 1.5rem; }
.consigne { display: flex; gap: .6rem; margin-top: .75rem; padding: .8rem .9rem; background: var(--rouge-pale); border: 2px solid var(--rouge); border-radius: 10px; font-weight: 550; line-height: 1.4; animation: poser .35s var(--sortie); }
.consigne svg { color: var(--rouge); width: 1.5rem; height: 1.5rem; }
.consigne a { color: var(--rouge); font-weight: 800; white-space: nowrap; }

/* Saisies */
.champ { margin-top: 1.25rem; min-width: 0; }
.champ label { display: block; font-weight: 700; margin-bottom: .35rem; }
.champ .aide { margin: -.2rem 0 .4rem; }
.saisie { display: block; width: 100%; min-height: 3.25rem; padding: .7rem .85rem; background: var(--plaque); color: var(--encre); border: 2px solid var(--trait); border-radius: 10px; font: inherit; }
textarea.saisie { resize: vertical; min-height: 7rem; line-height: 1.45; }
.saisie::placeholder { color: #5a626e; }
.saisie:focus-visible { border-color: var(--bleu); outline: 3px solid rgb(11 74 143 / .3); outline-offset: 1px; }
.saisie[aria-invalid="true"] { border-color: var(--rouge); }
.rangee { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .75rem; align-items: start; }
.erreur { display: flex; gap: .4rem; align-items: flex-start; margin-top: .45rem; color: var(--rouge); font-weight: 650; font-size: .9375rem; line-height: 1.4; }
.erreur svg { margin-top: .08em; }
.en-erreur .tuile, .en-erreur .jeton { border-color: var(--rouge); }

/* Photos */
.depot { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; padding: 1.1rem; background: var(--plaque); border: 2px dashed var(--bleu); border-radius: 12px; cursor: pointer; }
.depot strong { display: block; font-size: 1.125rem; font-weight: 750; }
.depot span span { display: block; color: var(--gris); font-size: .9375rem; line-height: 1.35; }
.depot:hover, .depot.survol { background: var(--bleu-pale); }
.depot.plein { opacity: .6; cursor: default; }
input:focus-visible + .depot { outline: 3px solid var(--encre); outline-offset: 3px; }
.photos-etat { min-height: 1.5rem; margin: .5rem 0; font-weight: 600; font-size: .9375rem; }
.vignettes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.vignettes li { position: relative; animation: poser .4s var(--sortie); }
.vignettes img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 2px solid var(--encre); background: var(--plaque); }
.retirer { position: absolute; top: .35rem; right: .35rem; display: grid; place-items: center; width: 44px; height: 44px; background: #fff; border: 2px solid var(--encre); border-radius: 8px; }

.confidentiel { display: flex; gap: .6rem; margin-top: 1.75rem; color: var(--gris); font-size: .9375rem; line-height: 1.45; }

/* La fiche : le panneau jaune, c'est-à-dire ce que reçoit l'artisan */
.panneau { background-color: var(--jaune); border: 3px solid var(--encre); border-radius: 14px; padding: .4rem .9rem .5rem;
  background-image: radial-gradient(circle, var(--encre) 3px, transparent 3.5px), radial-gradient(circle, var(--encre) 3px, transparent 3.5px);
  background-size: 14px 14px; background-position: 6px 6px, calc(100% - 6px) 6px; background-repeat: no-repeat; }
.panneau-titre { font-size: 1.375rem; font-weight: 850; font-stretch: 118%; letter-spacing: -.01em; line-height: 1.15; padding: .85rem .1rem 0; }
.panneau-pour { padding: .15rem .1rem .65rem; font-size: .9375rem; font-weight: 550; line-height: 1.35; border-bottom: 3px solid var(--encre); overflow-wrap: anywhere; }
.ligne { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .5rem; padding: .55rem .1rem; border-bottom: 1px solid rgb(20 23 28 / .45); }
.ligne:last-child { border-bottom: 0; }
.ligne dt { grid-column: 1; font-size: .8125rem; font-weight: 550; color: #3f3a1c; line-height: 1.3; }
.ligne dd { grid-column: 1; font-weight: 700; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; min-width: 0; }
.ligne.neuve::before { content: ""; position: absolute; inset: 2px -.4rem; border-radius: 6px; background: #fff; opacity: 0; pointer-events: none; animation: eclairer .9s var(--sortie); z-index: 0; }
.ligne.neuve > * { position: relative; z-index: 1; }
.blanc { display: inline-block; min-width: 65%; font-weight: 450; font-size: .875rem; color: #4d4720; border-bottom: 2px dotted rgb(20 23 28 / .5); }
.paires { white-space: normal; }
.paires li span { font-weight: 450; }
.mini { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .2rem; }
.mini img { width: 3.25rem; height: 3.25rem; object-fit: cover; border-radius: 6px; border: 2px solid var(--encre); }
.modifier { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: grid; place-items: center; width: 44px; height: 44px; background: var(--plaque); border: 2px solid var(--encre); border-radius: 8px; }
.panneau-final { margin-top: .75rem; }

/* Barre d'action */
.barre { position: sticky; bottom: 0; z-index: 5; background: var(--plaque); border-top: 2px solid var(--encre); }
.tiroir { max-height: min(60dvh, 34rem); overflow: auto; overscroll-behavior: contain; padding: .75rem; background: var(--beton); border-bottom: 2px solid var(--encre); animation: monter .25s var(--sortie); }
.barre-actions { display: flex; gap: .5rem; max-width: 40rem; margin: 0 auto; padding: .65rem .75rem max(.65rem, env(safe-area-inset-bottom)); }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 3.25rem; padding: .5rem .85rem; border-radius: 10px; border: 2px solid transparent; font-weight: 750; line-height: 1.2; text-decoration: none; text-align: center; }
.bouton-retour { width: 3.25rem; padding: 0; background: var(--plaque); border-color: var(--trait); }
.bouton-retour:disabled { opacity: .35; }
.bouton-fiche { background: var(--plaque); border-color: var(--encre); padding: .4rem .7rem; white-space: nowrap; }
.bouton-fiche[aria-expanded="true"] { background: var(--jaune); }
.fiche-puce { display: grid; place-items: center; min-width: 1.75rem; height: 1.75rem; border-radius: 6px; background: var(--jaune); border: 2px solid var(--encre); font-size: .875rem; font-variant-numeric: tabular-nums; }
.fiche-puce.bouge { animation: sauter .45s var(--sortie); }
.bouton-suite { flex: 1 1 0; min-width: 0; background: var(--bleu); color: #fff; outline: 2px solid rgb(255 255 255 / .8); outline-offset: -6px; transition: background-color .15s; }
.bouton-suite:hover { background: var(--bleu-nuit); }
.bouton-suite:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
.bouton-envoyer { background: var(--vert); }
.bouton-envoyer:hover { background: #07502f; }
.bouton-suite:disabled { opacity: .7; }
.bouton-simple { background: var(--plaque); border-color: var(--encre); color: var(--encre); }
.bouton-simple:hover { background: var(--jaune-vif); }

body[data-etape="5"] .bouton-fiche { display: none; }
#jeton { margin-top: 1rem; }
.message { margin-top: .75rem; padding: .9rem; border-radius: 10px; border: 2px solid var(--rouge); background: var(--rouge-pale); }
.message p { display: flex; gap: .5rem; font-weight: 600; line-height: 1.4; }
.message p svg { color: var(--rouge); }
.message-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

/* Après l'envoi */
.reussite { display: flex; align-items: center; gap: .9rem; margin: .75rem 0 .5rem; }
.reussite .disque { background: var(--vert); animation: sauter .6s var(--sortie); }
.reussite .question { margin: 0; }
.apercu { margin: 1rem 0 1.25rem; border: 2px solid var(--encre); border-radius: 12px; overflow: hidden; background: var(--plaque); }
.apercu-sujet { padding: .7rem .9rem; border-bottom: 2px solid var(--encre); line-height: 1.35; overflow-wrap: anywhere; }
.apercu-sujet span { display: block; font-size: .8125rem; color: var(--gris); }
.apercu-corps { display: block; width: 100%; min-height: 24rem; border: 0; }
.proposition { margin: 0 0 1.25rem; padding: 1.25rem; background: var(--bleu); color: #fff; border-radius: 12px; outline: 2px solid #fff; outline-offset: -8px; }
.proposition h2 { font-size: 1.25rem; font-stretch: 110%; line-height: 1.2; text-wrap: balance; margin-bottom: .5rem; }
.proposition p { margin-bottom: .9rem; }
.proposition .bouton { background: #fff; color: var(--bleu-nuit); outline: 0; flex: none; }
.proposition .aide { color: #e4eefb; margin: .6rem 0 0; }

.pied { padding: 1.25rem 1rem 1.5rem; text-align: center; color: var(--gris); font-size: .875rem; line-height: 1.5; }

@keyframes poser { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes monter { from { transform: translateY(12px); opacity: 0; } }
@keyframes sauter { 40% { transform: scale(1.25); } }
@keyframes eclairer { 0% { opacity: 1; clip-path: inset(0 100% 0 0); } 35% { opacity: 1; clip-path: inset(0 0 0 0); } 100% { opacity: 0; clip-path: inset(0 0 0 0); } }

@media (max-width: 22.5rem) {
  .tuiles { grid-template-columns: 1fr; }
  .tuile { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 4.25rem; }
  .borne-nom { display: none; }
  .ici .borne-nom { display: block; }
  .bouton-fiche span:last-child { display: none; }
  .rangee { grid-template-columns: 1fr; gap: 0; }
}

@media (min-width: 40rem) {
  .bandeau-nom { font-size: 1.1875rem; }
  .bandeau-sous { font-size: .875rem; }
  .question { font-size: 1.875rem; }
  .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vignettes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 62rem) {
  .chantier { max-width: 72rem; display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 3rem; align-items: start; padding: 1.5rem 2rem 3rem; }
  .cote { display: block; position: sticky; top: 1.5rem; max-height: calc(100dvh - 7rem); overflow: auto; }
  .cote-note { margin-top: .75rem; color: var(--gris); font-size: .9375rem; text-align: center; text-wrap: balance; }
  .question { font-size: 2.25rem; }
  .barre-actions { max-width: 72rem; padding-left: 2rem; padding-right: calc(2rem + 27rem); }
  .bouton-fiche, .tiroir { display: none; }
  body[data-etape="5"] .chantier, body[data-etape="fin"] .chantier { grid-template-columns: minmax(0, 1fr); max-width: 46rem; }
  body[data-etape="5"] .cote, body[data-etape="fin"] .cote { display: none; }
  body[data-etape="5"] .barre-actions { max-width: 46rem; padding-right: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
