/* BHS Sign 2.1 functional layer */
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:4px;background:#f1f4f2;border:1px solid var(--bhs-line);border-radius:12px;margin-bottom:20px}
.auth-tab{border:0;background:transparent;color:var(--bhs-muted);border-radius:9px;padding:9px 10px;font-size:11px;font-weight:750;cursor:pointer}
.auth-tab.active{background:#fff;color:var(--bhs-forest);box-shadow:0 4px 14px rgba(7,29,24,.08)}
.self-sign-card{border:1px solid #d9e4de;background:#f7faf8;border-radius:13px;padding:15px 16px}
.self-sign-card .check{display:grid;grid-template-columns:auto 1fr;gap:10px;margin:0;font-size:10.5px;line-height:1.5;color:#5e6b66}
.self-sign-card .check input{width:auto;min-height:auto;margin-top:3px}
.self-sign-card b{color:var(--bhs-forest-900);font-size:11.5px}
.positioning-step{min-height:520px}
.position-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,.9fr);gap:18px;align-items:end;margin-bottom:13px}
.position-toolbar>b,.position-toolbar div>b{display:block;font-size:12px;color:var(--bhs-forest-900);margin-bottom:5px}
.position-toolbar span{display:block;font-size:9.8px;color:var(--bhs-muted);line-height:1.5}
.position-controls{display:grid;gap:8px}
.position-controls select{min-height:40px}
.field-type-group{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.field-type{border:1px solid var(--bhs-line);background:#fff;border-radius:9px;min-height:36px;padding:7px 8px;font-size:9.5px;font-weight:700;color:#607069;cursor:pointer}
.field-type.active{background:var(--bhs-forest);border-color:var(--bhs-forest);color:#fff}
.position-hint{border-left:3px solid var(--bhs-gold);background:#f8f4ea;color:#6e654f;padding:10px 12px;font-size:9.8px;line-height:1.5;margin-bottom:14px}
.pdf-position-preview{display:grid;gap:20px;background:#e9eeeb;border:1px solid #d7e0db;border-radius:14px;padding:18px;max-height:62vh;overflow:auto}
.position-loading{padding:52px 20px;text-align:center;color:var(--bhs-muted);font-size:11px}
.pdf-page-shell{width:min(100%,760px);margin:0 auto;position:relative;background:#fff;box-shadow:0 16px 42px rgba(7,29,24,.14);line-height:0;user-select:none}
.pdf-page-shell canvas{display:block;width:100%;height:auto}
.page-badge{position:absolute;left:10px;top:10px;z-index:4;background:rgba(7,29,24,.84);color:#fff;border-radius:999px;padding:6px 8px;font-size:8px;font-weight:700;line-height:1;pointer-events:none}
.position-layer{position:absolute;inset:0;z-index:3;cursor:crosshair}
.position-field{position:absolute;min-width:42px;min-height:24px;border:1.5px solid var(--bhs-forest);background:rgba(255,255,255,.88);box-shadow:0 3px 12px rgba(7,29,24,.12);cursor:move;line-height:1.2;touch-action:none}
.position-field.participant-1{border-color:#9a6a23}
.position-field.participant-2{border-color:#416a87}
.position-field.participant-3{border-color:#795b8d}
.position-field.participant-4{border-color:#8a4f4b}
.position-field.participant-5{border-color:#47745b}
.field-caption{display:block;padding:6px 18px 6px 7px;font-size:8px;font-weight:750;color:#193a32;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.field-delete{position:absolute;right:-8px;top:-8px;width:20px;height:20px;border-radius:50%;border:1px solid #dfcac6;background:#fff6f4;color:#9b433a;font-size:14px;line-height:17px;cursor:pointer}
.field-resize{position:absolute;right:-5px;bottom:-5px;width:12px;height:12px;border-radius:3px;background:var(--bhs-gold);border:1px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,.2);cursor:nwse-resize}
.wizard-steps{grid-template-columns:repeat(4,1fr)}
.wizard-step{appearance:none;border:0;background:transparent;text-align:left;cursor:pointer;font-family:inherit}
.wizard-step:hover{color:var(--bhs-forest-900)}
.wizard-step:focus-visible{outline:2px solid var(--bhs-gold);outline-offset:4px;border-radius:4px}
.doc-actions .btn.primary{background:var(--bhs-forest);color:#fff;border-color:var(--bhs-forest)}
@media(max-width:760px){
  .position-toolbar{grid-template-columns:1fr;gap:12px}
  .field-type-group{grid-template-columns:1fr 1fr}
  .pdf-position-preview{padding:10px;max-height:58vh}
  .wizard-steps{overflow:auto;grid-template-columns:repeat(4,minmax(92px,1fr));gap:10px}
  .wizard-step{white-space:nowrap}
}

/* BHS Sign 2.3 — positioning preview + drafts */
.position-field{
  border-radius:14px;
  border-width:1px;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,250,249,.92));
  box-shadow:0 8px 22px rgba(7,29,24,.14);
  backdrop-filter:blur(4px)
}
.field-caption{
  padding:7px 22px 7px 9px;
  font-size:8.5px;
  letter-spacing:.01em
}
.position-field:before{
  content:"";
  position:absolute;
  left:8px;
  right:8px;
  bottom:5px;
  height:1px;
  background:rgba(16,58,49,.22)
}
.position-ghost{
  position:absolute;
  z-index:2;
  display:flex;
  align-items:center;
  gap:6px;
  border:1.5px dashed var(--bhs-gold);
  border-radius:14px;
  background:rgba(247,239,217,.72);
  box-shadow:0 10px 28px rgba(7,29,24,.10);
  color:#6d531e;
  opacity:0;
  transform:scale(.98);
  transition:opacity .08s ease,transform .08s ease;
  pointer-events:none;
  padding:6px 9px;
  line-height:1.15
}
.position-ghost.visible{opacity:1;transform:scale(1)}
.ghost-icon{
  width:18px;height:18px;border-radius:50%;
  display:grid;place-items:center;
  background:var(--bhs-gold);
  color:#17372f;
  font-size:10px;
  flex:0 0 auto
}
.ghost-caption{
  font-size:8.5px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.draft-head-actions{display:flex;align-items:center;gap:10px}
.draft-save-state{
  font-size:9px;
  color:var(--bhs-muted);
  font-weight:700;
  padding:6px 8px;
  border-radius:999px;
  background:#f2f5f3;
  border:1px solid var(--bhs-line)
}
.draft-save-state[data-state="saving"]{color:#7a6227;background:#fbf7ee;border-color:#ead9ad}
.draft-save-state[data-state="saved"]{color:var(--bhs-ok);background:#edf7f1;border-color:#d1e8db}
.draft-save-state[data-state="error"]{color:var(--bhs-bad);background:#fff4f2;border-color:#efd7d3}
.draft-section{border-bottom:1px solid var(--bhs-line);background:#fbfcfb}
.draft-section-title{
  display:flex;justify-content:space-between;align-items:center;
  padding:12px 17px 8px
}
.draft-section-title b{font-size:10.5px;color:var(--bhs-forest)}
.draft-section-title span{font-size:9px;color:var(--bhs-muted)}
.draft-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  margin:0 12px 10px;
  padding:13px 14px;
  border:1px dashed #c9d5cf;
  border-radius:12px;
  background:#fff
}
.draft-row b{display:block;font-size:11px;color:var(--bhs-forest-900)}
.draft-row small{display:block;margin-top:4px;font-size:8.8px;color:var(--bhs-muted)}
.draft-actions{display:flex;gap:7px}
.draft-actions .btn{min-height:34px;padding:7px 10px;font-size:9px}
@media(max-width:760px){
  .draft-head-actions{gap:6px}
  .draft-save-state{display:none}
  .draft-row{grid-template-columns:1fr}
  .draft-actions .btn{flex:1}
  .position-ghost{border-radius:12px}
}
