/* Outil de signature LA 126 — charte reprise du site (fond chaud, encre, or). */
:root {
  --fond: #F7F5F1;
  --fond-chaud: #F2EFE8;
  --papier: #FFFFFF;
  --encre: #1C1914;
  --discret: #6B6358;
  --pale: #A8A098;
  --trait: #E4DFD5;
  --or: #C9A84C;
  --or-fond: #FFFBF0;
  --vert: #23875A;
  --vert-fond: #F0FAF5;
  --rouge: #C42B1F;
  --rouge-fond: #FEF2F1;
  --rayon: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font: 16px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
h1 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5rem; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 2rem 0 .75rem; letter-spacing: -0.01em; }
small { color: var(--discret); font-weight: 400; }
[hidden] { display: none !important; }

.bandeau { background: var(--papier); border-bottom: 1px solid var(--trait); }
.bandeau-in { max-width: 1040px; margin: 0 auto; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.marque { font-weight: 800; letter-spacing: .06em; font-size: 1.05rem; border-bottom: 3px solid var(--or); padding-bottom: 1px; }
.bandeau-droite { color: var(--discret); font-size: .875rem; font-variant-numeric: tabular-nums; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.bandeau-droite a { text-decoration: none; }
.bandeau-droite a:hover, .bandeau-droite a.ici { color: var(--encre); text-decoration: underline; }

main { margin: 0 auto; padding: 28px 20px 96px; }
main.etroit { max-width: 660px; }
main.large { max-width: 860px; }
main.admin { max-width: 1040px; }

.carte { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: clamp(20px, 4vw, 36px); }
.carte + .carte { margin-top: 20px; }
.intro { color: var(--discret); margin: 0 0 1.25rem; max-width: 62ch; }
.intro strong { color: var(--encre); }

.etapes { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 20px; counter-reset: e; font-size: .8125rem; color: var(--pale); }
.etapes li { counter-increment: e; flex: 1; border-top: 3px solid var(--trait); padding-top: 8px; }
.etapes li::before { content: counter(e) ". "; }
.etapes .actif { color: var(--encre); font-weight: 600; border-color: var(--encre); }
.etapes .fait { color: var(--vert); border-color: var(--vert); }

.alerte, .info, .manque, .succes { border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; font-size: .9375rem; }
.alerte, .manque { background: var(--rouge-fond); color: var(--rouge); border: 1px solid #F3CFCB; }
.info { background: var(--or-fond); border: 1px solid #EBDDB4; }
.succes { background: var(--vert-fond); color: #17603F; border: 1px solid #CBE8D9; }

/* Formulaires */
.formulaire { display: grid; gap: 16px; }
.formulaire label, .code-label { display: block; font-weight: 600; font-size: .9rem; }
.formulaire label > input, .formulaire label > select, .formulaire label > textarea, .code-label > input { display: block; margin-top: 6px; }
textarea { resize: vertical; line-height: 1.5; }
.formulaire .aide { display: block; margin-top: 6px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  font: inherit; color: inherit; width: 100%; padding: 11px 12px; background: var(--papier);
  border: 1px solid #CFC8BB; border-radius: 8px; min-height: 46px;
}
input:disabled { background: var(--fond); color: var(--discret); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.deux, .trois, .pro { display: grid; gap: 16px; align-items: start; }
@media (min-width: 560px) {
  .deux { grid-template-columns: 1fr 1fr; }
  .deux.court { grid-template-columns: 160px 1fr; }
  .trois { grid-template-columns: 120px 1fr 1fr; }
}
.aide { font-size: .8125rem; line-height: 1.4; }
fieldset.choix { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
fieldset.choix legend { font-weight: 600; font-size: .9rem; margin-bottom: 8px; padding: 0; }
fieldset.choix label { display: flex; align-items: center; gap: 8px; border: 1px solid #CFC8BB; border-radius: 8px; padding: 10px 14px; font-weight: 500; cursor: pointer; }
fieldset.choix label:has(input:checked) { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--encre); flex: none; margin: 0; }

.btn {
  font: inherit; font-weight: 600; background: var(--encre); color: #fff; border: 1px solid var(--encre);
  border-radius: 8px; padding: 13px 22px; min-height: 48px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
}
.btn:hover { background: #000; }
.btn.secondaire { background: var(--papier); color: var(--encre); }
.btn.secondaire:hover { background: var(--fond); }
.btn.petit { padding: 7px 12px; min-height: 36px; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.lien { font: inherit; background: none; border: 0; padding: 0; color: var(--discret); text-decoration: underline; cursor: pointer; }
.danger { color: var(--rouge); }

/* Lecture des documents */
.entete-lecture { margin-bottom: 8px; }
.sommaire { position: sticky; top: 0; z-index: 5; background: var(--fond); padding: 10px 0; border-bottom: 1px solid var(--trait); margin-bottom: 20px; }
.sommaire ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; }
.sommaire a { display: flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none; font-size: .8125rem; color: var(--discret); background: var(--papier); border: 1px solid var(--trait); border-radius: 999px; padding: 6px 12px 6px 6px; }
.sommaire a.vers-signature { padding-left: 12px; background: var(--encre); color: #fff; border-color: var(--encre); }
.sommaire .num { width: 22px; height: 22px; border-radius: 50%; background: var(--fond-chaud); display: grid; place-items: center; font-weight: 700; font-size: .75rem; color: var(--encre); }
.sommaire a.ok { color: var(--vert); border-color: #BFE3D0; }
.sommaire a.ok .num { background: var(--vert); color: #fff; font-size: 0; }
.sommaire a.ok .num::after { content: "✓"; font-size: .8rem; }

.doc { background: var(--papier); border: 1px solid var(--trait); border-radius: 4px; margin-bottom: 28px; box-shadow: 0 1px 2px rgba(28, 25, 20, .04), 0 8px 24px rgba(28, 25, 20, .05); }
.doc-rang { margin: 0; padding: 10px clamp(20px, 6vw, 64px); background: var(--fond-chaud); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--discret); border-radius: 4px 4px 0 0; }
.doc-corps { padding: clamp(24px, 6vw, 56px) clamp(20px, 6vw, 64px) 8px; font-size: .9375rem; line-height: 1.7; overflow-wrap: break-word; }
.doc-corps p { margin: 0 0 .9em; }
.doc-corps .d-h1 { text-align: center; font-weight: 700; font-size: 1.15rem; line-height: 1.35; margin: 0 0 .2em; }
.doc-corps .d-sub { text-align: center; color: var(--discret); font-size: .875rem; margin: .4em 0 2em; }
.doc-corps h3 { font-size: 1rem; margin: 1.8em 0 .6em; }
.doc-corps ul { margin: 0 0 .9em; padding-left: 1.3em; }
.doc-corps li { margin-bottom: .35em; }
.doc-corps table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: .9rem; }
.doc-corps th, .doc-corps td { border: 1px solid var(--trait); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc-corps th { width: 32%; background: var(--fond); font-weight: 600; }

.signatures { display: grid; gap: 14px; margin: 2em 0 1em; }
@media (min-width: 560px) { .signatures { grid-template-columns: 1fr 1fr; } }
.sigbox { border: 1px solid #CFC8BB; border-radius: 6px; padding: 12px 14px; }
.sigbox p { margin: 0; }
.sig-partie { font-weight: 700; }
.sig-nom { color: var(--discret); font-size: .875rem; }
.trace { display: block; width: 100%; max-width: 280px; margin: 6px auto; }
.trace polyline { fill: none; stroke: #101340; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.sig-vide { height: 74px; }
.sig-etat { font-size: .8125rem; color: var(--pale); }
.sig-etat.ok { color: var(--vert); }

.accepte { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .9375rem; line-height: 1.5; }
.doc .accepte { margin: 16px clamp(12px, 4vw, 40px) clamp(16px, 4vw, 32px); padding: 14px 16px; background: var(--or-fond); border: 1px solid #EBDDB4; border-radius: 8px; }
.doc .accepte:has(input:checked) { background: var(--vert-fond); border-color: #BFE3D0; }
.accepte input { margin-top: 2px; }

.signer h2 { margin-top: 0; font-size: 1.35rem; }
.pad-zone { margin: 0 0 18px; }
.pad-tete { display: flex; justify-content: space-between; gap: 12px; font-size: .875rem; color: var(--discret); margin-bottom: 6px; }
#pad { display: block; width: 100%; aspect-ratio: 3 / 1; background: #fff; border: 1.5px dashed #B9B1A2; border-radius: 8px; touch-action: none; cursor: crosshair; }
.consent { margin-bottom: 20px; }
.code-zone { border-top: 1px solid var(--trait); padding-top: 20px; display: grid; gap: 14px; justify-items: start; }
.code-zone .info { margin: 0; }
#code-saisie { display: grid; gap: 14px; justify-items: start; }
#code { font-size: 1.5rem; letter-spacing: .3em; font-weight: 700; max-width: 220px; font-variant-numeric: tabular-nums; }
.code-demo { font-weight: 800; letter-spacing: .15em; }

.reglement { border: 1px solid var(--trait); border-radius: 8px; padding: 18px 20px; margin: 8px 0 4px; background: var(--fond); }
.reglement h2 { margin-top: 0; }
.reglement .succes { margin: 0; }

/* Récapitulatif */
.etats { list-style: none; padding: 0; margin: 0; border: 1px solid var(--trait); border-radius: 8px; }
.etats li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--trait); font-size: .9375rem; }
.etats li:last-child { border-bottom: 0; }
.etats small { line-height: 1.3; display: inline-block; }
.pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--trait); }
.etats .fait .pastille { background: var(--vert); }
.etat-date { color: var(--discret); font-size: .8125rem; text-align: right; }
.etats .fait .etat-date { color: var(--vert); }
.telechargements { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.telechargements a { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--trait); border-radius: 8px; padding: 14px 16px; text-decoration: none; font-weight: 600; }
.telechargements a:hover { border-color: var(--encre); }
.dl { font-weight: 500; font-size: .875rem; color: var(--discret); white-space: nowrap; }

.pot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
p.aide { color: var(--discret); margin: 0; }

/* Suivi des clients */
.parcours { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; counter-reset: p; }
.parcours li { counter-increment: p; border-top: 4px solid var(--trait); padding-top: 8px; font-size: .8125rem; color: var(--pale); line-height: 1.3; }
.parcours li span::before { content: counter(p) ". "; }
.parcours .fait { border-color: var(--vert); color: var(--vert); }
.parcours .actif { border-color: var(--or); color: var(--encre); font-weight: 600; }
.prochaine { background: var(--or-fond); border: 1px solid #EBDDB4; border-radius: 8px; padding: 12px 14px; margin: 0 0 20px; }
.compteurs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.compteurs a { flex: 1 0 auto; min-width: 104px; background: var(--papier); border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; text-decoration: none; font-size: .8125rem; color: var(--discret); line-height: 1.3; }
.compteurs a strong { display: block; font-size: 1.35rem; color: var(--encre); font-variant-numeric: tabular-nums; }
.compteurs a.ici { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); color: var(--encre); }
.recherche { display: flex; gap: 8px; margin-bottom: 12px; max-width: 460px; }
.recherche input { min-height: 36px; padding: 6px 10px; }
fieldset.cases { border: 0; padding: 0; margin: 0; }
fieldset.cases legend { font-weight: 600; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.formulaire fieldset.cases:not(.choix) label { font-weight: 400; font-size: .9375rem; }
@media (min-width: 560px) { .trois.egal { grid-template-columns: 1fr 1fr 1fr; } }
.note { border-top: 1px solid var(--trait); padding: 12px 0 0; margin-top: 12px; }
.note p { margin: 2px 0 0; }
.sans-suite { margin-top: 20px; }
.sans-suite label { display: inline-grid; gap: 4px; min-width: min(100%, 420px); margin-right: 10px; }
.sans-suite input { min-height: 36px; padding: 6px 10px; }
@media (max-width: 640px) { .parcours li span { font-size: .6875rem; } }

/* Espace associés */
.titre-page { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.titre-page h1 { margin: 0; }
.table-scroll { overflow-x: auto; }
table.liste { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.liste th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); padding: 8px 10px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
table.liste td { padding: 12px 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste a { font-weight: 600; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--fond-chaud); color: var(--discret); white-space: nowrap; }
.badge.vert { background: var(--vert-fond); color: #17603F; }
.badge.or { background: var(--or-fond); color: #7A5F12; border: 1px solid #EBDDB4; }
.badge.rouge { background: var(--rouge-fond); color: var(--rouge); }
.points { display: inline-flex; gap: 4px; vertical-align: middle; }
.points i { width: 9px; height: 9px; border-radius: 50%; background: var(--trait); }
.points i.fait { background: var(--vert); }
.vide { color: var(--discret); text-align: center; padding: 32px 0; }
.lien-copie { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 6px; }
.lien-copie input { font-size: .8125rem; min-height: 36px; padding: 6px 10px; color: var(--discret); }
.signataire { border-top: 1px solid var(--trait); padding: 16px 0; }
.signataire:first-of-type { border-top: 0; padding-top: 0; }
.signataire-tete { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.actions form { margin: 0; }
.cases { display: grid; gap: 8px; }
.cases label { display: flex; gap: 10px; align-items: center; font-weight: 500; }
dl.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: .9375rem; }
dl.fiche dt { color: var(--discret); }
dl.fiche dd { margin: 0; }
.journal { font-size: .8125rem; }
.journal td { padding: 6px 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; word-break: break-all; }
details.mail { border-bottom: 1px solid var(--trait); padding: 10px 0; }
details.mail summary { cursor: pointer; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
details.mail .corps { margin-top: 10px; border: 1px solid var(--trait); border-radius: 8px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .bandeau, .sommaire, .signer, .accepte, .etapes { display: none; } .doc { box-shadow: none; border: 0; } }
