/**
 * Real Wave Newsletter Modal Styles
 * Professional, compact design matching site aesthetics
 * Updated: 2025-10-14 - Fully responsive with mobile optimizations
 */

/* Modal Backdrop */
.newsletter-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 20px;
}

.newsletter-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.newsletter-modal {
  background: white;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.4);
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.newsletter-modal-backdrop.active .newsletter-modal {
  transform: scale(1) translateY(0);
}

/* Close Button */
.newsletter-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.newsletter-close:hover {
  background: #f1f5f9;
  color: #475569;
}

/* Content */
.newsletter-content {
  padding: 36px 32px 32px;
}

.newsletter-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 20px 0;
  font-size: 22px;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.newsletter-content h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.newsletter-subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Form */
.newsletter-form {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Strong scoping to avoid page-level .newsletter-form styles overriding modal */
#newsletterModal .newsletter-form {
  display: block !important; /* prevent flex from global styles */
}

#newsletterModal .newsletter-form .form-group {
  display: block;
  width: 100%;
}

#newsletterModal .newsletter-form .form-group label,
#newsletterModal .newsletter-form .form-group input {
  display: block;
  width: 100%;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.required {
  color: #ef4444;
}

.optional {
  font-weight: 400;
  color: #94a3b8;
  font-size: 12px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
  color: #cbd5e1;
}

/* Checkbox Group */
.checkbox-group {
  margin: 20px 0;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3b82f6;
  margin-top: 2px;
  flex: 0 0 auto;
}

.checkbox-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #475569;
  font-weight: 600; /* bolder per request */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Submit Button */
.newsletter-submit {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 10px;
  border: 1px solid #3b82f6;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background-position 1.2s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
  background-size: 200% 200%;
  background-position: 0% 50%;
}

.newsletter-submit:hover:not(:disabled) {
  border-color: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  background-position: 100% 50%; /* subtle shimmer */
}

.newsletter-submit:active:not(:disabled) {
  border-color: #1e40af;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

/* Subtle hover for disclaimer card */
.checkbox-group:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(15,23,42,0.06);
}

.newsletter-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Success State */
.newsletter-success {
  text-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: white;
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.newsletter-success h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.newsletter-success p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
}

.success-cta {
  margin-top: 20px !important;
  font-weight: 600;
  color: #334155;
  font-size: 13px;
}

.facebook-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #1877f2;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(24, 119, 242, 0.25);
}

.facebook-btn:hover {
  background: #166fe5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 111, 229, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
  .newsletter-content {
    padding: 28px 20px 24px;
  }
  
  .newsletter-content h2 {
    font-size: 20px;
  }
  
  .newsletter-subtitle {
    font-size: 13px;
  }
  
  /* Hide large icon on mobile */
  .newsletter-icon {
    display: none;
  }
  
  /* Show icon in button on mobile */
  .newsletter-submit::before {
    content: "\f0e0";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
  }
  
  .success-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }
}

/* Dark Mode Support */
:root.dark .newsletter-modal {
  background: #1e293b;
}

:root.dark .newsletter-content h2,
:root.dark .newsletter-success h3 {
  color: white;
}

:root.dark .form-group label {
  color: #e2e8f0;
}

:root.dark .form-group input {
  background: #0f172a;
  border-color: #334155;
  color: white;
}

:root.dark .form-group input:focus {
  background: #1e293b;
  border-color: #3b82f6;
}

:root.dark .form-group input::placeholder {
  color: #475569;
}

:root.dark .checkbox-text {
  color: #cbd5e1;
}

:root.dark .newsletter-close {
  color: #cbd5e1;
}

:root.dark .newsletter-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
