/* PDF field overlays — shared by the intake-review and pdf-field-placer tools.
   Both render positioned boxes over a rendered PDF/image, so they share one
   visual definition. */
.field-marker {
  position: absolute;
  border: 2px solid;
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.field-marker:active,
.field-marker-dragging { cursor: grabbing; opacity: 0.85; }
.field-marker:hover { box-shadow: 0 0 0 2px rgba(37,99,235,0.55); z-index: 10; }
.field-marker-label {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 12px;
  pointer-events: none;
}
.field-marker-text { border-color: #3b82f6; background: rgba(59,130,246,0.12); color: #1d4ed8; }
.field-marker-date { border-color: #8b5cf6; background: rgba(139,92,246,0.12); color: #6d28d9; }
.field-marker-signature { border-color: #10b981; background: rgba(16,185,129,0.12); color: #065f46; }
.field-marker-checkbox { border-color: #f59e0b; background: rgba(245,158,11,0.12); color: #92400e; }
.field-marker-radio { border-color: #0ea5e9; background: rgba(14,165,233,0.12); color: #0369a1; }
.field-marker-multi_checkbox { border-color: #ec4899; background: rgba(236,72,153,0.12); color: #9d174e; }
.field-marker-select { border-color: #14b8a6; background: rgba(20,184,166,0.12); color: #0f766e; }
.field-marker-file_upload { border-color: #64748b; background: rgba(100,116,139,0.12); color: #334155; }
.field-marker-money { border-color: #06b6d4; background: rgba(6,182,212,0.12); color: #0e7490; }
.field-marker-phone { border-color: #f97316; background: rgba(249,115,22,0.12); color: #9a3412; }
.field-marker.is-low { border-color: #ef4444; background: rgba(239,68,68,0.14); color: #b91c1c; }
.field-marker.is-active { box-shadow: 0 0 0 3px rgba(37,99,235,0.55); z-index: 10; }
.field-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: currentColor;
  opacity: 0.5;
  cursor: se-resize;
  border-radius: 1px 0 2px 0;
  flex-shrink: 0;
}
.field-resize-handle:hover { opacity: 0.9; }
/* Inset ring (not a real border) so the highlight is bold without shifting the row's layout. */
.intake-field-row.is-active { background: #eff6ff; box-shadow: inset 0 0 0 2px #2563eb; border-radius: 0.5rem; }
.dark .intake-field-row.is-active { background: rgba(37,99,235,0.18); box-shadow: inset 0 0 0 2px #3b82f6; }
/* Guided review spotlight: show only the field(s) for the current step, hide the rest. */
.intake-fields.is-focusing .intake-field-row { display: none; }
.intake-fields.is-focusing .intake-field-row.is-step { display: block; }
.intake-fields.is-focusing .intake-section-header,
.intake-fields.is-focusing .intake-fields-chrome { display: none; }
.pdf-page-wrapper {
  position: relative;
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
}
.pdf-canvas { display: block; max-width: 100%; }
.placement-ghost {
  position: absolute;
  background: rgba(99,102,241,0.85);
  border-radius: 2px;
  pointer-events: none;
}

/* Small non-interactive markers showing where each choice option (radio /
   multi-checkbox) lands on the page. */
.field-option-marker {
  position: absolute;
  border: 1.5px solid;
  border-radius: 2px;
  box-sizing: border-box;
  cursor: pointer;
  z-index: 5;
}
.field-option-marker:hover { box-shadow: 0 0 0 2px rgba(37,99,235,0.55); }
.field-option-marker.is-active { box-shadow: 0 0 0 2px rgba(37,99,235,0.55); z-index: 10; }
.field-option-marker.is-low { border-color: #ef4444; }
.field-option-marker.is-preview { pointer-events: none; }
.field-option-marker.is-radio { border-radius: 50%; }
/* While positioning an option, let clicks fall through markers to the canvas. */
.is-positioning .field-option-marker { pointer-events: none; }
/* Read-only builder view (form_templates#show) — markers are static, not clickable. */
.is-readonly .field-marker,
.is-readonly .field-option-marker { cursor: default; }
.is-readonly .field-marker:hover,
.is-readonly .field-option-marker:hover { box-shadow: none; }
.field-option-marker-label {
  position: absolute;
  left: calc(100% + 3px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

/* Floating popover that hosts the add/edit field form, anchored in context to
   a click point on the PDF. Position is applied via element.style.left/top in
   JS (CSP-safe — never an inline style attribute). */
.field-popover {
  position: fixed;
  z-index: 50;
  width: 20rem;
  max-height: 85vh;
  overflow-y: auto;
}
