/* Newsletter Subscription Form Styles */

.ach-newsletter-container {
  font-family: inherit;
  line-height: 1.6;
  margin: 2rem 0;
}

.ach-newsletter-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: inherit;
}

.ach-newsletter-subtitle {
  margin: 0 0 1.5rem 0;
  font-size: 1rem;
  color: inherit;
  opacity: 0.8;
}

.ach-newsletter-form {
  margin: 0;
}

.ach-newsletter-field-group {
  display: flex;
  gap: 0.5rem;
  position: relative;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
}

.ach-newsletter-email {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border-neutral);
  border-radius: 8px;
  font-size: 16px;
  line-height: 28px;
  background: var(--color-object-accent-silent);
  color: var(--color-body-loud);
  transition: all 0.3s ease;
  outline: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.ach-newsletter-email::placeholder {
  color: var(--color-body-quiet);
  opacity: 1;
}

.ach-newsletter-submit {
  padding: 8px 12px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 120px;
  box-sizing: border-box;
  max-width: 100%;
}

.ach-newsletter-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ach-newsletter-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

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

.ach-newsletter-submit-loading {
  display: inline-block;
}

.ach-newsletter-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.ach-newsletter-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.ach-newsletter-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.ach-newsletter-error {
  color: #dc3545;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Style Variations */

/* Default Style (already defined above) */

/* Minimal Style */
.ach-newsletter-minimal .ach-newsletter-title {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.ach-newsletter-minimal .ach-newsletter-subtitle {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.ach-newsletter-minimal .ach-newsletter-email {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
}

.ach-newsletter-minimal .ach-newsletter-submit {
  background: #333;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.ach-newsletter-minimal .ach-newsletter-submit:hover:not(:disabled) {
  background: #555;
  transform: none;
  box-shadow: none;
}

/* Modern Style */
.ach-newsletter-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.ach-newsletter-modern .ach-newsletter-title {
  color: #fff;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.ach-newsletter-modern .ach-newsletter-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.ach-newsletter-modern .ach-newsletter-email {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ach-newsletter-modern .ach-newsletter-email:focus {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-color: transparent;
}

.ach-newsletter-modern .ach-newsletter-submit {
  background: #fff;
  color: #667eea;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ach-newsletter-modern .ach-newsletter-submit:hover:not(:disabled) {
  background: #f8f9fa;
  color: #5a6fd8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.ach-newsletter-modern .ach-newsletter-message {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.ach-newsletter-modern .ach-newsletter-success {
  background: rgba(40, 167, 69, 0.2);
  border-color: rgba(40, 167, 69, 0.3);
}

.ach-newsletter-modern .ach-newsletter-error {
  background: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.3);
}

/* Focus Effects */
.ach-newsletter-focused .ach-newsletter-email {
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ach-newsletter-modern.ach-newsletter-focused .ach-newsletter-email {
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .ach-newsletter-field-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .ach-newsletter-submit {
    width: 100%;
    min-width: auto;
  }

  .ach-newsletter-modern {
    padding: 1.5rem;
  }

  .ach-newsletter-modern .ach-newsletter-title {
    font-size: 1.5rem;
  }

  .ach-newsletter-modern .ach-newsletter-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .ach-newsletter-container {
    margin: 1rem 0;
  }

  .ach-newsletter-title {
    font-size: 1.25rem;
  }

  .ach-newsletter-subtitle {
    font-size: 0.9rem;
  }

  .ach-newsletter-email,
  .ach-newsletter-submit {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px 16px;
    min-height: 44px; /* Better touch target */
  }

  .ach-newsletter-submit {
    width: 100%;
    min-width: auto;
  }

  .ach-newsletter-modern {
    padding: 1rem;
  }

  .ach-newsletter-modern .ach-newsletter-title {
    font-size: 1.25rem;
  }

  .ach-newsletter-modern .ach-newsletter-subtitle {
    font-size: 0.9rem;
  }

  .ach-newsletter-modern .ach-newsletter-email,
  .ach-newsletter-modern .ach-newsletter-submit {
    font-size: 16px;
    padding: 12px 16px;
    min-height: 44px;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .ach-newsletter-container {
    margin: 0.75rem 0;
  }

  .ach-newsletter-email,
  .ach-newsletter-submit {
    font-size: 16px;
    padding: 10px 14px;
    min-height: 44px;
  }

  .ach-newsletter-modern {
    padding: 0.75rem;
  }

  .ach-newsletter-modern .ach-newsletter-email,
  .ach-newsletter-modern .ach-newsletter-submit {
    font-size: 16px;
    padding: 10px 14px;
    min-height: 44px;
  }
}

/* Very narrow containers (like footer columns) */
@media (max-width: 400px) {
  .ach-newsletter-container {
    margin: 0.5rem 0;
    width: 100%;
    max-width: 100%;
  }

  .ach-newsletter-field-group {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .ach-newsletter-email,
  .ach-newsletter-submit {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    padding: 8px 10px;
    min-height: 40px;
  }

  .ach-newsletter-submit {
    min-width: 0;
    white-space: normal;
    word-wrap: break-word;
  }

  .ach-newsletter-modern {
    padding: 0.75rem;
    width: 100%;
    max-width: 100%;
  }

  .ach-newsletter-modern .ach-newsletter-email,
  .ach-newsletter-modern .ach-newsletter-submit {
    font-size: 14px;
    padding: 8px 10px;
    min-height: 40px;
    width: 100%;
    max-width: 100%;
  }

  .ach-newsletter-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .ach-newsletter-subtitle {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .ach-newsletter-message {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Narrow container styles (works regardless of screen size) */
.ach-newsletter-container.narrow,
.ach-newsletter-container[style*='width'] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.ach-newsletter-container.narrow .ach-newsletter-field-group,
.ach-newsletter-container[style*='width'] .ach-newsletter-field-group {
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.ach-newsletter-container.narrow .ach-newsletter-email,
.ach-newsletter-container.narrow .ach-newsletter-submit,
.ach-newsletter-container[style*='width'] .ach-newsletter-email,
.ach-newsletter-container[style*='width'] .ach-newsletter-submit {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
  font-size: 14px;
  padding: 8px 10px;
  min-height: 40px;
}

.ach-newsletter-container.narrow .ach-newsletter-submit,
.ach-newsletter-container[style*='width'] .ach-newsletter-submit {
  min-width: 0 !important;
  white-space: normal;
  word-wrap: break-word;
}

.ach-newsletter-container.narrow .ach-newsletter-title,
.ach-newsletter-container[style*='width'] .ach-newsletter-title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.ach-newsletter-container.narrow .ach-newsletter-subtitle,
.ach-newsletter-container[style*='width'] .ach-newsletter-subtitle {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.ach-newsletter-container.narrow .ach-newsletter-message,
.ach-newsletter-container[style*='width'] .ach-newsletter-message {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
}

/* Modern style adjustments for narrow containers */
.ach-newsletter-container.narrow.ach-newsletter-modern,
.ach-newsletter-container[style*='width'].ach-newsletter-modern {
  padding: 0.75rem;
  width: 100% !important;
  max-width: 100% !important;
}

.ach-newsletter-container.narrow.ach-newsletter-modern .ach-newsletter-email,
.ach-newsletter-container.narrow.ach-newsletter-modern .ach-newsletter-submit,
.ach-newsletter-container[style*='width'].ach-newsletter-modern
  .ach-newsletter-email,
.ach-newsletter-container[style*='width'].ach-newsletter-modern
  .ach-newsletter-submit {
  font-size: 14px;
  padding: 8px 10px;
  min-height: 40px;
  width: 100% !important;
  max-width: 100% !important;
}

/* Animation for loading spinner */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ach-newsletter-submit-loading i {
  animation: spin 1s linear infinite;
}

/* Accessibility improvements */
.ach-newsletter-email:focus-visible {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.ach-newsletter-submit:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
