/* SealVero Visual Field Placer & Live Signer Preview */
.fp-studio {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  min-height: calc(100vh - 150px);
  box-shadow: var(--shadow);
}
.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.fp-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.fp-header-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.fp-header-sub {
  font-size: 11px;
  color: var(--muted);
}

.fp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
  flex-wrap: wrap;
  position: sticky;
  top: 76px;
  z-index: 5;
}
.fp-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.fp-group-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: 4px;
}
.fp-recip-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s;
}
.fp-recip-chip:hover {
  color: var(--ink);
}
.fp-recip-chip.active {
  color: var(--ink);
  background: var(--surface3);
}
.fp-recip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fp-recip-count {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--muted);
}

.fp-field-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s;
}
.fp-field-btn:hover {
  border-color: var(--teal);
}
.fp-field-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #071d20;
}

.fp-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(59, 231, 192, 0.11);
  border-bottom: 1px solid rgba(59, 231, 192, 0.24);
  color: var(--teal);
  font-size: 12px;
  font-weight: 650;
}

.fp-stage {
  position: relative;
  flex: 1;
  overflow: auto;
  padding: 26px 20px 88px;
  background:
    radial-gradient(circle, rgba(149, 166, 185, 0.13) 1px, transparent 1px),
    var(--bg);
  background-size: 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.fp-page-wrap {
  position: relative;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  user-select: none;
  flex-shrink: 0;
}
.fp-page-wrap.placing {
  cursor: crosshair;
}
.fp-pdf-canvas {
  display: block;
  border-radius: 4px;
}
.fp-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
}

/* Placed "Sign Here" Tag */
.fp-tag {
  position: absolute;
  box-sizing: border-box;
  border-radius: 6px;
  border: 2px dashed var(--fp-color, #0d9488);
  background: color-mix(in srgb, var(--fp-color, #0d9488) 14%, rgba(255, 255, 255, 0.82));
  color: var(--fp-color, #0d9488);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3px 8px;
  cursor: move;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}
.fp-tag.selected {
  border-style: solid;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fp-color, #0d9488) 28%, transparent);
  z-index: 8;
}
.fp-tag-label {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-tag-recip {
  font-size: 9.5px;
  font-weight: 650;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-tag-del {
  position: absolute;
  top: -11px;
  right: -11px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: #ef4444;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  cursor: pointer;
}
.fp-tag.selected .fp-tag-del,
.fp-tag:hover .fp-tag-del {
  display: flex;
}
.fp-tag-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--fp-color, #0d9488);
  border: 1.5px solid #fff;
  cursor: nwse-resize;
  display: none;
  z-index: 10;
}
.fp-tag.selected .fp-tag-resize {
  display: block;
}

/* Signer Live PDF.js Preview with "Sign Here" Indicators */
.signer-pdf-stage {
  max-height: 580px;
  overflow: auto;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle, rgba(149, 166, 185, 0.12) 1px, transparent 1px),
    var(--bg);
  background-size: 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.signer-field-marker {
  position: absolute;
  box-sizing: border-box;
  border: 2px dashed #0d9488;
  border-radius: 6px;
  background: rgba(59, 231, 192, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.signer-field-marker.filled {
  border-style: solid;
  border-color: rgba(13, 148, 136, 0.55);
  background: rgba(255, 255, 255, 0.85);
}
.signer-field-prompt {
  font-size: 11px;
  font-weight: 800;
  color: #0b6e65;
  white-space: nowrap;
}
.signer-field-sig-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.signer-field-typed {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: #09524c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signer-field-meta {
  font-family: Helvetica, Arial, sans-serif;
  color: #0f172a;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 960px) {
  .fp-toolbar {
    position: static;
  }
}
