/* =============================================================
   Suivi atelier Combeing — feuille de style unique.
   Ecrite mobile-first : le technicien est sur telephone,
   la commerciale sur ordinateur.
   ============================================================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--police-texte);
  font-size: 16px;
  line-height: 1.55;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--police-titre); font-weight: 700; line-height: 1.2; margin: 0 0 var(--e3); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 var(--e3); }
a { color: var(--marine); }

img { max-width: 100%; display: block; }

.conteneur { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--e3); }
.conteneur-etroit { max-width: 760px; }

/* ------------------------------------------------------------ entete --- */

.entete {
  background: var(--marine);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.entete__barre {
  display: flex;
  align-items: center;
  gap: var(--e3);
  min-height: 60px;
  flex-wrap: wrap;
  padding: var(--e2) var(--e3);
  max-width: 1180px;
  margin: 0 auto;
}
.marque {
  font-family: var(--police-titre);
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
}
.marque span { color: var(--dore); display: block; font-size: .68rem; letter-spacing: .12em; font-family: var(--police-texte); }
.nav { display: flex; gap: var(--e1); flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a, .nav button {
  color: #dbe3ea;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  font-size: .92rem;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.actif { background: var(--dore); color: var(--marine-fonce); font-weight: 600; }

/* ------------------------------------------------------------- blocs --- */

main { padding: var(--e4) 0 var(--e6); }

.carte {
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--ombre);
  padding: var(--e4);
  margin-bottom: var(--e4);
}
.carte--compacte { padding: var(--e3); border-radius: var(--r-m); }

.grille { display: grid; gap: var(--e3); }
@media (min-width: 760px) {
  .grille--2 { grid-template-columns: 1fr 1fr; }
  .grille--3 { grid-template-columns: repeat(3, 1fr); }
  .grille--principal { grid-template-columns: 2fr 1fr; align-items: start; gap: var(--e4); }
}

.titre-page { display: flex; align-items: center; gap: var(--e3); flex-wrap: wrap; margin-bottom: var(--e4); }
.titre-page h1 { margin: 0; }

.entrefilet { color: var(--texte-doux); font-size: .9rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .85rem; }

/* ----------------------------------------------------------- boutons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--marine);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .05s;
  min-height: 46px;
}
.btn:hover { background: var(--marine-fonce); }
.btn:active { transform: translateY(1px); }
.btn--or { background: var(--dore); color: var(--marine-fonce); }
.btn--or:hover { background: var(--dore-fonce); }
.btn--fantome { background: transparent; color: var(--marine); border-color: var(--bordure); }
.btn--fantome:hover { background: var(--creme); }
.btn--danger { background: transparent; color: var(--danger); border-color: #e8c4c1; }
.btn--danger:hover { background: var(--danger-fond); }
.btn--petit { padding: 7px 14px; min-height: 36px; font-size: .85rem; }
.btn--bloc { width: 100%; }
.btn--succes { background: var(--succes); }
.btn--succes:hover { background: #246441; }

.barre-actions { display: flex; gap: var(--e2); flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------- formulaire -- */

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--marine); }
input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=password], input[type=search], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--bordure);
  border-radius: var(--r-s);
  font: inherit;
  background: #fff;
  color: var(--texte);
  min-height: 46px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(190,162,121,.45);
  outline-offset: 0;
  border-color: var(--dore);
}
.champ { margin-bottom: var(--e3); }
.aide { font-size: .82rem; color: var(--texte-doux); margin-top: 4px; }

.case {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--bordure);
  border-radius: var(--r-m);
  background: #fff;
  cursor: pointer;
  margin-bottom: var(--e2);
  transition: border-color .15s, background .15s;
}
.case:hover { border-color: var(--dore); }
.case input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--marine); }
.case__texte { font-weight: 600; color: var(--texte); }
.case__texte small { display: block; font-weight: 400; color: var(--texte-doux); font-size: .84rem; }
.case--active { border-color: var(--marine); background: #f7f9fb; }
.sous-options { margin: 0 0 var(--e3) 34px; padding-left: var(--e3); border-left: 2px solid var(--bordure); }
.sous-options .case { padding: 10px 14px; }

fieldset { border: 0; margin: 0 0 var(--e4); padding: 0; }
legend { font-family: var(--police-titre); font-size: 1.1rem; font-weight: 700; margin-bottom: var(--e2); padding: 0; color: var(--marine); }

/* --------------------------------------------------------- messages ---- */

.alerte {
  padding: 12px 16px;
  border-radius: var(--r-m);
  margin-bottom: var(--e3);
  font-size: .93rem;
  border: 1px solid transparent;
}
.alerte--ok { background: var(--succes-fond); color: #1d5c3b; border-color: #bfe0cf; }
.alerte--ko { background: var(--danger-fond); color: #8c1d17; border-color: #f0c8c5; }
.alerte--info { background: #eef3f8; color: #1F344A; border-color: #cfdce8; }

/* --------------------------------------------------------- etiquettes -- */

.etiq {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 600;
  background: var(--creme);
  color: var(--marine);
  border: 1px solid var(--bordure);
  white-space: nowrap;
}
.etiq--ok { background: var(--succes-fond); color: #1d5c3b; border-color: #bfe0cf; }
.etiq--attente { background: #fff; color: var(--texte-doux); }
.etiq--or { background: rgba(190,162,121,.18); border-color: var(--dore); color: #6b5426; }

/* ------------------------------------------------------------ listes --- */

.liste-projets { display: grid; gap: var(--e3); }
@media (min-width: 700px) { .liste-projets { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }

.projet-carte {
  background: #fff;
  border-radius: var(--r-m);
  box-shadow: var(--ombre);
  padding: var(--e3);
  text-decoration: none;
  color: inherit;
  display: block;
  border-left: 5px solid var(--dore);
  transition: box-shadow .15s, transform .1s;
}
.projet-carte:hover { box-shadow: var(--ombre-forte); transform: translateY(-2px); }
.projet-carte--termine { border-left-color: var(--succes); }
.projet-carte--archive { border-left-color: var(--bordure); opacity: .75; }
.projet-carte__titre { font-family: var(--police-titre); font-weight: 700; font-size: 1.1rem; margin-bottom: 2px; }
.projet-carte__meta { color: var(--texte-doux); font-size: .88rem; margin-bottom: var(--e2); }

.jauge { height: 9px; background: var(--creme); border-radius: var(--r-pill); overflow: hidden; }
.jauge__barre { height: 100%; background: linear-gradient(90deg, var(--kaki), var(--dore)); border-radius: var(--r-pill); transition: width .5s ease; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-doux); }
.table-responsive { overflow-x: auto; }

/* ============================================================ ETAPES === */

.etape {
  border: 1px solid var(--bordure);
  border-radius: var(--r-m);
  background: #fff;
  margin-bottom: var(--e3);
  overflow: hidden;
}
/* Etape terminee : toute la bulle en vert pour la reperer d'un coup d'oeil. */
.etape--faite { border-color: #9fd0b1; background: #cfe9d8; }
.etape--courante { border-color: var(--dore); box-shadow: 0 0 0 3px rgba(190,162,121,.22); }
.etape__tete {
  display: flex;
  align-items: center;
  gap: var(--e2);
  padding: var(--e3);
  flex-wrap: wrap;
}
.etape__num {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--creme);
  color: var(--marine);
  font-weight: 700;
  font-size: .9rem;
}
.etape--faite .etape__num { background: var(--succes); color: #fff; }
.etape--courante .etape__num { background: var(--dore); color: var(--marine-fonce); }
.etape__nom { font-weight: 600; flex: 1 1 180px; }
.etape__famille { font-size: .76rem; color: var(--texte-doux); display: block; font-weight: 400; }
.etape__corps { padding: 0 var(--e3) var(--e3); }

/* Zone d'actions repliable (etape terminee : repliee par defaut). */
.etape__actions { margin-top: var(--e2); }
.etape__actions > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-s);
  font-size: .9rem;
  font-weight: 600;
  color: var(--marine);
  background: rgba(255,255,255,.65);
  border: 1px dashed var(--bordure);
  user-select: none;
}
.etape__actions > summary::-webkit-details-marker { display: none; }
.etape__actions > summary::before {
  content: "›";
  display: inline-block;
  font-size: 1.3rem;
  line-height: 1;
  transition: transform .15s;
}
.etape__actions[open] > summary::before { transform: rotate(90deg); }
.etape__actions[open] > summary { margin-bottom: var(--e2); }
.etape__actions > summary:hover { border-color: var(--dore); }

.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--e2); }
@media (min-width: 700px) { .galerie { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
.vignette {
  position: relative;
  border-radius: var(--r-s);
  overflow: hidden;
  background: var(--creme);
  aspect-ratio: 4 / 3;
}
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.vignette__role {
  position: absolute; top: 6px; left: 6px;
  background: var(--marine); color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .05em;
  padding: 3px 8px; border-radius: var(--r-pill);
  text-transform: uppercase;
}
.vignette__actions {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 4px; padding: 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.62));
  opacity: 0; transition: opacity .15s;
}
.vignette:hover .vignette__actions, .vignette:focus-within .vignette__actions { opacity: 1; }
@media (hover: none) { .vignette__actions { opacity: 1; } }
.vignette__actions button, .vignette__actions a {
  flex: 1;
  font-size: .72rem;
  padding: 5px 4px;
  border-radius: var(--r-s);
  border: 0;
  background: rgba(255,255,255,.92);
  color: var(--marine);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
}

/* ------------------------------------------- zone de prise de photo ---- */

.zone-photo {
  border: 2px dashed var(--dore);
  border-radius: var(--r-m);
  padding: var(--e3);
  background: #fdfcf9;
  text-align: center;
}
.zone-photo input[type=file] { display: none; }

/* Deux boutons compacts, cote a cote : appareil photo / galerie.
   Icone + libelle sur une seule ligne, tailles equilibrees. */
.zone-photo__choix { display: flex; gap: var(--e2); }
.zone-photo__btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: var(--r-m);
  background: var(--marine);
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.15;
  cursor: pointer;
  min-height: 48px;
  text-align: left;
}
.zone-photo__btn svg { width: 20px; height: 20px; flex: none; }
.zone-photo__btn:hover { background: var(--marine-fonce); }
.zone-photo__btn--galerie { background: var(--kaki); }
.zone-photo__btn--galerie:hover { background: #6f7857; }
.zone-photo__apercu { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px,1fr)); gap: 6px; margin-top: var(--e2); }
.zone-photo__apercu img { border-radius: var(--r-s); aspect-ratio: 1; object-fit: cover; width: 100%; }

/* ======================================================= PAGE CLIENT === */

.client-entete {
  background: var(--marine);
  color: #fff;
  padding: var(--e5) 0 var(--e6);
  text-align: center;
}
.client-entete h1 { color: #fff; margin-bottom: var(--e1); font-size: 1.75rem; }
.client-entete .sous { color: var(--dore); font-size: 1rem; letter-spacing: .02em; }

.resume-client {
  margin-top: calc(var(--e5) * -1);
  background: #fff;
  border-radius: var(--r-l);
  box-shadow: var(--ombre-forte);
  padding: var(--e4);
}
.resume-chiffres { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--e3); text-align: center; }
@media (min-width: 640px) { .resume-chiffres { grid-template-columns: repeat(3, 1fr); } }
.chiffre { font-family: var(--police-titre); font-size: 1.5rem; font-weight: 700; color: var(--marine); line-height: 1.1; }
.chiffre-libelle { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); }

/* ---------------------------------------------------- avant / apres ---- */

.comparateur {
  position: relative;
  border-radius: var(--r-l);
  overflow: hidden;
  background: var(--creme);
  aspect-ratio: 4 / 3;
  touch-action: none;
  user-select: none;
}
@media (min-width: 760px) { .comparateur { aspect-ratio: 16 / 9; } }
.comparateur img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.comparateur__apres { clip-path: inset(0 0 0 50%); }
.comparateur__poignee {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 3px; background: #fff; transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(0,0,0,.4);
  cursor: ew-resize;
}
.comparateur__rond {
  position: absolute; top: 50%; left: 50%;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 3px 14px rgba(0,0,0,.35);
  color: var(--marine); font-size: 1rem; font-weight: 700;
}
.comparateur__legende {
  position: absolute; bottom: 12px;
  background: rgba(31,52,74,.82); color: #fff;
  font-size: .74rem; font-weight: 700; letter-spacing: .08em;
  padding: 5px 12px; border-radius: var(--r-pill);
  text-transform: uppercase;
}
.comparateur__legende--avant { left: 12px; }
.comparateur__legende--apres { right: 12px; }

/* --------------------------------------------- timeline verticale ------ */

.route { position: relative; padding-left: 58px; margin-top: var(--e4); }
.route::before {
  content: "";
  position: absolute;
  left: 26px; top: 6px; bottom: 6px;
  width: 4px;
  background: repeating-linear-gradient(
    to bottom,
    var(--bordure) 0 14px,
    transparent 14px 26px
  );
  border-radius: 2px;
}
.route__progres {
  position: absolute;
  left: 26px; top: 6px;
  width: 4px;
  background: var(--kaki);
  border-radius: 2px;
  transition: height 1.1s cubic-bezier(.4,0,.2,1);
}
.van {
  position: absolute;
  left: 0;
  width: 54px;
  transition: top 1.1s cubic-bezier(.4,0,.2,1);
  z-index: 3;
  filter: drop-shadow(0 4px 8px rgba(31,52,74,.28));
}
.van svg { width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: reduce) {
  .van, .route__progres, .jauge__barre { transition: none; }
}

.jalon {
  position: relative;
  margin-bottom: var(--e4);
}
.jalon__pastille {
  position: absolute;
  left: -46px; top: 2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--bordure);
  display: grid; place-items: center;
  font-size: .82rem; font-weight: 700; color: var(--texte-doux);
  z-index: 2;
}
.jalon--faite .jalon__pastille { background: var(--kaki); border-color: var(--kaki); color: #fff; }
.jalon--courante .jalon__pastille { border-color: var(--dore); color: var(--marine); box-shadow: 0 0 0 5px rgba(190,162,121,.28); }
.jalon__carte {
  background: #fff;
  border-radius: var(--r-m);
  box-shadow: var(--ombre);
  padding: var(--e3);
}
.jalon--attente .jalon__carte { background: #fbfaf7; box-shadow: none; border: 1px dashed var(--bordure); }
.jalon__titre { font-family: var(--police-titre); font-weight: 700; font-size: 1.05rem; margin: 0 0 2px; }
.jalon__date { font-size: .8rem; color: var(--texte-doux); margin-bottom: var(--e2); }
.jalon__photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--e2); margin-top: var(--e2); }
.jalon__photos img { border-radius: var(--r-s); width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: zoom-in; }

/* ------------------------------------------------------- visionneuse --- */

.visionneuse {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(16,24,33,.94);
  display: none;
  align-items: center; justify-content: center;
  padding: var(--e3);
}
.visionneuse[data-ouverte="1"] { display: flex; }
.visionneuse img { max-width: 100%; max-height: 88vh; border-radius: var(--r-m); object-fit: contain; }
.visionneuse__fermer {
  position: absolute; top: 14px; right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff;
  border: 0; font-size: 1.4rem; cursor: pointer;
}

/* ------------------------------------------------------------- pied ---- */

.pied {
  background: var(--marine);
  color: #b9c6d2;
  padding: var(--e5) 0;
  font-size: .86rem;
  text-align: center;
  margin-top: var(--e6);
}
.pied a { color: var(--dore); }

/* ------------------------------------------------------- utilitaires --- */

.pile { display: flex; flex-direction: column; gap: var(--e2); }
.rang { display: flex; gap: var(--e2); align-items: center; flex-wrap: wrap; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: var(--e2); flex-wrap: wrap; }
.discret { color: var(--texte-doux); font-size: .86rem; }
.centre { text-align: center; }
.mt { margin-top: var(--e3); }
.mb0 { margin-bottom: 0; }
.rien { text-align: center; color: var(--texte-doux); padding: var(--e5) var(--e3); }
