/* ActiveCampaign Form Modal Overlay
   Replaces broken Thrive Lead popup forms.
   Dark blue theme to match site: rgb(36, 68, 123) */

.ac-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ac-modal-overlay.ac-modal-visible {
  opacity: 1;
  visibility: visible;
}

.ac-modal-container {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  width: 94%;
  max-width: 620px;
  max-height: 90vh;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}

.ac-modal-visible .ac-modal-container {
  transform: translateY(0) scale(1);
}

.ac-modal-header {
  background: rgb(36, 68, 123);
  color: #fff;
  padding: 18px 50px 18px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.ac-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease;
  padding: 0;
  font-family: Arial, sans-serif;
}

.ac-modal-close:hover,
.ac-modal-close:focus {
  background: rgba(255, 255, 255, 0.3);
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

.ac-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(90vh - 60px);
}

.ac-modal-body iframe {
  display: block;
  width: 100%;
  min-height: 500px;
  border: none;
}

/* Prevent body scroll while modal is open */
body.ac-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .ac-modal-container {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }

  .ac-modal-overlay {
    align-items: stretch;
  }

  .ac-modal-header {
    font-size: 16px;
    padding: 14px 46px 14px 16px;
  }

  .ac-modal-body {
    max-height: calc(100vh - 52px);
  }

  .ac-modal-body iframe {
    min-height: 450px;
    height: calc(100vh - 52px);
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .ac-modal-body iframe {
    min-height: 520px;
  }
}

@media (min-width: 901px) {
  .ac-modal-body iframe {
    min-height: 580px;
  }
}
