:root {
  --black: #000000;
  --white: #ffffff;
  --lilac: #c5b0e5;
  --light-lilac: #e5dbff;
  --purple: #764ba2;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--black);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  background: linear-gradient(135deg, var(--light-lilac), var(--lilac));
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 50px; 
  transition: all 0.3s ease;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.nav-links a {
  color: var(--black);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--lilac);
}

/* Newsletter Container */
.newsletter-container {
  background: white;
  border-radius: 24px;
  padding-bottom: 50px;
  padding-top: 100px;
  margin-top: 100px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  text-align: center;
  margin: 120px auto 2rem;
  animation: fadeIn 0.6s ease-out;
}

.newsletter-icon {
  width: 250px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  overflow: hidden;
  border: 1px solid var(--lilac);
}

.newsletter-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.newsletter-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.newsletter-subtitle {
  font-size: 1.1rem;
  color: var(--black);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Form Styles */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem; 
}

.form-group {
  text-align: left;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px rgba(197, 176, 229, 0.1);
}

.form-select {
  width: 100%;
  padding: 1rem;
  border: 2px solid #000000;
  border-radius: 12px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-select:focus {
  outline: none;
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px rgba(197, 176, 229, 0.1);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.5rem 0;
  text-align: left;
}

.checkbox {
  width: 18px;
  height: 18px;
  margin-top: 0.125rem;
  accent-color: var(--lilac);
  flex-shrink: 0;
}

.checkbox-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.5;
  flex: 1;
}

.checkbox-label a {
  color: var(--purple);
  text-decoration: underline;
}

.subscribe-btn {
  background: var(--black);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.subscribe-btn:hover {
  background: var(--lilac);
  color: var(--black);
  transform: translateY(-2px);
}

.subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Success Message */
.success-message {
  display: none;
  background: var(--light-lilac);
  border: 2px solid var(--lilac);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 0.5rem;
}

.success-text {
  color: var(--gray-700);
}

/* Stats */
.newsletter-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--light-lilac);
  border-radius: 12px;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--purple);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* Footer */
.footer-note {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 1.5rem;
  line-height: 1.4;
}

/* Loading Animation */
.loading {
  display: none;
  margin-left: 0.5rem;
}

.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--lilac);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .newsletter-container {
    max-width: 450px;
    width: 85%;
  }
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 1rem;
    height: auto;
    padding: 15px 20px;
  }

  .nav-links {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links a {
    font-size: 14px;
  }

  .header {
    position: relative;
  }

  body {
    align-items: stretch;
    padding: 1rem;
  }

  .newsletter-container {
    margin: 2rem auto;
    padding: 2rem;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
  }

  .newsletter-icon {
    width: 200px;
    height: 120px;
    margin-bottom: 1.5rem;
  }

  .newsletter-title {
    font-size: 1.75rem;
    line-height: 1.3;
  }

  .newsletter-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .newsletter-stats {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .stat {
    padding: 0.5rem;
  }

  .form-input,
  .form-select {
    padding: 0.875rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .subscribe-btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  .checkbox-group {
    gap: 0.5rem;
    margin: 1rem 0;
  }

  .checkbox {
    width: 20px;
    height: 20px;
    margin-top: 0;
  }

  .checkbox-label {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .nav {
    padding: 10px 15px;
  }

  .nav-links {
    gap: 15px;
  }

  .nav-links a {
    font-size: 16px;
  }

  .logo {
    font-size: 18px;
  }

  .newsletter-container {
    padding: 1.5rem;
    margin: 1rem auto;
    border-radius: 12px;
  }

  .newsletter-icon {
    width: 150px;
    height: 90px;
    margin-bottom: 1rem;
  }

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

  .newsletter-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }

  .form-group {
    margin-bottom: 0.75rem;
  }

  .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.375rem;
  }

  .form-input,
  .form-select {
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 16px;
  }

  .subscribe-btn {
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.9rem;
  }

  .checkbox-group {
    margin: 0.75rem 0;
  }

  .checkbox-label {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .footer-note {
    font-size: 0.75rem;
    margin-top: 1rem;
  }

  .newsletter-stats {
    padding: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .success-message {
    padding: 1.5rem;
  }

  .success-icon {
    font-size: 2.5rem;
  }

  .success-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 320px) {
  .newsletter-container {
    padding: 1rem;
  }

  .newsletter-icon {
    width: 120px;
    height: 75px;
  }

  .newsletter-title {
    font-size: 1.3rem;
  }

  .newsletter-subtitle {
    font-size: 0.85rem;
  }

  .form-input,
  .form-select {
    padding: 0.625rem;
  }

  .subscribe-btn {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }
}

/* Landscape mobile orientation */
@media (max-height: 600px) and (orientation: landscape) {
  .newsletter-container {
    margin: 1rem auto;
    padding: 1.5rem;
  }

  .newsletter-icon {
    width: 120px;
    height: 75px;
    margin-bottom: 1rem;
  }

  .newsletter-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .newsletter-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .form-group {
    margin-bottom: 0.5rem;
  }

  .newsletter-stats {
    display: none;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .newsletter-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode support (if user prefers) */
@media (prefers-color-scheme: dark) {
  /* Keep the light theme for this specific design */
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .newsletter-container {
    animation: none;
  }
  
  .subscribe-btn:hover {
    transform: none;
  }
  
  .spinner {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-input,
  .form-select {
    border-width: 3px;
  }
  
  .subscribe-btn {
    border: 2px solid var(--black);
  }
}

/* Focus styles for better accessibility */
.form-input:focus,
.form-select:focus,
.subscribe-btn:focus,
.checkbox:focus {
  outline: 2px solid var(--lilac);
  outline-offset: 2px;
}

/* Ensure touch targets are large enough */
@media (pointer: coarse) {
  .checkbox {
    width: 24px;
    height: 24px;
  }
  
  .nav-links a {
    padding: 0.5rem;
  }
}
