/**
 * Newsletter Section Styles
 *
 * @package Yusuf_Theme
 */

/* ========================================
   NEWSLETTER SECTION
   ======================================== */

.newsletter-section {
  background-color: var(--color-bg-light);
  padding: var(--spacing-section-mobile) 0;
}

@media (min-width: 768px) {
  .newsletter-section {
    padding: var(--spacing-section-tablet) 0;
  }
}

@media (min-width: 1024px) {
  .newsletter-section {
    padding: var(--spacing-section-desktop) 0;
  }
}

.newsletter-section__inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

/* Headline */
.newsletter-section__headline {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: var(--font-weight-bold);
  font-style: italic;
  color: var(--color-teal-dark);
  margin-bottom: var(--spacing-4);
}

/* Description */
.newsletter-section__description {
  font-size: var(--font-size-lg);
  color: var(--color-text-medium);
  margin-bottom: var(--spacing-8);
}

/* ========================================
   NEWSLETTER FORM
   ======================================== */

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

@media (min-width: 600px) {
  .newsletter-form {
    flex-direction: row;
  }
}

.newsletter-form__input {
  flex: 1;
  padding: var(--spacing-4) var(--spacing-5);
  font-size: var(--font-size-base);
  font-family: var(--font-primary);
  border: 2px solid var(--color-border);
  background-color: var(--color-bg-white);
  transition: border-color var(--transition-fast);
}

.newsletter-form__input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.newsletter-form__input::placeholder {
  color: var(--color-text-muted);
}

.newsletter-form__submit {
  padding: var(--spacing-4) var(--spacing-8);
  white-space: nowrap;
}

/* ========================================
   MESSAGES
   ======================================== */

.newsletter-form__message {
  margin-top: var(--spacing-4);
  padding: var(--spacing-3) var(--spacing-4);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
}

.newsletter-form__message--success {
  background-color: rgba(11, 206, 20, 0.1);
  color: #0a8f0f;
  border: 1px solid rgba(11, 206, 20, 0.3);
}

.newsletter-form__message--error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

/* ========================================
   LOADING STATE
   ======================================== */

.newsletter-form.is-loading .newsletter-form__submit {
  opacity: 0.7;
  pointer-events: none;
}

.newsletter-form.is-loading .newsletter-form__submit::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: var(--spacing-2);
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: newsletter-spin 0.8s linear infinite;
}

@keyframes newsletter-spin {
  to {
    transform: rotate(360deg);
  }
}
