/* Digital waiver signature pad */
.digital-signature-panel {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid rgba(28,124,84,.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(28,124,84,.08), transparent 34%),
    #fff;
}

.signature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.signature-head strong,
.signature-head span {
  display: block;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 180px;
  border: 2px dashed rgba(15,23,42,.18);
  border-radius: 18px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
  box-shadow: inset 0 1px 0 rgba(15,23,42,.04);
}

.signature-canvas:focus,
.signature-canvas:hover {
  border-color: rgba(28,124,84,.42);
}

#waiverForm.waiver-signed .digital-signature-panel {
  border-color: rgba(28,124,84,.35);
  background: #ecfdf3;
}

@media (max-width: 640px) {
  .signature-head {
    display: grid;
  }

  .signature-canvas {
    height: 210px;
  }
}


/* Signed waiver: signature is locked */
#waiverForm.waiver-signature-locked .signature-canvas,
.signature-canvas.signature-locked {
  border-style: solid;
  border-color: rgba(28,124,84,.32);
  background:
    linear-gradient(135deg, rgba(236,253,243,.72), rgba(255,255,255,.96));
  cursor: not-allowed;
  pointer-events: none;
}

#waiverForm.waiver-signature-locked #clearSignatureBtn,
#waiverForm.waiver-signature-locked button[type="submit"] {
  cursor: not-allowed;
}

.waiver-lock-note {
  margin-top: 12px;
}

/* Mobile-first professional signature experience */
.signature-mobile-pro {
  position: relative;
  overflow: hidden;
  border-color: rgba(28,124,84,.22);
  box-shadow: 0 18px 45px rgba(15,23,42,.08);
}

.signature-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  white-space: nowrap;
}

#waiverForm.signature-has-ink .signature-status-pill,
.signature-status-pill.is-done {
  background: #dcfce7;
  color: #166534;
}

#waiverForm.waiver-signature-locked .signature-status-pill,
.signature-status-pill.is-locked {
  background: #ecfdf3;
  color: #166534;
}

.signature-canvas-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(248,250,252,.96), rgba(255,255,255,1));
  box-shadow:
    inset 0 0 0 1px rgba(15,23,42,.08),
    inset 0 16px 34px rgba(15,23,42,.04);
}

.signature-canvas-shell .signature-canvas {
  position: relative;
  z-index: 2;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: none;
}

.signature-watermark {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  color: rgba(100,116,139,.20);
  font-size: clamp(28px, 9vw, 62px);
  font-weight: 900;
  letter-spacing: -.05em;
  pointer-events: none;
  user-select: none;
  transition: opacity .18s ease;
}

.signature-baseline {
  position: absolute;
  z-index: 1;
  left: 8%;
  right: 8%;
  bottom: 26%;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(28,124,84,.26) 0 10px, transparent 10px 18px);
  pointer-events: none;
}

#waiverForm.signature-has-ink .signature-watermark,
#waiverForm.waiver-signature-locked .signature-watermark {
  opacity: 0;
}

.signature-mobile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.signature-mobile-footer p,
.signature-legal-note {
  margin: 0;
}

#waiverForm.signature-has-ink .signature-canvas-shell {
  box-shadow:
    inset 0 0 0 2px rgba(22,163,74,.22),
    0 14px 30px rgba(22,163,74,.08);
}

@media (max-width: 640px) {
  .digital-signature-panel.signature-mobile-pro {
    margin-left: -2px;
    margin-right: -2px;
    padding: 14px;
    border-radius: 24px;
  }

  .signature-head {
    gap: 10px;
  }

  .signature-status-pill {
    width: 100%;
  }

  .signature-canvas {
    height: 275px;
  }

  .signature-mobile-footer {
    display: grid;
    gap: 10px;
  }

  .signature-mobile-footer .btn {
    width: 100%;
  }

  #waiverForm > button[type="submit"] {
    width: 100%;
    min-height: 46px;
  }
}
