/* Remplir et signer un PDF : page affichée, éléments déplaçables, cadre de signature. */

.zone.sig-zone-compacte { padding: .8rem 1rem; }
.zone.sig-zone-compacte .trou-zone { display: none; }
.zone.sig-zone-compacte .zone-titre { font-size: 1rem; }

.sig-editeur { display: grid; gap: 1.1rem; min-width: 0; }
.sig-bloc { display: grid; gap: .7rem; padding: 1rem; border: 1px solid var(--bord); border-radius: 12px; min-width: 0; }
.sig-aide { margin: 0; color: var(--texte-doux); font-size: .9rem; }
.sig-ligne { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.sig-large { flex: 1 1 14rem; min-width: 0; }
.sig-etroit { flex: 0 1 9rem; }
.sig-boutons { display: flex; flex-wrap: wrap; gap: .5rem; }
.sig-editeur .bouton-secondaire { min-height: 44px; }
.sig-champs { display: grid; gap: .8rem; max-height: 60vh; overflow: auto; padding-right: .2rem; }
.sig-champs .champ { color: var(--texte); }
.sig-champs textarea, .sig-champs .sig-entree, .sig-champs select {
  font: inherit; color: var(--texte); background: var(--fond-champ); border: 1px solid var(--bord-fort);
  border-radius: 8px; padding: .55rem .7rem; min-height: 40px; box-sizing: border-box; width: 100%;
}
.sig-champs textarea { resize: vertical; }
.sig-champs :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sig-champs :disabled { opacity: .55; }
.sig-radios { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.sig-radios legend { padding: 0; margin-bottom: .35rem; width: 100%; }
.sig-couleurs .sig-choix { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.sig-couleurs legend { margin-bottom: .3rem; }

/* Navigation et page */
.sig-barre { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.sig-barre .bouton-icone { width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; }
.sig-numero { min-width: 8.5em; text-align: center; font-variant-numeric: tabular-nums; color: var(--texte-doux); }
.sig-consigne {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .6rem .9rem; border-radius: 10px; background: var(--teinte-accent); border: 1px solid var(--accent);
  color: var(--accent-texte); font-weight: 600; position: sticky; top: .5rem; z-index: 3;
}
.sig-consigne[hidden] { display: none; }
.sig-scene { display: grid; justify-items: center; min-width: 0; }
.sig-feuille { position: relative; max-width: 100%; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); }
.sig-canvas { display: block; width: 100%; height: 100%; }
.sig-calque { position: absolute; inset: 0; }
.sig-calque.sig-placement { cursor: crosshair; outline: 3px dashed var(--accent); outline-offset: 2px; }
.sig-compteur { margin: 0; color: var(--texte-doux); font-size: .92rem; text-align: center; }
.sig-compteur:empty { display: none; }

/* Éléments posés : déplaçables à la souris et au doigt. */
.sig-element {
  position: absolute; box-sizing: border-box; cursor: move;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  outline: 1px dashed rgba(180, 83, 9, .7);
}
.sig-element:focus-visible, .sig-element:focus { outline: 2px solid #F59E0B; }
.sig-element img { display: block; width: 100%; height: 100%; pointer-events: none; }
.sig-texte {
  display: block; white-space: pre; line-height: 1.15; pointer-events: none;
  font-family: Helvetica, Arial, sans-serif;
}
.sig-suppr {
  position: absolute; top: -14px; right: -14px; width: 28px; height: 28px; padding: 0;
  border-radius: 50%; border: 2px solid #fff; background: #B45309; color: #fff;
  font: 700 1rem/1 system-ui, sans-serif; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.sig-suppr:hover, .sig-suppr:focus-visible { background: #DC2626; outline: none; }
.sig-poignee {
  position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; box-sizing: border-box;
  border-radius: 4px; background: #F59E0B; border: 2px solid #fff; cursor: nwse-resize;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
@media (pointer: coarse) {
  .sig-suppr { width: 34px; height: 34px; top: -17px; right: -17px; }
  .sig-poignee { width: 26px; height: 26px; right: -13px; bottom: -13px; }
}

/* Cadre de signature */
.sig-onglets { display: flex; gap: .4rem; }
.sig-onglet {
  font: inherit; font-weight: 600; padding: .5rem 1.1rem; min-height: 44px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--bord-fort); background: transparent; color: var(--texte-doux);
}
.sig-onglet[aria-selected="true"] { background: var(--teinte-accent); border-color: var(--accent); color: var(--texte); }
.sig-onglet:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sig-cadre-bloc { display: grid; gap: .7rem; }
.sig-cadre {
  display: block; width: 100%; max-width: 560px; aspect-ratio: 5 / 2; box-sizing: border-box;
  background: #fff; border: 2px dashed var(--bord-fort); border-radius: 10px; cursor: crosshair; touch-action: none;
}
.sig-cadre.sig-cadre-texte { cursor: default; }
.sig-cadre-bloc input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }

.sig-mention {
  margin: 0; padding: .7rem .9rem; border-left: 3px solid var(--accent); border-radius: 6px;
  background: var(--teinte-accent); font-size: .92rem;
}
