/* Newsletter Popup — Clean minimal design */

.newsletter-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

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

.newsletter-popup {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #E0DDD8);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  max-width: 420px;
  width: 100%;
  position: relative;
  padding: 40px 32px 32px;
  animation: popupIn 0.3s ease;
}

@keyframes popupIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Close */
.newsletter-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2, #F0EEEB);
  color: var(--text-2, #5A5A5A);
  font-size: 18px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.newsletter-close:hover {
  background: var(--bg-3, #E8E5E0);
  color: var(--text, #1A1A1A);
}

.newsletter-close ion-icon { font-size: 18px; }
.newsletter-close .close-fallback { display: none; font-size: 20px; font-weight: bold; line-height: 1; }

/* Header */
.newsletter-header {
  text-align: center;
  margin-bottom: 24px;
}

.newsletter-icon {
  width: 48px;
  height: 48px;
  background: var(--tag-bg, #EDF2FC);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: var(--accent, #2563EB);
}

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

.newsletter-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text, #1A1A1A);
  margin-bottom: 6px;
}

.newsletter-subtitle {
  font-size: 1.4rem;
  color: var(--text-2, #5A5A5A);
  line-height: 1.5;
}

/* Form */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.newsletter-form .form-group {
  position: relative;
}

.newsletter-form label {
  display: block;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-2, #5A5A5A);
  margin-bottom: 4px;
}

.newsletter-form input[type="text"],
.newsletter-form input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 1.5rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text, #1A1A1A);
  background: var(--bg, #FAFAF9);
  border: 1px solid var(--border, #E0DDD8);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input:focus {
  border-color: var(--accent, #2563EB);
}

.newsletter-form input::placeholder {
  color: var(--text-3, #8A8A8A);
}

/* Checkbox */
.newsletter-form .checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
}

.newsletter-form .checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent, #2563EB);
  flex-shrink: 0;
}

.newsletter-form .checkbox-group label {
  font-size: 1.3rem;
  color: var(--text-2, #5A5A5A);
  margin-bottom: 0;
  cursor: pointer;
}

/* Submit */
.newsletter-submit {
  width: 100%;
  padding: 12px;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: #fff;
  background: var(--accent, #2563EB);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.newsletter-submit:hover {
  background: var(--accent-hover, #1D4FD8);
}

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

/* Success — hidden by default, shown via .active */
.newsletter-success {
  display: none;
  text-align: center;
  padding: 20px 0;
}

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

.newsletter-success .success-icon {
  width: 48px;
  height: 48px;
  background: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #fff;
  font-size: 24px;
}

.newsletter-success h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text, #1A1A1A);
  margin-bottom: 6px;
}

.newsletter-success p {
  font-size: 1.4rem;
  color: var(--text-2, #5A5A5A);
}

/* Loading */
.newsletter-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 1.4rem;
  color: var(--text-2, #5A5A5A);
}

.newsletter-loading .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border, #E0DDD8);
  border-top-color: var(--accent, #2563EB);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Register button in header */
.register-btn {
  cursor: pointer;
}

/* Responsive */
@media (max-width: 480px) {
  .newsletter-popup {
    padding: 32px 20px 24px;
    border-radius: 12px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .newsletter-popup { animation: none; }
  .newsletter-popup-overlay { transition: none; }
}
