/* Signer un PDF : styles propres à l'outil. */
.o-signer-pdf-depot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px; border: 2px dashed var(--bord); border-radius: var(--rayon); background: var(--surface-2); text-align: center; transition: border-color .15s, background-color .15s; }
.o-signer-pdf-depot.o-signer-pdf-survol { border-color: var(--marque); background: var(--surface); }
.o-signer-pdf-depot p { margin: 0; }
.o-signer-pdf-depot-titre { font-size: 1.15rem; font-weight: 700; }
.o-signer-pdf-depot-limites { color: var(--texte-2); font-size: .88rem; line-height: 1.45; max-width: 60ch; }
.o-signer-pdf-local { color: var(--ok-texte); background: var(--ok-fond); padding: 6px 12px; border-radius: var(--rayon-petit); font-size: .9rem; }
.o-signer-pdf-choisir { position: relative; min-height: 46px; padding-inline: 22px; cursor: pointer; }
.o-signer-pdf-choisir input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.o-signer-pdf-choisir:focus-within { outline: 3px solid var(--marque-fort); outline-offset: 2px; }
.o-signer-pdf-message { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--rayon-petit); background: var(--erreur-fond); color: var(--erreur-texte); }
.o-signer-pdf-fichier { margin: 14px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.o-signer-pdf-avertissement { margin: 10px 0 0; padding: 10px 14px; border-left: 4px solid var(--marque); background: var(--surface-2); border-radius: var(--rayon-petit); font-size: .92rem; }

.o-signer-pdf-etape { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--bord); }
.o-signer-pdf-etape h2 { margin: 0 0 10px; font-size: 1.15rem; }
.o-signer-pdf .reglages select, .o-signer-pdf .reglages input[type="text"], .o-signer-pdf .reglages input[type="number"] { min-height: 44px; }
.o-signer-pdf .reglages input[type="file"] { min-height: 44px; max-width: 100%; }
.o-signer-pdf-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; padding: 0; border: 0; }
.o-signer-pdf-sources label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface); cursor: pointer; }
.o-signer-pdf-sources label:has(input:checked) { border-color: var(--marque); box-shadow: inset 0 0 0 1px var(--marque); }
.o-signer-pdf-sources input { width: 18px; height: 18px; accent-color: var(--marque); }
/* zone de tracé : volontairement blanche, comme le papier, avec une ligne d'appui */
.o-signer-pdf-trace { display: block; width: 100%; max-width: 640px; aspect-ratio: 3 / 1; height: auto; background: #fff linear-gradient(transparent 74%, #c8c8c8 74%, #c8c8c8 calc(74% + 1px), transparent calc(74% + 1px)); border: 1px solid var(--bord); border-radius: var(--rayon-petit); touch-action: none; cursor: crosshair; }
.o-signer-pdf-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.o-signer-pdf-aide { margin: 6px 0 0; color: var(--texte-2); font-size: .9rem; }
.o-signer-pdf-ligne .o-signer-pdf-aide { margin: 0; }
.o-signer-pdf-modele { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 0; }
.o-signer-pdf-modele img { max-width: min(260px, 100%); max-height: 80px; padding: 6px 10px; background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon-petit); }
.o-signer-pdf-modele figcaption { color: var(--texte-2); font-size: .88rem; }

.o-signer-pdf-nav { display: flex; align-items: center; gap: 8px; }
.o-signer-pdf-nav .btn { min-height: 44px; min-width: 44px; padding: 0 10px; font-size: 1.1rem; }
.o-signer-pdf-choix-page select { min-height: 44px; }
.o-signer-pdf-poser { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.o-signer-pdf-scene { margin-top: 12px; min-width: 0; }
/* cadre de la page : volontairement blanc comme le papier, quadrillé tous les centimètres */
.o-signer-pdf-vue { --pas: 28px; position: relative; margin: 0 auto; overflow: hidden; background-color: #fff; background-image: linear-gradient(rgba(0, 0, 0, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, .07) 1px, transparent 1px); background-size: var(--pas) var(--pas); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .18); touch-action: none; user-select: none; }
.o-signer-pdf-filigrane { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(0, 0, 0, .1); font-size: 4rem; font-weight: 700; pointer-events: none; }
.o-signer-pdf-objet { position: absolute; display: flex; align-items: center; justify-content: center; box-sizing: border-box; border: 1px dashed rgba(26, 58, 143, .55); cursor: move; touch-action: none; }
.o-signer-pdf-objet img { width: 100%; height: 100%; pointer-events: none; }
.o-signer-pdf-objet span:not(.o-signer-pdf-poignee) { color: #555; font-size: .75rem; }
.o-signer-pdf-objet:focus-visible, .o-signer-pdf-objet.o-signer-pdf-choisi { border: 2px solid #1a3a8f; outline: none; }
.o-signer-pdf-poignee { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #1a3a8f; border: 2px solid #fff; cursor: nwse-resize; display: none; }
.o-signer-pdf-choisi .o-signer-pdf-poignee { display: block; }
.o-signer-pdf-note { margin: 8px auto 0; max-width: 70ch; color: var(--texte-2); font-size: .88rem; text-align: center; }
.o-signer-pdf-reglage-objet { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface-2); }
.o-signer-pdf-objet-titre { margin: 0 0 6px; font-weight: 700; }

.o-signer-pdf-plan { margin: 16px 0 0; font-weight: 600; }
.o-signer-pdf-plan:empty { display: none; }
.o-signer-pdf-plan.o-signer-pdf-ko { color: var(--erreur-texte); }
.o-signer-pdf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.o-signer-pdf-resume { display: block; margin-top: 10px; font-weight: 600; }
.o-signer-pdf-resume:empty { display: none; }
.o-signer-pdf-lien { margin: 10px 0 0; }
.o-signer-pdf-lien .btn { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .o-signer-pdf-actions .btn, .o-signer-pdf-poser .btn { flex: 1 1 100%; }
  .o-signer-pdf-filigrane { font-size: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .o-signer-pdf-depot { transition: none; } }
