/* ── Wrapper de cada zona de assinatura ── */
.sig-zones-wrapper {
  display: flex;
  flex-direction: row;
}

.sig-zone {
  flex: 1;
  min-width: 0;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px 20px;
}

.sig-zone-label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 10px;
  display: block;
}

/* Preview da assinatura guardada */
.sig-preview {
  display: none;
  max-width: 100%;
  max-height: 90px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fff;
}

/* Remove <br> injetados pelo Formidable Forms */
.sig-btn br,
.sig-actions br,
.sig-zone br,
.sig-btn-confirm br,
.sig-btn-clear-modal br {
  display: none;
}

/* Botões */
.sig-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.sig-btn-primary {
  background: #1a5ce5;
  color: #fff;
}

.sig-btn-primary:hover {
  background: #154bbf;
}

.sig-btn-danger {
  background: #fff;
  color: #c0392b !important;
  border: 1px solid #e0b0aa;
}

.sig-btn-danger:hover {
  background: #fdf0ee;
}

/* ── Modal overlay ── */
#sig-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.sig-modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.sig-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sig-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.sig-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 0;
}

.sig-modal-close:hover {
  color: #333;
}

/* Canvas dentro do modal */
#sig-modal-canvas {
  width: 100%;
  height: 220px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
  display: block;
}

.sig-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.sig-modal-footer .sig-btn-confirm {
  background: #1a5ce5;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  transition: background 0.15s;
}

.sig-modal-footer .sig-btn-confirm:hover {
  background: #154bbf;
}

.sig-modal-footer .sig-btn-clear-modal {
  background: #fff;
  color: #c0392b;
  border: 1px solid #e0b0aa;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.sig-modal-footer .sig-btn-clear-modal:hover {
  background: #fdf0ee;
}

/* Wrapper dos botões de ação (Alterar + Eliminar) */
.sig-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* Instrução dentro do modal */
.sig-modal-hint {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin: 0;
}

/* Zona de assinatura em erro (obrigatória não preenchida) */
.sig-zone.sig-error {
  border-color: #c0392b;
  background: #fff8f7;
}

.sig-zone.sig-error .sig-zone-label::after {
  content: ' *';
  color: #c0392b;
}

/* Responsive — mobile */
@media (max-width: 600px) {
  .sig-zones-wrapper {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .sig-modal-box {
    padding: 14px;
  }

  #sig-modal-canvas {
    height: 180px;
  }
}