/* Fin de chantier — mêmes couleurs et polices que le site synum.fr. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url("../fonts/archivo-latin-800-normal.woff2") format("woff2"); }

:root {
  --fond: #F6F4EF;
  --fond-2: #EDE9E0;
  --encre: #1C1B19;
  --texte-2: #46433D;
  --texte-3: #5C5850;
  --bordure: #D6D0C4;
  --accent: #B23A0B;
  --accent-fonce: #962F08;
  --erreur: #A3200F;
  --blanc: #FFFFFF;
  --titres: "Archivo", system-ui, sans-serif;
  --tactile: 56px; /* hauteur des zones à toucher : doigts épais, gants, écran sale */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Barre du haut */
.barre {
  position: sticky; top: 0; z-index: 1;
  background: var(--encre); color: var(--fond);
  padding: calc(env(safe-area-inset-top) + .75rem) 1rem .75rem;
}
.barre__titre { font-family: var(--titres); font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.barre__etat { margin-top: .35rem; font-size: .95rem; color: #F3C9B3; }

.contenu {
  max-width: 40rem; margin: 0 auto;
  padding: 1.25rem 1rem calc(env(safe-area-inset-bottom) + 2rem);
  display: flex; flex-direction: column; gap: 1.25rem;
  outline: none;
}
.titre { font-family: var(--titres); font-weight: 800; font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.01em; }

/* Boutons */
.bouton {
  display: flex; align-items: center; justify-content: center;
  min-height: var(--tactile); padding: .75rem 1.25rem; border-radius: 10px;
  border: 0; background: var(--accent); color: var(--blanc);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  touch-action: manipulation;
}
.bouton:active { background: var(--accent-fonce); }
.bouton:disabled { opacity: .6; }
.bouton--grand { width: 100%; min-height: 64px; font-size: 1.2rem; }

.retour {
  display: inline-flex; align-items: center; align-self: flex-start;
  min-height: 48px; padding-right: 1rem; font-weight: 600; text-decoration: none; color: var(--texte-2);
}

/* Liste des chantiers */
.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.carte {
  display: flex; flex-direction: column; gap: .15rem;
  min-height: 72px; padding: 1rem 1.1rem; border-radius: 12px;
  background: var(--blanc); border: 1.5px solid var(--bordure); text-decoration: none;
}
.carte:active { border-color: var(--accent); }
.carte__titre { font-weight: 600; font-size: 1.2rem; }
.carte__ligne { color: var(--texte-2); }
.carte__ligne--discrete { color: var(--texte-3); font-size: 1rem; }
.vide { color: var(--texte-2); }

/* Formulaires */
.formulaire { display: flex; flex-direction: column; gap: 1.25rem; }
.champ { display: flex; flex-direction: column; gap: .4rem; }
.champ label { font-weight: 600; }
.facultatif { font-weight: 400; color: var(--texte-3); }
.champ input, .champ textarea {
  width: 100%; min-height: var(--tactile); padding: .75rem .9rem;
  border: 1.5px solid var(--bordure); border-radius: 10px; background: var(--blanc);
  font: inherit; font-size: 1.15rem; color: var(--encre);
}
.champ textarea { resize: vertical; }
.champ input:focus, .champ textarea:focus { border-color: var(--encre); outline: none; }
.erreur { color: var(--erreur); font-weight: 600; }
.erreur:empty { display: none; }

.puces { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.puce {
  min-height: 48px; padding: .5rem 1rem; border-radius: 999px;
  border: 1.5px solid var(--bordure); background: var(--fond-2); color: var(--encre);
  font: inherit; font-size: 1rem; cursor: pointer; touch-action: manipulation;
}
.puce:active { border-color: var(--accent); }

/* Fiche chantier */
.infos { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; }
.infos dt { color: var(--texte-3); }
.infos dd { font-weight: 600; overflow-wrap: anywhere; }
.bientot { padding: 1rem 1.1rem; border-radius: 12px; background: var(--fond-2); color: var(--texte-2); }
.bientot h2 { font-size: 1rem; margin-bottom: .25rem; color: var(--encre); }

/* Blocs de la fiche chantier */
.bloc { display: flex; flex-direction: column; gap: .75rem; padding-top: 1.25rem; border-top: 1.5px solid var(--bordure); }
.bloc__titre { font-family: var(--titres); font-weight: 800; font-size: 1.3rem; }
.compteur { font-family: "Inter", system-ui, sans-serif; font-weight: 400; color: var(--texte-3); }
.bouton--contour { background: transparent; color: var(--encre); border: 1.5px solid var(--encre); }
.bouton--contour:active { background: var(--fond-2); }
.bouton--danger { background: var(--erreur); }
.bouton--clair { background: var(--fond); color: var(--encre); }
.bouton--clair:active { background: var(--fond-2); }
.statut { color: var(--texte-2); font-size: 1rem; }
.statut:empty { display: none; }
.statut--erreur { color: var(--erreur); font-weight: 600; }

/* Photos */
.actions-photo { display: grid; grid-template-columns: 2fr 1fr; gap: .75rem; }
.vignettes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.vignettes[hidden] { display: none; }
.vignette { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--fond-2); cursor: pointer; }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }

.visionneuse { width: 100%; max-width: 40rem; max-height: 100%; margin: auto; padding: 1rem; border: 0; border-radius: 12px; background: var(--encre); color: var(--fond); }
.visionneuse::backdrop { background: rgb(0 0 0 / .8); }
.visionneuse img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.visionneuse__date { margin: .75rem 0; font-size: 1rem; color: #CFC9BE; }
.visionneuse__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* Secours quand le viseur intégré ne s'ouvre pas */
.secours { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; border-radius: 12px; background: var(--fond-2); }
.secours[hidden] { display: none; }
.secours__texte { color: var(--texte-2); font-size: 1rem; }

/* Viseur intégré (plein écran) */
.viseur {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #000; color: var(--fond);
}
.viseur[open] { display: flex; flex-direction: column; }
.viseur::backdrop { background: #000; }
.viseur__titre { padding: calc(env(safe-area-inset-top) + .75rem) 1rem .5rem; font-weight: 600; }
.viseur__video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.viseur--flash .viseur__video { opacity: .3; }
.viseur__barre {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 1rem 1rem calc(env(safe-area-inset-bottom) + 1.25rem);
}
.viseur__declencheur {
  width: 80px; height: 80px; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--blanc); border: 6px solid #6B6760; box-shadow: 0 0 0 3px var(--blanc);
  touch-action: manipulation;
}
.viseur__declencheur:active { background: #DDD; }
.viseur__declencheur:disabled { opacity: .6; }
.viseur__compteur { font-weight: 400; color: #CFC9BE; }
.viseur__torche {
  justify-self: start; display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%; padding: 0; cursor: pointer;
  background: rgb(255 255 255 / .15); color: var(--blanc); border: 2px solid rgb(255 255 255 / .6);
  touch-action: manipulation;
}
.viseur__torche[hidden] { display: none; }
.viseur__torche[aria-pressed="true"] { background: #FFD34D; color: var(--encre); border-color: #FFD34D; }

/* Pied de l'accueil et page Diagnostic */
.pied { margin-top: 1.5rem; text-align: center; font-size: .95rem; }
.pied a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1rem; color: var(--texte-3); }
.liste-diagnostic { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.liste-diagnostic li { padding: .75rem 1rem; border-radius: 10px; background: var(--blanc); border: 1.5px solid var(--bordure); overflow-wrap: anywhere; }
.diagnostic__cameras { display: flex; flex-direction: column; gap: .75rem; }
.diagnostic__cameras:empty { display: none; }

/* Temps passé */
.duree { font-family: var(--titres); font-weight: 800; font-size: 2.4rem; line-height: 1.1; }
.actions-duree { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.puce[aria-pressed="true"] { background: var(--encre); color: var(--fond); border-color: var(--encre); }

/* Matériel */
.bloc__aide { color: var(--texte-3); font-size: 1rem; }
.puce__unite { color: var(--texte-3); }
.puce[aria-pressed="true"] .puce__unite { color: inherit; }
.lignes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.lignes[hidden] { display: none; }
.ligne { display: flex; flex-direction: column; gap: .5rem; padding: .75rem .9rem; border-radius: 12px; background: var(--blanc); border: 1.5px solid var(--bordure); }
.ligne__libelle { font-weight: 600; overflow-wrap: anywhere; }
.ligne__reglage { display: flex; align-items: center; gap: .5rem; }
.ligne__unite { min-width: 2.5rem; color: var(--texte-2); }
.quantite {
  width: 4.5rem; min-height: 48px; padding: .5rem; text-align: center;
  border: 1.5px solid var(--bordure); border-radius: 10px; background: var(--fond);
  font: inherit; font-size: 1.15rem; font-weight: 600; color: var(--encre);
}
.quantite:focus { border-color: var(--encre); outline: none; }
.bouton-rond {
  flex: none; width: 48px; height: 48px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1.5px solid var(--encre); background: transparent; color: var(--encre);
  font: inherit; font-size: 1.5rem; line-height: 1; touch-action: manipulation;
}
.bouton-rond:active { background: var(--fond-2); }
.bouton-rond:disabled { opacity: .35; }
.bouton-rond--discret { margin-left: auto; border-color: var(--bordure); color: var(--texte-3); }
.formulaire--encart { padding: 1rem; border-radius: 12px; background: var(--fond-2); }
.formulaire[hidden] { display: none; }
.champ__libelle { font-weight: 600; }

/* Temps passé : jour, personnes, récapitulatif */
.jour-choisi { font-weight: 600; color: var(--texte-2); margin-bottom: -.5rem; }
.puce--date { position: relative; display: inline-flex; align-items: center; overflow: hidden; }
.champ-date { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.personnes { display: flex; align-items: center; gap: .75rem; }
.personnes__libelle { font-weight: 600; margin-right: auto; }
.personnes__nombre { min-width: 2ch; text-align: center; font-family: var(--titres); font-weight: 800; font-size: 1.6rem; }
.recap { display: flex; flex-direction: column; gap: .5rem; }
.recap:empty { display: none; }
.recap__jours { list-style: none; margin: 0; padding: .75rem 1rem; border-radius: 12px; background: var(--fond-2); display: flex; flex-direction: column; gap: .35rem; }
.recap__jours li { display: flex; justify-content: space-between; gap: 1rem; }
.recap__jours li span:first-child { color: var(--texte-2); }
.recap__total { font-weight: 600; }

/* Réserves */
.reserves { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.reserves[hidden] { display: none; }
.reserve { display: flex; flex-direction: column; gap: .5rem; padding: .75rem .9rem; border-radius: 12px; background: var(--blanc); border: 1.5px solid var(--bordure); }
.reserve__numero { font-weight: 600; color: var(--texte-2); font-size: 1rem; }
.reserve__texte {
  width: 100%; min-height: 64px; padding: .6rem .75rem; resize: vertical;
  border: 1.5px solid var(--bordure); border-radius: 10px; background: var(--fond);
  font: inherit; font-size: 1.1rem; color: var(--encre);
}
.reserve__texte:focus { border-color: var(--encre); outline: none; }
.reserve__actions { display: flex; align-items: center; gap: .5rem; }
.bouton--petit { min-height: 48px; padding: .5rem 1rem; font-size: 1rem; }
.vignettes--petites { grid-template-columns: repeat(4, 1fr); }
.vide[hidden] { display: none; }

/* Sommaire du chantier : une carte par étape */
.etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.etape {
  display: flex; align-items: center; gap: .9rem; min-height: 72px; padding: .8rem 1rem;
  border-radius: 12px; background: var(--blanc); border: 1.5px solid var(--bordure); text-decoration: none;
}
a.etape:active { border-color: var(--accent); }
.etape__numero {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; background: var(--fond-2);
  font-family: var(--titres); font-weight: 800;
}
.etape--faite .etape__numero { background: var(--encre); color: var(--fond); }
.etape__texte { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.etape__titre { font-weight: 600; font-size: 1.15rem; }
.etape__resume { color: var(--texte-2); font-size: 1rem; }
.etape__fleche { font-size: 1.8rem; color: var(--texte-3); }
.etape--bientot { background: transparent; border-style: dashed; color: var(--texte-3); }

/* Écran d'une étape */
.etape-ecran { display: flex; flex-direction: column; gap: 1.25rem; }
.etape-ecran > .bloc:first-child { border-top: 0; padding-top: 0; }
.etape-ecran > .bloc:only-child > .bloc__titre { display: none; } /* déjà dans le titre de l'écran */
.suite { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; padding-top: 1.25rem; border-top: 1.5px solid var(--bordure); }

/* Petite fenêtre de question (date d'une photo de galerie) */
.question { width: calc(100% - 2rem); max-width: 28rem; margin: auto; padding: 1.25rem; border: 0; border-radius: 14px; background: var(--fond); color: var(--encre); }
.question::backdrop { background: rgb(0 0 0 / .6); }
.question__titre { font-family: var(--titres); font-weight: 800; font-size: 1.4rem; }
.question__aide { margin: .5rem 0 1rem; color: var(--texte-2); font-size: 1rem; }
.question__choix { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.visionneuse__large { grid-column: 1 / -1; }

/* Signature */
.etape--alerte { border-color: var(--erreur); }
.etape--alerte .etape__resume { color: var(--erreur); font-weight: 600; }
.alerte { padding: .75rem 1rem; border-radius: 10px; background: #FBE3DD; color: var(--erreur); font-weight: 600; }
.compte-rendu { display: flex; flex-direction: column; gap: .4rem; padding: 1rem; border-radius: 12px; background: var(--blanc); border: 1.5px solid var(--bordure); }
.compte-rendu__titre { font-family: var(--titres); font-weight: 800; font-size: 1.15rem; margin-bottom: .25rem; }
.compte-rendu h3 { margin: .6rem 0 0; font-size: 1rem; color: var(--texte-3); text-transform: uppercase; letter-spacing: .04em; }
.compte-rendu ul { margin: 0; padding-left: 1.1rem; }
.compte-rendu__total { list-style: none; margin-left: -1.1rem; font-weight: 600; }
.compte-rendu__photos { margin-top: .6rem; color: var(--texte-2); }
.signature__zone {
  display: block; width: 100%; height: 220px; border-radius: 12px; background: var(--blanc);
  border: 2px dashed var(--texte-3); touch-action: none; cursor: crosshair;
}
.signature__faite { margin: 0; padding: 1rem; border-radius: 12px; background: var(--blanc); border: 1.5px solid var(--bordure); }
.signature__faite img { display: block; width: 100%; height: auto; }
.signature__faite figcaption { margin-top: .5rem; font-weight: 600; }

/* Envoi, chantiers terminés */
.ok { padding: .75rem 1rem; border-radius: 10px; background: #E3EEDD; color: #2F5A1E; font-weight: 600; }
.termine { display: flex; flex-direction: column; gap: .75rem; }
.separateur { width: 100%; border: 0; border-top: 1.5px solid var(--bordure); margin: .25rem 0; }
.titre--secondaire { font-size: 1.3rem; margin-top: .75rem; color: var(--texte-2); }
.liste--terminee .carte { background: transparent; }
.pied { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .5rem; }

/* Suivi des e-mails */
.envois { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.envois[hidden] { display: none; }
.envoi { display: flex; flex-direction: column; gap: .5rem; padding: .75rem 1rem; border-radius: 10px; font-weight: 600; }
.envoi--envoye { background: #E3EEDD; color: #2F5A1E; }
.envoi--en_attente { background: var(--fond-2); color: var(--texte-2); }
.envoi--erreur { background: #FBE3DD; color: var(--erreur); }

/* État de la sauvegarde (accueil) */
.sauvegarde { margin-top: 1rem; font-size: .95rem; color: var(--texte-2); text-align: center; }
.sauvegarde.ok, .sauvegarde.alerte { padding: .6rem .9rem; border-radius: 10px; text-align: left; }
.sauvegarde[hidden] { display: none; }

/* Récupération des données */
.progression { width: 100%; height: 14px; accent-color: var(--accent); }
.progression[hidden] { display: none; }
.bilan { display: flex; flex-direction: column; gap: .75rem; }
.bilan:empty { display: none; }
.proposition { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; border-radius: 12px; background: var(--fond-2); }
.proposition[hidden] { display: none; }

/* Version d'essai */
.barre__essai { margin-top: .35rem; font-size: .95rem; color: #FFD34D; }
.barre__essai a { color: var(--blanc); font-weight: 600; }
.barre__essai[hidden] { display: none; }
.essai { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; padding-top: 1.25rem; border-top: 1.5px solid var(--bordure); }

/* Installation sur l'écran d'accueil */
.installation { margin: .25rem 0; }
.installation[hidden] { display: none; }
.etapes-installation { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: .5rem; }
