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

:root {
  --bg-dark: #0a0a14;
  --bg-surface: #12121f;
  --bg-card: #1a1a2e;
  --cyan: #00d4ff;
  --cyan-glow: rgba(0, 212, 255, 0.3);
  --purple: #b066ff;
  --purple-glow: rgba(176, 102, 255, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Animated background aurora effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, var(--cyan-glow) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, var(--purple-glow) 0%, transparent 50%);
  opacity: 0.6;
  animation: aurora 15s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

@keyframes aurora {
  0% {
    transform: translateX(-10%) translateY(-5%);
    opacity: 0.5;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    transform: translateX(10%) translateY(5%);
    opacity: 0.5;
  }
}

.container {
  max-width: 800px;
  width: 100%;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.step {
  display: none;
}

.step.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

h1 {
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.2;
  font-weight: 600;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

.brand-title {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

/* Value Proposition */
.value-prop {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}

.pitch {
  font-size: 22px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* CTA Section */
.cta-section {
  text-align: center;
}

.cta-section .google-btn {
  margin: 0 auto;
}

.subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 20px;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 400px;
}

input[type="email"],
input[type="password"] {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-primary);
  resize: vertical;
  width: 100%;
  font-family: inherit;
  line-height: 1.5;
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #00a8cc 100%);
  color: #0a0a14;
  box-shadow: 0 4px 20px var(--cyan-glow);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--cyan-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--border-hover);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Google Sign-In Button */
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--text-primary);
  color: #1a1a2e;
  max-width: 400px;
  padding: 18px 36px;
  font-size: 18px;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  border-radius: 14px;
}

.google-btn:hover {
  background: #f0f0f0;
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.15);
}

.google-btn svg {
  flex-shrink: 0;
}

/* Dev Login Button (localhost only) */
#dev-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--purple);
  border: 2px dashed var(--purple);
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  max-width: 400px;
  width: 100%;
  transition: all 0.3s ease;
}

#dev-signin-btn:hover {
  background: var(--purple-glow);
  border-color: var(--purple);
}

/* Logout Button */
#logout-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
}

#logout-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Prompt Box */
.prompt-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}

.prompt-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 16px 16px 0 0;
}

.prompt-box p {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-line;
  color: var(--text-secondary);
}

#copy-prompt-btn {
  margin-bottom: 12px;
}

/* Newsletter Preview */
.newsletter-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  max-height: 600px;
  overflow-y: auto;
}

.newsletter-preview::-webkit-scrollbar {
  width: 8px;
}

.newsletter-preview::-webkit-scrollbar-track {
  background: var(--bg-surface);
  border-radius: 4px;
}

.newsletter-preview::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.newsletter-preview::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.newsletter-preview h2 {
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 10px;
}

.newsletter-preview p {
  margin-bottom: 10px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.newsletter-preview a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

.newsletter-preview a:hover {
  color: var(--purple);
}

.newsletter-preview table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
}

.newsletter-preview th,
.newsletter-preview td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.newsletter-preview th {
  color: var(--text-primary);
  font-weight: 600;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-buttons button {
  flex: 1;
  min-width: 200px;
}

/* Error Messages */
.error-message {
  color: #ff6b6b;
  font-size: 14px;
  margin-top: 12px;
  display: none;
  padding: 12px 16px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.error-message.show {
  display: block;
}

/* Loader */
.loader {
  display: none;
  text-align: center;
  margin-top: 24px;
}

.loader.show {
  display: block;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-surface);
  border-top-color: var(--cyan);
  border-right-color: var(--purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.loader p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Success Box */
.success-box {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(176, 102, 255, 0.1) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

.success-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
}

.success-box p {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.success-box strong {
  color: var(--cyan);
}

.success-box ul {
  margin-left: 20px;
  margin-top: 10px;
}

.success-box li {
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Dashboard Styles */
.dashboard-section {
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.dashboard-section h2 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-section h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--cyan), var(--purple));
  border-radius: 2px;
}

.preferences-text {
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--bg-dark);
  padding: 20px;
  border-radius: 12px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
}

#view-dashboard-btn {
  margin-top: 24px;
}

/* Edit Preferences */
.edit-prefs-hint {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}

#edit-prefs-input {
  margin-bottom: 12px;
}

#edit-prefs-btn {
  margin-bottom: 0;
}

.prefs-review {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-dark);
  border: 1px solid var(--cyan);
  border-left: 4px solid var(--cyan);
  border-radius: 12px;
}

.prefs-review h3 {
  font-size: 16px;
  color: var(--cyan);
  margin-bottom: 12px;
  font-weight: 600;
}

.prefs-review .preferences-text {
  margin-bottom: 16px;
}

.prefs-review-actions {
  display: flex;
  gap: 12px;
}

.prefs-review-actions button {
  padding: 10px 24px;
  font-size: 14px;
}

.prefs-success {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 640px) {
  h1 {
    font-size: 24px;
  }
  
  .brand-title {
    font-size: 48px;
    letter-spacing: -1px;
  }
  
  .pitch {
    font-size: 18px;
  }
  
  .hero {
    margin-bottom: 32px;
  }
  
  .value-prop {
    margin-bottom: 32px;
  }
  
  .container {
    padding: 20px 12px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons button {
    width: 100%;
  }
  
  .google-btn {
    padding: 16px 28px;
    font-size: 16px;
  }
}

/* Subtle particle effect background */
@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-20px) translateX(10px); }
  50% { transform: translateY(-10px) translateX(-10px); }
  75% { transform: translateY(-30px) translateX(5px); }
}
