/* Créer un formulaire PDF : barre d'outils, réglages du champ, page affichée avec les champs posés. */

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

.frm-editeur { display: grid; gap: .9rem; min-width: 0; }

.frm-outils { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .4rem; }
.frm-outil {
  display: grid; justify-items: center; align-content: center; gap: .2rem; min-height: 56px; padding: .35rem .25rem;
  font: inherit; font-size: .8rem; line-height: 1.15; text-align: center; color: var(--texte);
  background: transparent; border: 1px solid var(--bord-fort); border-radius: 10px; cursor: pointer;
}
.frm-outil svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.frm-outil:hover { border-color: var(--accent); }
.frm-outil[aria-pressed="true"] { background: var(--teinte-accent); border-color: var(--accent); color: var(--accent-texte); font-weight: 650; }
.frm-outil:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.frm-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.frm-editeur .bouton-secondaire { min-height: 44px; }
.frm-editeur .bouton-secondaire:disabled { opacity: .4; cursor: default; }
.frm-editeur .bouton-secondaire:disabled:hover { border-color: var(--bord-fort); }

.frm-proprietes {
  display: flex; flex-wrap: wrap; align-items: start; gap: .7rem 1rem; padding: .9rem 1rem;
  border: 1px solid var(--bord); border-radius: 12px; min-width: 0;
}
.frm-aide { flex: 1 1 100%; margin: 0; color: var(--texte-doux); font-size: .9rem; }
.frm-large { flex: 1 1 14rem; min-width: 0; }
.frm-etroit { flex: 0 1 8rem; }
.frm-proprietes textarea {
  font: inherit; color: var(--texte); background: var(--fond-champ); border: 1px solid var(--bord-fort);
  border-radius: 8px; padding: .55rem .7rem; min-height: 44px; box-sizing: border-box; width: 100%; resize: vertical;
}
.frm-proprietes textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.frm-proprietes input[type="text"] { width: 100%; min-height: 44px; }
.frm-proprietes select { min-height: 44px; }
.frm-proprietes input[aria-invalid="true"] { border-color: var(--erreur); }
.frm-petit { font-size: .82rem; color: var(--texte-doux); }
.frm-erreur { font-size: .86rem; color: var(--erreur); font-weight: 600; }
.frm-cases { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; min-height: 44px; flex: 1 1 100%; }

.frm-barre { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.frm-barre .bouton-icone { width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; }
.frm-numero { min-width: 8.5em; text-align: center; font-variant-numeric: tabular-nums; color: var(--texte-doux); }
.frm-consigne { margin: 0; text-align: center; color: var(--texte-doux); font-size: .92rem; }
.frm-consigne:empty { display: none; }
.frm-scene { display: grid; justify-items: center; min-width: 0; }
.frm-feuille { position: relative; max-width: 100%; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); }
.frm-canvas { display: block; width: 100%; height: 100%; }
.frm-existants { position: absolute; inset: 0; pointer-events: none; }
.frm-existant { position: absolute; box-sizing: border-box; border: 1px dashed rgba(71, 85, 105, .8); background: rgba(148, 163, 184, .18); }
.frm-calque {
  position: absolute; inset: 0;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.frm-calque.frm-creation { cursor: crosshair; }
.frm-calque.frm-creation .frm-champ { pointer-events: none; }
.frm-compteur { margin: 0; color: var(--texte-doux); font-size: .92rem; text-align: center; }
.frm-compteur:empty { display: none; }

/* Champs posés (couleurs fixes : la page est toujours blanche, en thème clair comme sombre). */
.frm-champ { position: absolute; box-sizing: border-box; cursor: move; touch-action: none; }
.frm-corps {
  position: absolute; inset: 0; overflow: hidden; box-sizing: border-box;
  border: 1px solid #64748b; background: rgba(219, 234, 254, .75); color: #1e3a8a;
  font-family: Helvetica, Arial, sans-serif;
}
.frm-case .frm-corps { background: #fff; }
.frm-radio .frm-corps { overflow: visible; }
.frm-radio .frm-corps { border: 0; background: transparent; }
.frm-nom { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); white-space: nowrap; opacity: .8; line-height: 1; }
.frm-multiligne .frm-nom { top: 3px; transform: none; }
.frm-fleche { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); font-size: 11px; line-height: 1; }
.frm-ligne-radio { position: absolute; left: 0; display: flex; align-items: center; white-space: nowrap; }
.frm-rond { display: block; height: 100%; box-sizing: border-box; border: 1px solid #64748b; border-radius: 50%; background: #fff; flex: none; }
.frm-choix { color: #000; line-height: 1; }
.frm-champ:hover .frm-corps { border-color: #B45309; }
.frm-champ.choisi { outline: 2px solid #F59E0B; outline-offset: 1px; }
.frm-champ:focus { outline: 2px solid #F59E0B; outline-offset: 1px; }
.frm-champ:focus:not(:focus-visible):not(.choisi) { outline: none; }
.frm-suppr, .frm-poignee { display: none; }
.frm-champ.choisi .frm-suppr, .frm-champ.choisi .frm-poignee { display: grid; }
.frm-suppr {
  position: absolute; top: -14px; right: -14px; width: 28px; height: 28px; padding: 0; z-index: 2;
  border-radius: 50%; border: 2px solid #fff; background: #B45309; color: #fff;
  font: 700 1rem/1 system-ui, sans-serif; cursor: pointer; place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.frm-suppr:hover, .frm-suppr:focus-visible { background: #DC2626; outline: none; }
.frm-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) {
  .frm-suppr { width: 34px; height: 34px; top: -17px; right: -17px; }
  .frm-poignee { width: 26px; height: 26px; right: -13px; bottom: -13px; }
}

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

@media (max-width: 420px) {
  .frm-outils { grid-template-columns: repeat(3, 1fr); }
}
