@page { size: A4; margin: 0; }
  :root{
    --ink:#16202b;
    --muted:#5d6b7a;
    --red:#d11a26;
    --red-d:#a8121c;
    --blue:#15487f;
    --blue-soft:#e9f1f9;
    --blue-line:#bcd2ea;
    --green:#1f7a4d;
    --green-soft:#e8f3ec;
    --rule:#cdd6e0;
    --rule-soft:#e4eaf1;
    --paper:#ffffff;
    --grey:#eef1f5;
    --grey-d:#dde3ea;
    --hatch:#f2c14e;
  }
  *{ box-sizing:border-box; margin:0; padding:0; }
  html{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  body{ font-family:'Carlito','DejaVu Sans',sans-serif; color:var(--ink); font-size:8.4px; line-height:1.32; }

  .page{ width:210mm; height:297mm; padding:9mm 9mm 7mm; position:relative; page-break-after:always; background:var(--paper); }
  .page:last-of-type{ page-break-after:auto; }

  /* ---------- HEADER ---------- */
  .head{ display:flex; align-items:stretch; border:1.4px solid var(--ink); border-radius:5px; overflow:hidden; }
  .head .brand{ background:#fff; display:flex; align-items:center; justify-content:center; padding:6px 10px; width:118px; flex-shrink:0; border-right:1.4px solid var(--ink); }
  .head .brand .logo{ width:100%; height:auto; display:block; }
  .head .brand .mark{ font-weight:700; font-size:25px; letter-spacing:2px; line-height:1; }
  .head .brand .mark small{ display:block; font-size:6.4px; letter-spacing:2.6px; font-weight:600; margin-top:3px; opacity:.95; }
  .head .ttl{ flex:1; padding:7px 14px; display:flex; flex-direction:column; justify-content:center; }
  .head .ttl h1{ font-size:15px; font-weight:700; color:var(--blue); letter-spacing:.3px; }
  .head .ttl .sub{ font-size:8.6px; color:var(--ink); margin-top:1px; font-weight:600; }
  .head .ttl .leg{ font-size:7.4px; color:var(--muted); margin-top:2px; }
  .head .ref{ width:104px; flex-shrink:0; border-left:1px solid var(--rule); padding:7px 10px; display:flex; flex-direction:column; justify-content:center; gap:2px; background:var(--blue-soft); }
  .head .ref div{ font-size:7px; color:var(--blue); }
  .head .ref b{ color:var(--ink); }

  /* ---------- SECTION ---------- */
  .sec{ margin-top:5px; border:1px solid var(--rule); border-radius:4px; overflow:hidden; }
  .sec > h2{ background:var(--blue); color:#fff; font-size:8.2px; font-weight:700; letter-spacing:.7px; text-transform:uppercase; padding:3px 8px; }
  .sec .bd{ padding:5px 8px; }
  .grid2{ display:grid; grid-template-columns:1fr 1fr; gap:5px; margin-top:5px; }
  .grid3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:0; }

  /* host companies */
  .host{ display:grid; grid-template-columns:1fr 1fr 1fr; }
  .host .ag{ padding:5px 9px; border-left:1px solid var(--rule-soft); }
  .host .ag:first-child{ border-left:none; }
  .host .ag .nm{ font-weight:700; color:var(--blue); font-size:8.8px; }
  .host .ag .nm .pin{ color:var(--red); font-weight:700; }
  .host .ag .li{ color:var(--ink); margin-top:1.5px; }
  .host .ag .li span{ color:var(--muted); }
  .host-foot{ border-top:1px solid var(--rule-soft); padding:3px 9px; background:var(--grey); font-size:8px; }
  .host-foot b{ color:var(--blue); }

  /* fill-in fields */
  .frow{ display:flex; gap:8px; align-items:baseline; margin-bottom:3px; }
  .frow:last-child{ margin-bottom:0; }
  .fld{ flex:1; display:flex; align-items:baseline; gap:5px; }
  .fld .lb{ color:var(--muted); white-space:nowrap; font-size:8px; }
  .fld .ln{ flex:1; border-bottom:1px dotted #9aa7b5; height:11px; }

  /* checkbox rows */
  .cbline{ display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; }
  .cbline .ttl{ font-weight:700; color:var(--ink); font-size:8px; margin-right:2px; }
  .cb{ display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
  .cb i{ width:9px; height:9px; border:1.2px solid var(--blue); border-radius:1.5px; display:inline-block; flex-shrink:0; background:#fff; }
  .cb .pre{ width:60px; border-bottom:1px dotted #9aa7b5; height:10px; display:inline-block; }
  .opblock{ padding:4px 0; border-top:1px dashed var(--rule-soft); }
  .opblock:first-child{ border-top:none; }
  .opblock .h{ font-weight:700; color:var(--blue); font-size:7.8px; text-transform:uppercase; letter-spacing:.4px; margin-bottom:3px; }

  /* alert + risk + consignes */
  .twocol{ display:grid; grid-template-columns:1fr 1fr; gap:5px; }
  .panel{ border:1px solid var(--rule); border-radius:4px; overflow:hidden; }
  .panel > h3{ font-size:7.8px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; padding:3px 8px; color:#fff; }
  .panel.alert > h3{ background:var(--red); }
  .panel.risk > h3{ background:var(--blue); }
  .panel.cons > h3{ background:var(--green); }
  .panel .pbd{ padding:5px 8px; }
  ul.tight{ list-style:none; }
  ul.tight li{ position:relative; padding-left:11px; margin-bottom:2px; }
  ul.tight li::before{ content:""; position:absolute; left:2px; top:4.5px; width:3px; height:3px; background:var(--blue); border-radius:50%; }
  ul.tight.r li::before{ background:var(--red); }
  ul.tight.g li::before{ background:var(--green); }
  .hot{ color:var(--red-d); font-weight:700; }
  .em18{ display:inline-flex; align-items:center; gap:5px; background:var(--red); color:#fff; font-weight:700; border-radius:3px; padding:1px 7px; font-size:9px; }
  .risk-tbl{ width:100%; border-collapse:collapse; }
  .risk-tbl th{ background:var(--blue-soft); color:var(--blue); font-size:7.4px; text-align:left; padding:2.5px 6px; border:1px solid var(--blue-line); }
  .risk-tbl td{ padding:3px 6px; border:1px solid var(--rule); vertical-align:top; }
  .risk-tbl td.cond{ width:34%; font-weight:700; color:var(--ink); background:#fafbfc; }
  .speed{ display:inline-flex; align-items:center; justify-content:center; width:15px; height:15px; border-radius:50%; border:2px solid var(--red); color:var(--ink); font-weight:700; font-size:8px; }

  /* signatures */
  .sig{ display:grid; grid-template-columns:1fr 1fr; gap:6px; }
  .sigbox{ border:1px solid var(--rule); border-radius:4px; padding:5px 8px; }
  .sigbox .sh{ font-weight:700; color:var(--blue); font-size:8px; text-transform:uppercase; letter-spacing:.4px; border-bottom:1px solid var(--rule-soft); padding-bottom:2px; margin-bottom:3px; }
  .sigbox .row{ margin-bottom:2.5px; }
  .sigbox .row span{ color:var(--muted); }
  .sigarea{ height:34px; border:1px dashed var(--rule); border-radius:3px; margin-top:3px; display:flex; align-items:flex-end; justify-content:flex-start; padding:2px 5px; color:#b4bdc7; font-size:7px; }
  .note{ margin-top:4px; font-size:7.2px; color:var(--muted); font-style:italic; text-align:center; }

  .foot{ position:absolute; left:9mm; right:9mm; bottom:4mm; display:flex; justify-content:space-between; font-size:6.6px; color:var(--muted); border-top:1px solid var(--rule-soft); padding-top:3px; }

  /* ---------- ANNEX PAGE ---------- */
  .anx-head{ display:flex; align-items:center; gap:10px; border-bottom:2px solid var(--blue); padding-bottom:5px; margin-bottom:7px; }
  .anx-head .b{ display:flex; align-items:center; padding:2px; border-radius:4px; }
  .anx-head .b .logo-anx{ height:30px; width:auto; display:block; }
  .anx-head h1{ font-size:14px; color:var(--blue); font-weight:700; }
  .anx-head .s{ font-size:8px; color:var(--muted); }

  .legend{ display:flex; flex-wrap:wrap; gap:5px 16px; padding:5px 9px; background:var(--grey); border:1px solid var(--rule); border-radius:4px; margin-bottom:7px; font-size:7.6px; }
  .legend .it{ display:inline-flex; align-items:center; gap:5px; }
  .sw{ width:13px; height:11px; border-radius:2px; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; }

  .planwrap{ border:1px solid var(--rule); border-radius:5px; overflow:hidden; margin-bottom:7px; }
  .planwrap .pt{ background:var(--blue); color:#fff; font-size:8.6px; font-weight:700; letter-spacing:.6px; padding:3px 9px; display:flex; justify-content:space-between; }
  .planwrap .pt span{ font-weight:600; opacity:.9; font-size:7.6px; }
  .planwrap svg{ display:block; width:100%; height:auto; background:#fbfcfd; }

  /* step strip echoing the form */
  .steps{ display:flex; gap:6px; margin-top:6px; }
  .steps .st{ flex:1; display:flex; align-items:center; gap:6px; padding:4px 9px; border:1px solid var(--blue-line); background:var(--blue-soft); border-radius:4px; font-size:8.2px; font-weight:700; color:var(--blue); }
  .steps .st .n{ width:14px; height:14px; border-radius:50%; background:var(--blue); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:8px; flex-shrink:0; }
  .steps .st.val{ border-color:#b8ddc8; background:var(--green-soft); color:var(--green); }
  .steps .st.val .n{ background:var(--green); }

  /* radio (circle) vs checkbox (square) */
  .cb.rb i{ border-radius:50%; }
  /* example hint inside a fill line */
  .fld .ln{ flex:1; border-bottom:1px dotted #9aa7b5; height:12px; display:flex; align-items:flex-end; padding:0 0 1px 3px; }
  .ex{ color:#aab4c0; font-style:italic; font-size:7.4px; line-height:1; }
  .req{ color:var(--red); font-weight:700; }
  .subh{ font-size:8px; font-weight:700; color:var(--blue); text-transform:uppercase; letter-spacing:.4px; padding:3px 8px 2px; border-bottom:1px solid var(--rule-soft); background:#f7fafc; }
  .precise{ display:flex; align-items:baseline; gap:5px; margin-top:4px; }
  .precise .lb{ color:var(--muted); white-space:nowrap; font-size:8px; }
  .precise .ln{ flex:1; border-bottom:1px dotted #9aa7b5; height:12px; display:flex; align-items:flex-end; padding:0 0 1px 3px; }

  /* ===================== INTERACTIVE LAYER ===================== */
  .lninp{ -webkit-appearance:none; appearance:none; border:none; outline:none; background:transparent;
          font:inherit; color:var(--ink); width:100%; min-width:0; flex:1;
          height:12px; line-height:11px; border-bottom:1px dotted #9aa7b5; padding:0 0 1px 3px; }
  .lninp::placeholder{ color:#aab4c0; font-style:italic; font-size:7.4px; }
  .lninp:focus{ background:#fff6c9; }
  .fld .lninp, .precise .lninp{ flex:1; }

  .cb{ cursor:pointer; -webkit-user-select:none; user-select:none; }
  .cb i{ position:relative; }
  .cb i.on{ background:var(--red); border-color:var(--red); }
  .cb i.on::after{ content:"\2714"; position:absolute; top:50%; left:50%;
                   transform:translate(-50%,-50%); color:#fff; font-size:7px; line-height:1; }
  .cb.rb i.on{ background:#fff; }
  .cb.rb i.on::after{ content:""; width:5px; height:5px; border-radius:50%; background:var(--red); }

  .host .ag.sel{ background:#fff8e6; box-shadow:inset 0 0 0 2px var(--red); border-radius:3px; }
  .planwrap.sel{ box-shadow:0 0 0 2px var(--red); }
  .planwrap.sel .pt{ background:var(--red); }

    

  /* ---- questionnaire-specific ---- */
  .risk-tbl td .lninp, .risk-tbl td input.lninp{ border-bottom:none; height:13px; padding:0 2px; }
  .risk-tbl.num td{ padding:2px 5px; }
  .risk-tbl.num td.cond{ font-weight:600; font-size:7.3px; line-height:1.2; }
  .risk-tbl .subrow td{ background:var(--blue-soft); color:var(--blue); font-weight:700; font-size:7.4px; }
  .qtbl td{ vertical-align:top; }
  .qtbl .q{ font-style:italic; margin-bottom:3px; }
  .qtbl .cbline{ gap:3px 12px; }
  .note2{ margin-top:4px; font-size:7.2px; color:var(--muted); font-style:italic; }
  .docgrid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .docgrid .h{ font-weight:700; color:var(--blue); font-size:7.8px; text-transform:uppercase; letter-spacing:.4px; margin-bottom:3px; }
  .certline{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin-top:4px; }
  .certline .lb{ color:var(--muted); font-size:8px; }
  /* Annexe 1 : les politiques PLS, reprises telles quelles du Doc.30 */
  .policy-box{ border:1px solid var(--rule); border-radius:6px; display:flex; align-items:flex-start;
               justify-content:center; padding:8px; background:#fff; }
  .policyimg{ display:block; width:auto; height:auto; max-width:100%; max-height:243mm; }
  .anx-n{ font-size:9px; font-weight:600; color:var(--muted); }
  .attest{ border:1px solid var(--rule); border-radius:5px; padding:14px 18px; }
  .attest .eng{ font-style:italic; font-weight:600; color:var(--ink); font-size:10px; line-height:1.7; text-align:center; margin:6px 0 14px; }
  .attest .eng b{ color:var(--blue); }

/* =============================================================================
   APPLICATION
   Le formulaire occupe toute la page ; l'aperçu du PDF s'ouvre en panneau
   coulissant depuis la droite. Toute cette couche disparaît à l'impression :
   seules les pages A4 restent.

   Règle à ne pas oublier : toute media query de largeur doit être limitée à
   `screen`. Une page A4 fait 794 px de large, donc un `@media (max-width:…)`
   non qualifié s'applique aussi à l'impression.
   ============================================================================= */

.appbar, .formcol, .pvtab, .pvdrawer{
  font-family:'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

/* jeu d'icônes SVG hors flux */
.sprite{ position:absolute; width:0; height:0; overflow:hidden; }
.ic{ width:1em; height:1em; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.9;
     stroke-linecap:round; stroke-linejoin:round; vertical-align:-.14em; }

/* ------------------------------- boutons ---------------------------------- */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
      font-family:inherit; font-size:13.5px; font-weight:600; line-height:1;
      border:none; border-radius:9px; padding:11px 16px; cursor:pointer;
      transition:background .18s, transform .14s, box-shadow .18s, color .18s; }
.btn .ic{ font-size:16px; }
.btn:active{ transform:translateY(1px); }
.btn-pdf{ background:var(--red); color:#fff; box-shadow:0 2px 8px rgba(209,26,38,.28); }
.btn-pdf:hover{ background:var(--red-d); transform:translateY(-1px); box-shadow:0 5px 16px rgba(209,26,38,.36); }
.btn-ghost{ background:#33404e; color:#fff; }
.btn-ghost:hover{ background:#46566a; transform:translateY(-1px); }
.btn-soft{ background:#eaf0f7; color:var(--blue); }
.btn-soft:hover{ background:#dbe6f2; transform:translateY(-1px); }
.btn-big{ font-size:15px; padding:14px 24px; }

/* ------------------------------ barre haute ------------------------------- */
.appbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; gap:18px;
  background:#16202b; color:#fff; padding:9px 22px;
  box-shadow:0 1px 12px rgba(0,0,0,.28);
}
.app-id{ display:flex; align-items:center; gap:11px; min-width:0; }
.app-logo{ height:31px; width:auto; display:block; background:#fff; border-radius:5px;
           padding:2px 4px; flex-shrink:0; }
.app-ttl{ font-size:15px; font-weight:700; line-height:1.2;
          min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.app-ttl small{ display:block; font-size:11px; font-weight:400; opacity:.66;
                overflow:hidden; text-overflow:ellipsis; }

.app-prog{ flex:1 1 auto; max-width:330px; min-width:0; margin-right:auto; }
.app-prog-txt{ display:flex; align-items:baseline; gap:8px; font-size:11.5px; margin-bottom:5px; }
.app-prog-txt b{ font-size:14px; font-weight:700; font-variant-numeric:tabular-nums; }
.app-prog-txt span{ opacity:.66; }
.app-prog-bar{ height:6px; border-radius:3px; background:#33404e; overflow:hidden; }
.app-prog-bar span{ display:block; height:100%; width:0; border-radius:3px; background:#f0a92e;
                    transition:width .5s cubic-bezier(.22,.7,.25,1), background .35s; }
.app-prog.done .app-prog-bar span{ background:#2fbf71; }

.locchip{ display:flex; align-items:center; gap:7px; background:#22303f; border:1px solid #3a4a5c;
          border-radius:8px; padding:6px 11px; font-size:11.5px; line-height:1.3; white-space:nowrap; }
.locchip .flag{ font-size:15px; line-height:1; }
.locchip b{ font-weight:700; }
.locchip .dim{ opacity:.66; }

/* ================================ FORMULAIRE ============================== */
.formcol{ background:#eef1f6; padding:30px 24px 110px; min-height:calc(100vh - 51px); }
.fwrap{ max-width:900px; margin:0 auto; }

.fhero{ background:#fff; border:1px solid #dbe1e8; border-top:8px solid var(--blue);
        border-radius:12px; padding:26px 30px; margin-bottom:18px; }
.fhero h1{ font-size:28px; font-weight:700; color:var(--ink); line-height:1.15; }
.fhero p{ font-size:13.5px; color:#5f6b7a; line-height:1.55; margin-top:10px; }
.fhero-note{ border-top:1px solid #eef1f5; padding-top:12px; }
.fhero .req{ color:var(--red); font-weight:700; }

.fsec{ margin-bottom:26px; }
.fsec-head{ display:flex; align-items:flex-start; gap:15px;
            background:#fff; border:1px solid #dbe1e8; border-left:5px solid var(--blue);
            border-radius:12px; padding:17px 24px; margin-bottom:11px;
            transition:border-color .35s; }
.fsec-ic{ display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
          width:38px; height:38px; border-radius:11px; background:var(--blue-soft); color:var(--blue);
          font-size:21px; transition:background .35s, color .35s; }
.fsec-tx{ flex:1; min-width:0; }
.fsec-head h2{ font-size:19px; font-weight:700; color:var(--ink); line-height:1.25; margin-top:2px; }
.fsec-head p{ font-size:12.8px; color:#5f6b7a; line-height:1.45; margin-top:4px; }
.fsec-n{ font-size:11.5px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:#8794a3; }
.fsec-ok{ display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
          width:24px; height:24px; border-radius:50%; background:var(--green); color:#fff;
          font-size:15px; transform:scale(0);
          transition:transform .34s cubic-bezier(.34,1.56,.64,1); }
.fsec.done .fsec-ok{ transform:scale(1); }
.fsec.done .fsec-head{ border-left-color:var(--green); }
.fsec.done .fsec-ic{ background:var(--green-soft); color:var(--green); }

.q{ background:#fff; border:1px solid #dbe1e8; border-radius:12px; padding:19px 24px; margin-bottom:11px;
    transition:border-color .2s, box-shadow .2s, background .2s; }
.q:focus-within{ border-color:var(--blue); box-shadow:0 2px 12px rgba(21,72,127,.13); }
.q.err{ border-color:#e09aa0; background:#fffafa; }

.q-lb{ font-size:15px; font-weight:600; color:var(--ink); line-height:1.35; }
.q-lb .req{ color:var(--red); font-weight:700; }
.q-help{ font-size:12.6px; color:#5f6b7a; line-height:1.45; margin-top:4px; }
.q-lb + .q-opts, .q-lb + .fgrid, .q-lb + .fin, .q-lb + .sigcard{ margin-top:14px; }
.q-help + .q-opts, .q-help + .fgrid, .q-help + .fin, .q-help + .sigcard{ margin-top:13px; }
.q-err{ display:none; align-items:center; gap:7px; color:var(--red-d); font-size:12.6px; margin-top:12px; }
.q-err .ic{ font-size:15px; }
.q.err .q-err{ display:flex; animation:errin .28s ease-out; }
@keyframes errin{ from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }

/* ---- champs texte ---- */
.fin{ display:block; width:100%; font-family:inherit; font-size:15px; color:var(--ink);
      background:transparent; border:none; border-bottom:1.5px solid #c3cbd6;
      padding:8px 2px; outline:none; transition:border-color .18s, box-shadow .18s; }
.fin::placeholder{ color:#9aa7b5; }
.fin:hover{ border-bottom-color:#8b99a8; }
.fin:focus{ border-bottom-color:var(--blue); box-shadow:0 1.5px 0 var(--blue); }
.fin-short{ max-width:200px; }
.q.err .fin[data-req]:placeholder-shown{ border-bottom-color:#d98a90; }

.fgrid{ display:grid; grid-template-columns:1fr 1fr; gap:16px 20px; }
.fgrid-3{ grid-template-columns:1fr 1fr 1fr; }
.fsub{ display:block; }
.fsub-wide{ grid-column:1 / -1; }
.fsub > span{ display:block; font-size:12.4px; font-weight:600; color:#5f6b7a; margin-bottom:1px; }
.fsub > span .req{ color:var(--red); }
.fother{ display:block; margin-top:15px; padding-top:14px; border-top:1px dashed #e2e8ef; }
.fother > span{ display:block; font-size:12.4px; font-weight:600; color:#5f6b7a; margin-bottom:1px; }

/* ---- choix ---- */
.q-opts{ display:flex; flex-direction:column; gap:3px; }
.q-opts-row{ flex-direction:row; flex-wrap:wrap; gap:3px 8px; }
.q-opts-row .opt{ flex:0 1 auto; }
.opt{ display:flex; align-items:flex-start; gap:12px; padding:10px 13px; border-radius:9px;
      cursor:pointer; transition:background .16s, box-shadow .16s; }
.opt:hover{ background:#f2f6fa; }
.opt input{ margin:1px 0 0; width:18px; height:18px; flex-shrink:0; cursor:pointer;
            accent-color:var(--blue); transition:transform .16s; }
.opt:hover input{ transform:scale(1.08); }
.opt-txt b{ display:block; font-size:14.5px; font-weight:500; color:var(--ink); line-height:1.3;
            transition:color .16s; }
.opt-txt small{ display:block; font-size:12.4px; color:#5f6b7a; line-height:1.35; margin-top:1px; }
.opt:has(input:checked){ background:#e9f1f9; box-shadow:inset 0 0 0 1px #bcd2ea; }
.opt:has(input:checked) .opt-txt b{ font-weight:700; color:var(--blue); }
.opt:has(input:focus-visible){ outline:2px solid var(--blue); outline-offset:1px; }

/* ---- carte signature ---- */
.sigcard{ border:1px solid #dbe1e8; border-radius:11px; overflow:hidden; }
.sigstage{ position:relative; height:132px; background:#fbfcfd; }
.sigcard-pv{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
             padding:6px 16px; overflow:hidden; }
.sigcard-none{ font-size:12.8px; color:#9aa7b5; font-style:italic; text-align:center; }
.sigcard-pv .ds-name{ font-size:46px; }
.sigcard-pv .ds-stamp{ animation:sigin .5s cubic-bezier(.22,.7,.25,1); }
@keyframes sigin{ from{ opacity:0; transform:translateY(6px) scale(.96); } to{ opacity:1; transform:none; } }

/* surface de dessin — n'existe qu'en mode « Personnalisée » */
.sigcanvas{ position:absolute; inset:0; width:100%; height:100%; display:none;
            cursor:crosshair; touch-action:none; }
.sigcanvas-hint{ position:absolute; inset:0; display:none; align-items:center; justify-content:center;
                 font-size:12.8px; color:#adb8c4; font-style:italic; pointer-events:none;
                 transition:opacity .25s; }
.sigcard[data-mode="draw"] .sigcard-pv{ display:none; }
.sigcard[data-mode="draw"] .sigcanvas{ display:block; }
.sigcard[data-mode="draw"] .sigcanvas-hint{ display:flex; }
.sigcard[data-mode="draw"].has-ink .sigcanvas-hint{ opacity:0; }
/* repère de ligne de signature, comme sur un bordereau papier */
.sigcard[data-mode="draw"] .sigstage{
  background:
    linear-gradient(#dfe6ee,#dfe6ee) no-repeat 8% 74% / 84% 1px,
    #fbfcfd;
}

.sigcard-bar{ display:flex; align-items:center; gap:8px; flex-wrap:wrap;
              padding:8px; border-top:1px solid #eef1f5; background:#fff; }
.sigcard-styles{ display:flex; gap:4px; flex:1; min-width:200px; }
.sigcard-styles button{ flex:1; font-family:inherit; font-size:12.5px; font-weight:600;
                        background:#f2f6fa; color:#5f6b7a; border:none; border-radius:8px;
                        padding:9px 6px; cursor:pointer; transition:background .16s, color .16s; }
.sigcard-styles button:hover{ background:#e2ebf4; color:var(--blue); }
.sigcard-styles button.on{ background:var(--blue); color:#fff; }

.sigdraw-act{ display:none; gap:4px; }
.sigcard[data-mode="draw"] .sigdraw-act{ display:flex; }
.sigdraw-act button{ display:inline-flex; align-items:center; gap:6px;
                     font-family:inherit; font-size:12.5px; font-weight:600;
                     background:#fff; color:#5f6b7a; border:1px solid #dbe1e8; border-radius:8px;
                     padding:8px 12px; cursor:pointer;
                     transition:background .16s, color .16s, border-color .16s, opacity .16s; }
.sigdraw-act button .ic{ font-size:14px; }
.sigdraw-act button:hover:not(:disabled){ background:#fff1f1; color:var(--red); border-color:#f0c2c5; }
.sigdraw-act button:disabled{ opacity:.42; cursor:default; }

/* signature dessinée, telle qu'elle apparaît dans le document */
.ds-draw{ display:block; max-width:100%; max-height:100%; width:auto; height:auto;
          object-fit:contain; }

/* ---- bloc de génération ---- */
.fsubmit{ display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;
          background:#fff; border:1px solid #dbe1e8; border-radius:12px; padding:20px 24px;
          transition:border-color .3s, background .3s; }
.fsubmit-txt{ font-size:13.5px; color:#5f6b7a; line-height:1.5; flex:1; min-width:200px; }
.fsubmit-act{ display:flex; gap:10px; flex-wrap:wrap; }
.fsubmit.ready{ border-color:#a9d9c0; background:#f3faf6; }
.fsubmit.ready .fsubmit-txt{ color:var(--green); font-weight:600; }
.lnk{ font-family:inherit; font-size:13.5px; font-weight:600; color:var(--blue); background:none;
      border:none; padding:0; cursor:pointer; text-decoration:underline; }
.lnk:hover{ color:var(--red); }
.ffoot{ font-size:12px; color:#7d8a99; line-height:1.55; font-style:italic; text-align:center;
        margin-top:24px; padding:0 20px; }

/* ======================= APERÇU — PANNEAU COULISSANT ====================== */

/* onglet d'ouverture : languette sur le bord droit (bureau) */
.pvtab{
  position:fixed; right:0; top:50%; transform:translateY(-50%); z-index:38;
  display:flex; align-items:center; gap:9px;
  font-family:inherit; font-size:13.5px; font-weight:700; line-height:1;
  background:var(--blue); color:#fff; border:none; cursor:pointer;
  padding:15px 17px; border-radius:12px 0 0 12px;
  box-shadow:-3px 3px 16px rgba(16,32,43,.3);
  transition:background .2s, padding-right .2s, box-shadow .2s, transform .3s, opacity .3s;
}
.pvtab .ic{ font-size:19px; }
.pvtab:hover{ background:var(--red); padding-right:22px; }
/* La languette s'efface quand l'aperçu est ouvert, et quand le bloc de
   génération est à l'écran : il propose déjà « Voir l'aperçu », et sur mobile
   le bouton flottant viendrait le recouvrir. */
body.pv-open .pvtab,
body.at-submit .pvtab{ opacity:0; pointer-events:none; transform:translate(30px,-50%); }

.pvbackdrop{
  position:fixed; inset:0; z-index:44; background:rgba(16,32,43,.55);
  opacity:0; transition:opacity .38s ease;
}
body.pv-open .pvbackdrop{ opacity:1; }

.pvdrawer{
  position:fixed; top:0; right:0; z-index:45;
  width:min(1000px, 94vw); height:100vh; height:100dvh;
  display:flex; flex-direction:column; background:#59646f;
  box-shadow:-8px 0 40px rgba(16,32,43,.4);
  transform:translateX(100%); visibility:hidden;
  transition:transform .42s cubic-bezier(.4,0,.2,1), visibility 0s linear .42s;
}
body.pv-open .pvdrawer{
  transform:none; visibility:visible;
  transition:transform .42s cubic-bezier(.4,0,.2,1), visibility 0s linear 0s;
}

.pvhead{ display:flex; align-items:center; gap:13px; padding:11px 15px;
         background:#3f4a56; color:#fff; border-bottom:1px solid #2c353f; flex-shrink:0; }
.pvclose{ display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
          width:36px; height:36px; border-radius:9px; border:none; cursor:pointer;
          background:#2c353f; color:#fff; font-size:19px; transition:background .16s, transform .16s; }
.pvclose:hover{ background:var(--red); transform:rotate(90deg); }
.pvhead-t{ flex:1; font-size:13.5px; line-height:1.25; min-width:0; }
.pvhead-t b{ font-weight:700; }
.pvhead-t small{ display:block; font-size:11px; opacity:.62; }
.pvzoom{ display:flex; align-items:center; gap:2px; background:#2c353f; border-radius:8px; padding:2px; }
.pvzoom button{ font-family:inherit; background:transparent; color:#fff; border:none; cursor:pointer;
                font-size:15px; font-weight:700; line-height:1; padding:7px 11px; border-radius:6px;
                transition:background .15s; }
.pvzoom button:last-child{ font-size:11.5px; font-weight:600; }
.pvzoom button:hover{ background:#4b5764; }
.pvzoom span{ font-size:11.5px; opacity:.75; min-width:44px; text-align:center;
              font-variant-numeric:tabular-nums; }

.pvport{ flex:1; overflow:auto; padding:18px; -webkit-overflow-scrolling:touch; }
.pvport .pages{ zoom:var(--pv,1); pointer-events:none; -webkit-user-select:none; user-select:none; }
.pvport .page{ margin:0 auto 18px; box-shadow:0 8px 26px rgba(0,0,0,.36); }

.pvfoot{ display:flex; align-items:center; justify-content:space-between; gap:14px; flex-shrink:0;
         padding:11px 15px; background:#3f4a56; color:#fff; border-top:1px solid #2c353f; }
.pvfoot-t{ font-size:12.5px; opacity:.72; }

/* ------------------------------- animations ------------------------------- */
@media screen{
  body{ background:#eef1f6; }
  .lninp::placeholder{ color:#b9c3ce; }
  /* le panneau fermé est rangé au-delà du bord droit : on empêche la page de
     s'élargir pour aller le chercher. `clip` plutôt que `hidden` pour ne pas
     créer de conteneur de défilement, qui casserait la barre `sticky`. */
  html{ overflow-x:clip; }

  .fhero, .fsec{ animation:rise .55s cubic-bezier(.22,.7,.25,1) backwards; }
  .fsec:nth-of-type(1){ animation-delay:.05s; }
  .fsec:nth-of-type(2){ animation-delay:.10s; }
  .fsec:nth-of-type(3){ animation-delay:.15s; }
  .fsec:nth-of-type(4){ animation-delay:.20s; }
  .fsec:nth-of-type(5){ animation-delay:.25s; }
  .fsec:nth-of-type(6){ animation-delay:.30s; }
  @keyframes rise{ from{ opacity:0; transform:translateY(16px); } to{ opacity:1; transform:none; } }

  .q.shake{ animation:shake .42s cubic-bezier(.36,.07,.19,.97); }
  @keyframes shake{
    10%,90%{ transform:translateX(-2px); }
    30%,70%{ transform:translateX(4px); }
    50%{ transform:translateX(-5px); }
  }
}

/* ------------------------------- responsive ------------------------------- */
@media screen and (max-width:1100px){
  .locchip{ display:none; }
}
@media screen and (max-width:860px){
  .appbar{ gap:12px; padding:8px 14px; }
  .app-ttl small{ display:none; }
  .app-prog{ max-width:none; }
  .appbar .btn-lb{ display:none; }
  .appbar .btn{ padding:11px 12px; }
  .appbar .btn .ic{ font-size:18px; }
  .formcol{ padding:20px 14px 120px; }
  .fhero{ padding:20px 18px; }
  .fhero h1{ font-size:23px; }
  .fsec-head{ padding:14px 16px; gap:12px; }
  .fsec-ic{ width:32px; height:32px; font-size:18px; border-radius:9px; }
  .fsec-head h2{ font-size:17px; }
  .q{ padding:16px 17px; }
  .fgrid, .fgrid-3{ grid-template-columns:1fr; gap:14px; }

  /* la languette devient un bouton flottant, pouce-compatible */
  .pvtab{ top:auto; bottom:18px; right:14px; transform:none;
          border-radius:30px; padding:14px 20px; box-shadow:0 6px 22px rgba(16,32,43,.36); }
  .pvtab:hover{ padding-right:20px; }
  body.pv-open .pvtab,
  body.at-submit .pvtab{ transform:translateY(30px); }

  .pvdrawer{ width:100vw; }
  .pvhead{ padding:9px 11px; gap:9px; }
  .pvhead-t small{ display:none; }
  .pvzoom button{ padding:7px 9px; }
  .pvzoom span{ min-width:38px; }
  .pvport{ padding:10px; }
  .pvfoot-t{ display:none; }
  .pvfoot{ justify-content:flex-end; }
}
@media screen and (max-width:560px){
  .app-ttl{ display:none; }
  .app-prog-txt span{ display:none; }
  .fsubmit{ padding:17px 17px; }
  .fsubmit-act{ width:100%; }
  .fsubmit-act .btn{ flex:1; }
  .sigstage{ height:150px; }
  .sigcard-bar{ flex-direction:column; align-items:stretch; }
  .sigcard-styles{ min-width:0; }
  .sigcard-styles button{ padding:10px 4px; }
  .sigdraw-act button{ flex:1; justify-content:center; }
  .opt{ padding:11px 12px; }
}

/* accessibilité : on respecte le réglage système « moins d'animations » */
@media (prefers-reduced-motion:reduce){
  *, *::before, *::after{
    animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important;
  }
}

/* ================================ IMPRESSION ============================== */
@media print{
  .appbar, .formcol, .pvtab, .pvbackdrop, .pvhead, .pvfoot, .sprite{ display:none !important; }
  html, body{ background:#fff !important; padding:0 !important; margin:0 !important;
              overflow:visible !important; }
  .pvdrawer, .pvport{
    display:block !important; position:static !important; visibility:visible !important;
    transform:none !important; opacity:1 !important;
    width:auto !important; max-width:none !important; height:auto !important; max-height:none !important;
    margin:0 !important; padding:0 !important; border:0 !important;
    background:none !important; box-shadow:none !important; overflow:visible !important;
  }
  .pvport .pages{ zoom:1 !important; pointer-events:auto; user-select:auto; }
  .pvport .page{ margin:0; box-shadow:none; }
  .lninp{ background:transparent !important; border-bottom:1px dotted #9aa7b5 !important;
          box-shadow:none !important; }
  .lninp::placeholder{ color:transparent; }
  .sigarea:not(.hassig){ color:#b4bdc7; }
  .ds-stamp{ animation:none !important; }
  /* champ non renseigné : on imprime un trait à remplir à la main, pas l'invite */
  .autoval.empty{ font-size:0; }
  .autoval.empty::after{ content:""; display:inline-block; width:140px;
                         border-bottom:1px dotted #9aa7b5; }
}

/* ---- tableaux de saisie du formulaire (personnes mandatées, indicateurs) ---- */
.ftable-wrap{ overflow-x:auto; margin-top:4px; border:1px solid #e2e8ef; border-radius:9px; }
.ftable{ width:100%; border-collapse:collapse; font-size:13px; min-width:520px; }
.ftable th{ background:#f2f6fa; color:#5f6b7a; font-size:11.6px; font-weight:700; text-align:left;
            letter-spacing:.3px; padding:8px 10px; border-bottom:1px solid #e2e8ef; white-space:nowrap; }
.ftable td{ padding:4px 8px; border-bottom:1px solid #eef2f6; vertical-align:middle; }
.ftable tr:last-child td{ border-bottom:none; }
.ftable td.fixed{ font-weight:600; color:var(--ink); font-size:12.6px; line-height:1.3; }
.ftable td.fixed small{ display:block; font-weight:400; font-size:11px; color:#8794a3; margin-top:1px; }
.ftable .fin{ font-size:13.5px; padding:5px 2px; }
.ftable-num td:not(.fixed){ width:14%; }
.ftable-num .fin{ text-align:right; }
.fsubrow td{ background:#f7fafc; font-weight:700; font-size:11.4px; letter-spacing:.4px;
             text-transform:uppercase; color:var(--blue); padding:6px 10px; }
/* champ calculé : lecture seule, on le distingue nettement d'une saisie */
.fin-calc{ background:#f2f6fa; color:#5f6b7a; font-weight:600; cursor:not-allowed;
           border-bottom-style:dashed; }
.fin-calc:hover, .fin-calc:focus{ border-bottom-color:#c3cbd6; box-shadow:none; }
