/* Newsletter Modal Component - BEM Structure */

.newsletter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.newsletter-modal--visible {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.newsletter-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.newsletter-modal__container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 20px;
  z-index: 1;
  transform: translateY(-20px);
  transition: transform 0.3s ease-in-out;
}

.newsletter-modal--visible .newsletter-modal__container {
  transform: translateY(0);
}

.newsletter-modal__content {
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
}

.newsletter-modal__content h2 {
  color: #51809f;
  text-align: center;
  margin-bottom: 8px;
  text-wrap: balance;
}

.newsletter-modal__inner {
  padding: 30px;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.newsletter-modal__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  background-color: #ffffff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.newsletter-modal__close:hover {
  background-color: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.newsletter-modal__close::before,
.newsletter-modal__close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background-color: #6c757d;
  border-radius: 1px;
  transition: background-color 0.2s ease;
}

.newsletter-modal__close::before {
  transform: rotate(45deg);
}

.newsletter-modal__close::after {
  transform: rotate(-45deg);
}

.newsletter-modal__close:hover::before,
.newsletter-modal__close:hover::after {
  background-color: #495057;
}

.newsletter-modal .fui-submit {
  border: 2px solid #00689A !important;
  background: #00689A !important;
  color: #ffffff !important;
}

.newsletter-modal .forms-block .fui-form .fui-submit:hover {
  border: 2px solid #58595b !important;
  background: #ffffff !important;
  color: #58595b !important;
}

.newsletter-modal .fui-field:not(.fui-type-hidden-field) {
  margin-bottom: 8px;
}

.newsletter-modal .newsletter-modal__inner-header {
  margin-bottom: 20px;
}

.newsletter-modal .fui-btn-container,
.newsletter-modal .newsletter-modal__inner-footer {
  margin-top: 20px;
}

.newsletter-modal .newsletter-modal__inner-footer p {
  font-size: 14px;
}

.newsletter-modal .fui-heading-h2 {
  font-size: 25px;
  text-wrap: balance;
}

.newsletter-modal .fui-heading-h3 {
  font-size: 16px;
  text-wrap: balance;
}

/* Responsive Design */
@media (max-width: 768px) {
  .newsletter-modal__container {
    max-width: 95%;
    margin: 10px;
  }

  .newsletter-modal__inner {
    padding: 20px;
    max-height: 80vh;
  }

  .newsletter-modal__close {
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
  }

  .newsletter-modal__close::before,
  .newsletter-modal__close::after {
    width: 14px;
  }
}

@media (max-width: 480px) {
  .newsletter-modal__inner {
    padding: 15px;
  }
}

/* Animation keyframes for enhanced effects */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
}

.newsletter-modal--animating-in .newsletter-modal__container {
  animation: modalFadeIn 0.3s ease-out forwards;
}

.newsletter-modal--animating-out .newsletter-modal__container {
  animation: modalFadeOut 0.3s ease-in forwards;
}
