/* ============================================================
   WP PDF Form Embed v2.0.0
   ============================================================ */

/* ── Wrapper ── */
.wppdfe-wrapper {
  max-width: 100%;
  margin: 24px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.wppdfe-title {
  margin: 0 0 16px;
  font-size: 1.25em;
}

/* ── Toolbars ── */
.wppdfe-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.wppdfe-toolbar-top {
  margin-bottom: 12px;
}

.wppdfe-toolbar-bottom {
  margin-top: 16px;
}

/* ── Viewer shell (scrollable area) ── */
.wppdfe-viewer-shell {
  position: relative;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  overflow: auto;
  background: #e9edf2;
  padding: 18px;
}

.wppdfe-loading {
  font-size: 14px;
  margin-bottom: 12px;
  color: #555;
}

/* ── Pages container ── */
.wppdfe-pages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

/* ── Individual page ──
   CRITICAL: position:relative so the annotation layer
   can be positioned absolutely on top of the canvas.
   Width & height are set inline by JS to match the viewport exactly.
*/
.wppdfe-page {
  position: relative;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  /* transform-origin set by JS when responsive scaling is applied */
}

/* ── Canvas ──
   DO NOT set width:100% or height:auto here!
   The canvas must keep its natural pixel dimensions so that
   the annotation layer coordinates align perfectly.
*/
.wppdfe-page canvas {
  display: block;
  /* width and height come from the element attributes set by JS */
}

/* ── Annotation / form layer ──
   Covers the entire page div. Fields are positioned absolutely
   inside this layer using PDF viewport coordinates.
*/
.wppdfe-annotation-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none; /* let clicks pass through to canvas unless on a field */
  z-index: 1;
}

/* ── Field wrapper (positioned by JS) ── */
.wppdfe-field {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto; /* re-enable interaction on the field itself */
  overflow: visible;
}

/* ── Form inputs inside fields ── */
.wppdfe-field input[type="text"],
.wppdfe-field input[type="email"],
.wppdfe-field input[type="tel"],
.wppdfe-field textarea,
.wppdfe-field select {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: rgba(215, 230, 255, 0.35);
  padding: 1px 3px;
  font-family: inherit;
  line-height: 1.2;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wppdfe-field input[type="text"]:hover,
.wppdfe-field input[type="email"]:hover,
.wppdfe-field input[type="tel"]:hover,
.wppdfe-field textarea:hover,
.wppdfe-field select:hover {
  border-color: rgba(0, 90, 200, 0.35);
  background: rgba(215, 230, 255, 0.55);
}

.wppdfe-field input[type="text"]:focus,
.wppdfe-field input[type="email"]:focus,
.wppdfe-field input[type="tel"]:focus,
.wppdfe-field textarea:focus,
.wppdfe-field select:focus {
  border-color: rgba(0, 90, 200, 0.6);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(0, 90, 200, 0.15);
}

.wppdfe-field textarea {
  resize: none;
}

/* ── Checkboxes & Radios ── */
.wppdfe-field input[type="checkbox"],
.wppdfe-field input[type="radio"] {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: #005ac8;
  background: transparent;
  border: none;
  pointer-events: auto;
}

/* ── Read-only fields ── */
.wppdfe-field-readonly {
  opacity: 0.55;
  pointer-events: none;
}

/* ── Buttons ── */
.wppdfe-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.wppdfe-btn:hover {
  opacity: 0.88;
}

.wppdfe-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Zoom indicator ── */
.wppdfe-zoom-indicator {
  font-size: 14px;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
  user-select: none;
}

/* ── Status bar ── */
.wppdfe-status {
  margin-top: 10px;
  font-size: 13px;
  color: #555;
  min-height: 1.3em;
}

.wppdfe-error {
  color: #b00020;
  font-weight: 600;
}

/* ── Fullscreen mode ── */
.wppdfe-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  z-index: 999999 !important;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  border-radius: 0;
}

.wppdfe-fullscreen .wppdfe-viewer-shell {
  height: calc(100vh - 130px) !important;
  border-radius: 0;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .wppdfe-viewer-shell {
    padding: 8px;
  }

  .wppdfe-toolbar {
    gap: 6px;
  }

  .wppdfe-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}
