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

.exit-popup-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.exit-popup-container {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  border-radius: 20px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 51, 153, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.exit-popup-overlay.active .exit-popup-container {
  transform: scale(1);
}

.exit-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 20px;
  height: 20px;
  padding: 20px!important;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exit-popup-content {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.exit-popup-image {
  flex: 0 0 40%;
  width: 40%;
  min-width: 40%;
  background: linear-gradient(180deg, #003399 0%, #001f5c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  min-height: 400px;
  box-sizing: border-box;
}

.exit-popup-image img {
  max-width: 100%;
  max-height: 350px;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.exit-popup-form {
  flex: 1 1 60%;
  width: 60%;
  min-width: 0;
  padding: 40px 35px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}

.exit-popup-form h3 {
  font-size: 26px;
  color: #003399;
  margin: 0 0 15px 0;
  font-weight: 700;
  line-height: 1.3;
}

.exit-popup-form p {
  font-size: 16px;
  color: #555;
  margin: 0;
  line-height: 1.6;
}

.exit-popup-newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.exit-popup-email-label {
  color: #222;
  font-size: 14px;
  font-weight: 700;
}

.exit-popup-email {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid #d6dcec;
  border-radius: 8px;
  background: #fff;
  color: #151515;
  font: inherit;
  box-sizing: border-box;
}

.exit-popup-email:focus {
  border-color: #006aff;
  outline: 3px solid rgba(0, 106, 255, 0.2);
  outline-offset: 1px;
}

.exit-popup-consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #555;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.exit-popup-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

.exit-popup-trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.exit-popup-submit {
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 8px;
  background: #006aff;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.exit-popup-submit:hover,
.exit-popup-submit:focus-visible {
  background: #003399;
  transform: translateY(-1px);
}

.exit-popup-submit:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.exit-popup-status {
  min-height: 22px;
  color: #555;
  font-size: 14px !important;
  line-height: 1.45 !important;
}

.exit-popup-status[data-state="error"] {
  color: #a30909;
}

/* Success message - hidden by default */
.exit-popup-success {
  display: none;
  text-align: center;
  padding: 20px 0;
}

.exit-popup-success .success-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.exit-popup-success h3 {
  color: #003399;
  font-size: 24px;
  margin-bottom: 15px;
}

.exit-popup-success p {
  color: #555;
  font-size: 15px;
  line-height: 1.6;
}

/* Layout when form is submitted */
.exit-popup-content.form-submitted .exit-popup-form > h3,
.exit-popup-content.form-submitted .exit-popup-form > p,
.exit-popup-content.form-submitted .exit-popup-form > form {
  display: none !important;
}

.exit-popup-content.form-submitted .exit-popup-success {
  display: block;
}

/* Mobile responsive - no image, just form */
@media (max-width: 768px) {
  .exit-popup-container {
    max-width: 95%;
    max-height: 85vh;
    margin: 10px;
    overflow-y: auto;
  }

  .exit-popup-content {
    flex-direction: column;
  }

  .exit-popup-image {
    display: none;
  }

  .exit-popup-form {
    width: 100%;
    min-width: 100%;
    padding: 32px 22px 24px;
    min-height: 0;
    display: flex !important;
  }

  .exit-popup-email,
  .exit-popup-submit {
    font-size: 16px;
  }

  .exit-popup-close {
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    padding: 12px!important;
    font-size: 18px;
  }

  .exit-popup-success .success-icon {
    font-size: 48px;
    margin-bottom: 15px;
  }

  .exit-popup-success h3 {
    font-size: 20px;
  }

  .exit-popup-success p {
    font-size: 14px;
  }
}

/* The popup illustration is only fetched when the popup opens (see js/popup.js). */
.exit-popup-image img[data-src] {
  visibility: hidden;
}
