/*-----------------------------------*\
  #NEWSLETTER POPUP
\*-----------------------------------*/

/* Newsletter Popup Overlay */
.newsletter-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.newsletter-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Newsletter Popup Container */
.newsletter-popup {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(15, 15, 15, 0.98) 100%);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-16);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 8px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  max-width: 480px;
  width: 100%;
  position: relative;
  animation: popupSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

@keyframes popupSlideIn {
  0% {
    transform: scale(0.8) translateY(30px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Close Button */
.newsletter-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-circle);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-wild-blue-yonder);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-1);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.newsletter-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  transform: scale(1.1);
}

.newsletter-close:focus {
  outline: 2px solid var(--bg-carolina-blue);
  outline-offset: 2px;
}

.newsletter-close ion-icon {
  font-size: 20px;
}

.newsletter-close .close-fallback {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  display: none;
}

/* Show fallback if ion-icon fails to load */
.newsletter-close:not(:has(ion-icon[class*="hydrated"])) .close-fallback {
  display: block;
}

.newsletter-close:not(:has(ion-icon[class*="hydrated"])) ion-icon {
  display: none;
}

/* Header Section */
.newsletter-header {
  text-align: center;
  padding: 40px 30px 20px;
  position: relative;
}

.newsletter-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-1);
  border-radius: var(--radius-16) var(--radius-16) 0 0;
}

.newsletter-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: var(--gradient-1);
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(14, 165, 234, 0.3);
}

.newsletter-title {
  color: var(--text-white);
  font-size: var(--fontSize-2);
  font-weight: var(--weight-bold);
  margin-bottom: 12px;
  line-height: var(--lineHeight-1);
}

.newsletter-subtitle {
  color: var(--text-columbia-blue);
  font-size: var(--fontSize-6);
  line-height: var(--lineHeight-2);
  margin-bottom: 0;
}

/* Form Section */
.newsletter-form {
  padding: 0 30px 40px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  color: var(--text-columbia-blue);
  font-size: var(--fontSize-7);
  font-weight: var(--weight-medium);
  margin-bottom: 8px;
  transition: var(--transition-1);
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-8);
  color: var(--text-white);
  font-size: var(--fontSize-6);
  font-family: var(--fontFamily-noto_sans);
  transition: all 0.3s ease;
  outline: none;
}

.form-input::placeholder {
  color: var(--text-wild-blue-yonder);
  opacity: 0.7;
}

.form-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--bg-carolina-blue);
  box-shadow: 
    0 0 0 3px rgba(14, 165, 234, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.form-input:focus + .form-label {
  color: var(--text-carolina-blue);
}

/* reCAPTCHA Checkbox */
.recaptcha-group {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 25px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-8);
  transition: var(--transition-1);
}

.recaptcha-group:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.recaptcha-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-6);
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.3s ease;
  margin-top: 2px;
}

.recaptcha-checkbox:hover {
  border-color: var(--bg-carolina-blue);
  background: rgba(14, 165, 234, 0.1);
}

.recaptcha-checkbox.checked {
  background: var(--gradient-1);
  border-color: var(--bg-carolina-blue);
}

.recaptcha-checkbox.checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--white);
  font-size: 14px;
  font-weight: bold;
}

.recaptcha-label {
  color: var(--text-alice-blue);
  font-size: var(--fontSize-6);
  line-height: 1.6;
  cursor: pointer;
  user-select: none;
  flex: 1;
  text-align: left;
  font-weight: var(--weight-medium);
}


/* Mobile responsiveness for reCAPTCHA text */
@media (max-width: 480px) {
  .recaptcha-group {
    padding: 16px;
    gap: 12px;
  }
  
  .recaptcha-checkbox {
    width: 16px;
    height: 16px;
    margin-top: 2px;
  }
  
  .recaptcha-label {
    font-size: var(--fontSize-8);
    line-height: 1.5;
  }
}

/* Submit Button */
.newsletter-submit {
  width: 100%;
  padding: 16px 24px;
  background: var(--gradient-1);
  background-size: 200%;
  background-position: left;
  border: none;
  border-radius: var(--radius-8);
  color: var(--white);
  font-size: var(--fontSize-6);
  font-weight: var(--weight-bold);
  font-family: var(--fontFamily-noto_sans);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.newsletter-submit:hover {
  background-position: right;
  transform: translateY(-1px);
  box-shadow: 
    0 8px 24px rgba(14, 165, 234, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.newsletter-submit:active {
  transform: translateY(0);
}

.newsletter-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Success State */
.newsletter-success {
  text-align: center;
  padding: 40px 30px;
  display: none;
}

.newsletter-success.active {
  display: block;
}

.success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #10B981, #059669);
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--white);
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-title {
  color: var(--text-white);
  font-size: var(--fontSize-3);
  font-weight: var(--weight-bold);
  margin-bottom: 12px;
}

.success-message {
  color: var(--text-columbia-blue);
  font-size: var(--fontSize-6);
  line-height: var(--lineHeight-2);
}

/* Loading State */
.newsletter-submit.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid var(--white);
  border-radius: var(--radius-circle);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .newsletter-popup {
    margin: 20px;
    max-width: calc(100% - 40px);
  }
  
  .newsletter-header {
    padding: 30px 20px 15px;
  }
  
  .newsletter-form {
    padding: 0 20px 30px;
  }
  
  .newsletter-title {
    font-size: var(--fontSize-3);
  }
  
  .newsletter-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
    margin-bottom: 16px;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .newsletter-popup-overlay,
  .newsletter-popup,
  .form-input,
  .newsletter-submit,
  .newsletter-close,
  .recaptcha-checkbox {
    transition: none;
    animation: none;
  }
  
  .newsletter-popup {
    animation: none;
  }
}

/* Focus management for accessibility */
.newsletter-popup-overlay:focus-within .newsletter-popup {
  outline: 2px solid var(--bg-carolina-blue);
  outline-offset: 4px;
}

/* Header Register Button Styling */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.register-btn {
  background: transparent !important;
  border: 2px solid var(--bg-carolina-blue) !important;
  color: var(--text-carolina-blue) !important;
  transition: all 0.3s ease;
}

.register-btn:hover,
.register-btn:focus {
  background: var(--bg-carolina-blue) !important;
  color: var(--white) !important;
  border-color: var(--bg-carolina-blue) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 234, 0.3);
}

/* Mobile header adjustments */
@media (max-width: 1199px) {
  .header-actions {
    display: none;
  }
  
  /* Add Register to mobile menu */
  .navbar .register-mobile {
    display: block;
    margin: 20px 0;
    text-align: center;
  }
}

@media (min-width: 1200px) {
  .navbar .register-mobile {
    display: none;
  }
}