/* Gated-resource modal — mirrors the event "Rewatch" modal so both gates look
   the same. Loaded only on pages that contain a gated CTA or download link. */

body.zgp-lock {
  overflow: hidden;
}

.zgp-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.zgp-modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.zgp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 17, 40, 0.6);
  backdrop-filter: blur(2px);
}

.zgp-modal__container {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(16px);
  transition: transform 0.3s ease;
}
.zgp-modal.is-open .zgp-modal__container {
  transform: translateY(0);
}

.zgp-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #f7f5fd;
  color: var(--color-sapphire);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.zgp-modal__close:hover {
  background: var(--color-lime);
}
.zgp-modal__close svg {
  width: 22px;
  height: 22px;
}
[dir="rtl"] .zgp-modal__close {
  right: auto;
  left: 16px;
}

.zgp-modal__title {
  font-family: "Zain", sans-serif;
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-sapphire);
  margin: 0 0 8px;
  padding-right: 32px;
}
[dir="rtl"] .zgp-modal__title {
  padding-right: 0;
  padding-left: 32px;
}

.zgp-modal__intro {
  font-size: var(--text-base);
  color: var(--color-ink-muted);
  margin: 0 0 24px;
}

/* Success panel */
.zgp-modal__done {
  text-align: center;
}
.zgp-modal__done .zgp-modal__title {
  padding: 0;
}
.zgp-modal__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--color-lime);
  color: var(--color-sapphire);
}
.zgp-modal__download {
  margin-top: 8px;
}

/* The form reuses the site-wide .wb-form styles; only the modal-specific
   spacing is defined here. */
.zgp-form .wb-form__actions {
  display: flex;
  justify-content: flex-start;
}
.zgp-form .wpcf7-spinner {
  margin-inline-start: 12px;
}
.zgp-form .wpcf7-response-output {
  margin: 4px 0 0;
  font-size: var(--text-sm);
}

/* Gated links keep the download affordance of a normal file link. */
.zgp-link {
  cursor: pointer;
}

/* [gated_download] button */
.zgp-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.zgp-download-icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.zgp-textlink {
  font-weight: 700;
  color: var(--color-sapphire);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.zgp-textlink:hover {
  color: var(--color-blue);
}

@media (max-width: 640px) {
  .zgp-form .wb-form__row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .zgp-modal__container {
    padding: 28px 20px;
  }
}
