/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Form Container */
.optin-form-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
}

/* Form Styles */
.optin-form {
  background: #ffffff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.optin-form-title {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  text-align: center;
}

.optin-form-description {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.5;
}

/* Input Field */
.optin-form-group {
  margin-bottom: 16px;
}

.optin-form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
  outline: none;
  background: #ffffff;
  color: #1a1a1a;
}

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

.optin-form-input::placeholder {
  color: #9ca3af;
}

/* Error State */
.optin-form-input.error {
  border-color: #ef4444;
}

.optin-form-error {
  color: #ef4444;
  font-size: 14px;
  margin-top: 8px;
  display: none;
}

.optin-form-error.visible {
  display: block;
}

/* Submit Button */
.optin-form-button {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.optin-form-button:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.optin-form-button:active:not(:disabled) {
  transform: translateY(0);
}

.optin-form-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Loading State */
.optin-form-button.loading {
  position: relative;
  color: transparent;
}

.optin-form-button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Success Message */
.optin-form-success {
  background: #10b981;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  margin-top: 16px;
  display: none;
}

.optin-form-success.visible {
  display: block;
}

/* Responsive */
@media (max-width: 640px) {
  .optin-form {
    padding: 24px;
  }
  
  .optin-form-title {
    font-size: 20px;
  }
  
  .optin-form-description {
    font-size: 14px;
  }
}

/* Standalone Page Styles */
.standalone-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.standalone-page .optin-form {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
