.jagcap-backdrop {
  --jagcap-accent: #efc92b;
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 16px;
  background: rgba(10, 16, 14, 0.68);
}

.jagcap-backdrop[hidden] {
  display: none;
}

.jagcap-dialog,
.jagcap-dialog * {
  box-sizing: border-box;
}

.jagcap-dialog {
  position: relative;
  /* Larger on desktop; scale back on shorter screens to keep controls usable. */
  width: min(820px, calc(100vw - 40px), 88vh);
  width: min(820px, calc(100vw - 40px), 88dvh);
  max-width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid rgba(70, 85, 78, 0.15);
  border-radius: 12px;
  background: #fff;
  color: #17231f;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.32);
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.jagcap-backdrop.theme-dark .jagcap-dialog {
  border-color: #47574f;
  background: #18211d;
  color: #f5f7f5;
}

.jagcap-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.jagcap-header h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 650;
  line-height: 1.25;
}

.jagcap-close {
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid #bac5bf;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.jagcap-intro {
  margin: 0 0 12px;
  color: inherit;
  font-size: 16px;
}

.jagcap-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #d7e0df;
  touch-action: none;
  user-select: none;
}

.jagcap-background,
.jagcap-foreground {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.jagcap-target,
.jagcap-piece {
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
}

.jagcap-target {
  z-index: 1;
  top: 55%;
  left: 49%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.jagcap-target img,
.jagcap-piece img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.jagcap-target img {
  filter: brightness(0);
  opacity: 0.42;
}

.jagcap-piece {
  z-index: 2;
  cursor: grab;
  touch-action: none;
}

.jagcap-piece[aria-disabled="true"] {
  opacity: 0.7;
  cursor: progress;
}

.jagcap-piece:active {
  cursor: grabbing;
}

.jagcap-piece:focus-visible,
.jagcap-close:focus-visible,
.jagcap-refresh:focus-visible {
  outline: 3px solid var(--jagcap-accent);
  outline-offset: 2px;
}

.jagcap-foreground {
  z-index: 3;
}


/* Jagtech product claim displayed directly below the drag-and-drop image. */
.jagcap-dialog .jagcap-product-fact {
  margin: 14px 0 4px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: #36463f;
}


.jagcap-backdrop.theme-dark .jagcap-product-fact {
  color: #d6e2d9;
}

.jagcap-status {
  min-height: 32px;
  padding: 8px 0 2px;
  color: #4b5b54;
  font-size: 14px;
}

.theme-dark .jagcap-status {
  color: #c5d1ca;
}

.jagcap-status[data-state="error"] {
  color: #a72d28;
}

.jagcap-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 4px;
}

.jagcap-refresh {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #aebbb3;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.jagcap-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
}

.jagcap-help {
  color: #66756d;
  font-size: 11px;
}

.theme-dark .jagcap-help {
  color: #afbbb4;
}

.jagcap-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

@media (max-width: 480px) {
  .jagcap-backdrop {
    padding: 10px;
  }

  .jagcap-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 12px;
  }

  .jagcap-dialog .jagcap-product-fact {
    font-size: 13px;
  }


  .jagcap-header h2 {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jagcap-backdrop *,
  .jagcap-backdrop *::before,
  .jagcap-backdrop *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* The modal Send button calls the documented Gravity Forms submission API. */
.jagcap-send {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  padding: 11px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--jagcap-accent);
  color: #17231f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.jagcap-send:disabled { opacity: .55; cursor: not-allowed; }
.jagcap-send:focus-visible { outline: 3px solid #17231f; outline-offset: 2px; }

/* v1.0.9: Use the website's Elementor global fonts for the CAPTCHA. */
.jagcap-dialog {
  font-family: var(--jagcap-site-body-font, var(--e-global-typography-text-font-family, system-ui, sans-serif));
}
.jagcap-header h2 {
  font-family: var(--jagcap-site-heading-font, var(--e-global-typography-primary-font-family, inherit));
}

/* Branded, accessible Gravity Forms confirmation for document access (Form 2). */
.jagtech-access-success {
  box-sizing: border-box;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 18px;
  background: #fff;
  color: #17231f;
  text-align: left;
  font-family: var(--jagcap-site-body-font, var(--e-global-typography-text-font-family, inherit));
}
.jagtech-access-success .jagtech-access-success__heading {
  margin: 0 0 16px;
  color: #17231f;
  font-family: var(--jagcap-site-heading-font, var(--e-global-typography-primary-font-family, inherit));
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.jagtech-access-success p {
  color: #32413a;
  margin: 0 0 14px;
  font-family: var(--jagcap-site-body-font, var(--e-global-typography-text-font-family, inherit));
  font-size: 16px;
  line-height: 1.55;
}
.jagtech-access-success p:last-child { margin-bottom: 0; }
.jagtech-access-success .jagtech-access-document-title { font-weight: 700; }
.jagtech-access-success a {
  color: var(--e-global-color-accent, #d5295e);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.jagtech-access-success a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Keep the old email form covered while Gravity Forms' iframe submission
   completes. The backend, not a timer, decides when access was granted. */
.jagcap-dialog.jagcap-is-submitting > :not(.jagcap-processing) {
  display: none !important;
}
.jagcap-dialog.jagcap-is-submitting > .jagcap-header {
  display: flex !important;
  justify-content: flex-end;
  margin-bottom: 0;
}
.jagcap-dialog.jagcap-is-submitting > .jagcap-header h2 {
  display: none;
}
.jagcap-dialog.jagcap-is-submitting > .jagcap-processing {
  display: flex !important;
}
.jagcap-processing[hidden] { display: none !important; }
.jagcap-processing {
  min-height: 180px;
  padding: 20px 8px 28px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.jagcap-processing h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: inherit;
}
.jagcap-processing p {
  max-width: 330px;
  margin: 0;
  color: #53635b;
  font-size: 13px;
  line-height: 1.5;
}
.jagcap-processing-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e9e6;
  border-top-color: var(--jagcap-accent);
  border-radius: 50%;
  animation: jagcap-spin 700ms linear infinite;
}
@keyframes jagcap-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .jagcap-processing-spinner { animation: none; }
}

/* v1.0.14: Resilient overlay positioning even if a theme/optimizer overrides styles. */
.jagcap-backdrop.jagcap-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: grid !important;
  place-items: center !important;
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
}
.jagcap-backdrop.jagcap-backdrop[hidden] { display: none !important; }
.jagcap-backdrop.jagcap-backdrop > .jagcap-dialog {
  position: relative !important;
  max-width: min(820px, calc(100vw - 40px)) !important;
  width: min(820px, calc(100vw - 40px), 88dvh) !important;
  margin: 0 auto !important;
}

/* v1.0.15: Approved Option A visual design. All puzzle coordinates and
   Gravity Forms / download behaviour remain unchanged. */
.jagcap-backdrop.jagcap-backdrop { background: rgba(3, 26, 21, 0.80) !important; }
.jagcap-backdrop.jagcap-backdrop > .jagcap-dialog {
  width: min(820px, calc(100vw - 32px), 88dvh) !important;
  max-width: min(820px, calc(100vw - 32px)) !important;
  padding: 0 !important;
  overflow-x: hidden;
  border: 1px solid rgba(34, 77, 64, 0.28);
  border-radius: 20px;
  background: #fff;
  color: #152b24;
}
.jagcap-backdrop .jagcap-header {
  position: relative;
  display: block;
  margin: 0 0 12px;
  padding: 22px 24px 19px;
  border: 0;
  background: linear-gradient(120deg, #06382d 0%, #0b4638 65%, #0b352c 100%);
  color: #fff;
}
.jagcap-backdrop .jagcap-eyebrow {
  margin: 0 48px 12px 0;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .025em;
}
.jagcap-backdrop .jagcap-eyebrow span {
  margin-left: 7px;
  color: #bcdbce;
  font-weight: 550;
}
.jagcap-backdrop .jagcap-header h2 {
  margin: 0 40px 3px 0;
  color: #fff;
  font-family: var(--jagcap-site-heading-font, var(--e-global-typography-primary-font-family, system-ui, sans-serif));
  font-size: clamp(28px, 4.1vw, 43px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.015em;
}
.jagcap-backdrop .jagcap-intro {
  margin: 5px 48px 0 0;
  color: #e6f0eb;
  font-size: clamp(14px, 1.7vw, 18px);
  font-weight: 400;
  line-height: 1.4;
}
.jagcap-backdrop .jagcap-close {
  position: absolute;
  top: 18px;
  right: 19px;
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid #f6fffa;
  background: rgba(0, 0, 0, 0.06);
  color: #fff;
}
.jagcap-backdrop .jagcap-stage {
  width: calc(100% - 36px);
  margin: 0 18px;
  border-radius: 9px;
  aspect-ratio: 4 / 3; /* Must preserve the JAG-MAG hitbox alignment. */
}
.jagcap-backdrop .jagcap-benefit {
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr);
  align-items: center;
  margin: 12px 18px 0;
  padding: 18px 18px 18px 12px;
  min-height: 145px;
  border-radius: 10px;
  background: linear-gradient(125deg, #07352b 0%, #06372e 62%, #042d24 100%);
  color: #fff;
}
.jagcap-backdrop .jagcap-benefit-brand {
  height: 100%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 10px 4px;
  border-right: 1px solid rgba(234, 245, 238, .58);
}
.jagcap-backdrop .jagcap-logo {
  display: block;
  width: 100%;
  max-width: 205px;
  height: auto;
  object-fit: contain;
}
.jagcap-backdrop .jagcap-benefit-copy { padding-left: 20px; min-width: 0; }
.jagcap-backdrop .jagcap-benefit-eyebrow {
  color: #d2eee2;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .045em;
  margin-bottom: 5px;
}
.jagcap-backdrop .jagcap-benefit-lead {
  margin: 0;
  color: #fff;
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 500;
  line-height: 1.4;
}
.jagcap-backdrop .jagcap-benefit-highlight {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 1px;
}
.jagcap-backdrop .jagcap-benefit-highlight strong {
  flex: none;
  color: #ffda48;
  font-size: clamp(43px, 6.5vw, 70px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.05em;
}
.jagcap-backdrop .jagcap-benefit-highlight span {
  color: #fff;
  font-size: clamp(12px, 1.5vw, 15px);
  line-height: 1.4;
}
.jagcap-backdrop .jagcap-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin: 16px 18px 0;
}
.jagcap-backdrop .jagcap-actions { display: flex; padding: 0; }
.jagcap-backdrop .jagcap-refresh {
  width: 100%;
  min-height: 48px;
  border: 1px solid #356957;
  border-radius: 7px;
  background: #fff;
  color: #06382d;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}
.jagcap-backdrop .jagcap-refresh:hover { background: #f1f8f4; }
.jagcap-backdrop .jagcap-send {
  display: block;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: #d5295e;
  color: #fff;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
}
.jagcap-backdrop .jagcap-send:hover:not(:disabled) { background: #be174b; }
.jagcap-backdrop .jagcap-send:disabled { opacity: .52; }
.jagcap-backdrop .jagcap-status {
  min-height: 27px;
  padding: 6px 20px 18px;
  margin: 0;
  color: #667b6e;
  text-align: right;
  font-size: 12px;
}
.jagcap-backdrop .jagcap-status[data-state="error"] { color: #a72d28; }
.jagcap-dialog.jagcap-is-submitting > .jagcap-header { margin-bottom: 0; }
.jagcap-dialog.jagcap-is-submitting > .jagcap-header h2,
.jagcap-dialog.jagcap-is-submitting > .jagcap-header .jagcap-eyebrow,
.jagcap-dialog.jagcap-is-submitting > .jagcap-header .jagcap-intro { display: none; }
.jagcap-dialog.jagcap-is-submitting > .jagcap-header { padding: 18px 20px 18px; }
.jagcap-dialog.jagcap-is-submitting > .jagcap-header .jagcap-close { top: 10px; right: 13px; }
.jagcap-dialog.jagcap-is-submitting > .jagcap-processing { min-height: 180px; }
@media (max-width: 560px) {
  .jagcap-backdrop.jagcap-backdrop > .jagcap-dialog {
    width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }
  .jagcap-backdrop .jagcap-header { padding: 17px 15px 15px; }
  .jagcap-backdrop .jagcap-header h2 { font-size: 25px; }
  .jagcap-backdrop .jagcap-stage { width: calc(100% - 24px); margin: 0 12px; }
  .jagcap-backdrop .jagcap-benefit { grid-template-columns: 1fr; margin: 10px 12px 0; padding: 14px; }
  .jagcap-backdrop .jagcap-benefit-brand { height: auto; min-height: 0; padding: 0 0 10px; border-right: 0; border-bottom: 1px solid rgba(234, 245, 238, .5); justify-content: flex-start; }
  .jagcap-backdrop .jagcap-logo { max-width: 155px; }
  .jagcap-backdrop .jagcap-benefit-copy { padding: 10px 0 0; }
  .jagcap-backdrop .jagcap-benefit-highlight strong { font-size: 50px; }
  .jagcap-backdrop .jagcap-controls { gap: 8px; margin: 12px 12px 0; }
  .jagcap-backdrop .jagcap-refresh,
  .jagcap-backdrop .jagcap-send { font-size: 12px; padding: 9px 7px; }
  .jagcap-backdrop .jagcap-status { padding: 7px 13px 13px; }
}

/* Small, isolated consent-checkbox appearance fix for the existing Elementor
   document-access popup only. No input values, events or validation change. */
#elementor-popup-modal-2085 #gform_2 .ginput_container_consent input[type="checkbox"] {
  -webkit-appearance: checkbox !important;
  appearance: checkbox !important;
  accent-color: #d5295e !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  opacity: 1 !important;
  visibility: visible !important;
  background-image: none !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer;
}
