/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Design tokens */
:root {
  --primary: #e84393;
  --accent: #6c5ce7;
  --bg: #fdf6f0;
  --text: #2d3436;
  --muted: #636e72;
  --radius: 12px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
}

html {
  font-size: 16px;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: var(--space-md);
}

#app {
  width: 100%;
  max-width: 480px;
}

/* View switching */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 250ms ease-out;
}

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

@keyframes pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Card */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.card h1 {
  font-size: 1.6rem;
  line-height: 1.3;
  margin-bottom: var(--space-md);
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
}

.subhead {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: var(--space-lg);
}

.emoji-row {
  font-size: 2rem;
  letter-spacing: 8px;
  margin-bottom: var(--space-md);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 48px;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  background: #b2bec3;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 48px;
}

/* Button group (setup screen) */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.btn-option {
  flex: 1 1 45%;
  padding: 14px 12px;
  font-size: 1rem;
  font-weight: 500;
  background: #fff;
  border: 2px solid #dfe6e9;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 48px;
  transition:
    border-color 150ms,
    background 150ms;
}

.btn-option:hover {
  border-color: var(--primary);
}

.btn-option.selected {
  border-color: var(--primary);
  background: #fce4ec;
}

/* Answer pills (quiz) */
.answer {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: var(--space-sm);
  font-size: 1rem;
  text-align: left;
  background: #fff;
  border: 2px solid #dfe6e9;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 48px;
  transition:
    border-color 150ms,
    background 150ms;
}

.answer:hover {
  border-color: var(--accent);
}

.answer.selected {
  border-color: var(--accent);
  background: #ede7f6;
}

/* Progress bar */
.progress-bar {
  height: 6px;
  background: #dfe6e9;
  border-radius: 3px;
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 300ms ease;
  width: 0;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: var(--space-md);
}

/* Quiz nav */
.quiz-nav {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.quiz-nav .btn-primary {
  flex: 1;
}

.quiz-nav .btn-secondary {
  flex: 0 0 auto;
}

/* Results */
.result-emoji {
  font-size: 64px;
  animation: pop 500ms ease-out;
  margin-bottom: var(--space-md);
}

.results-card h1 {
  margin-bottom: var(--space-sm);
}

.results-card .description {
  text-align: left;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.results-card h2 {
  text-align: left;
  margin-bottom: var(--space-sm);
}

.how-to-love {
  text-align: left;
  padding-left: 20px;
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}

.tagline {
  font-weight: 700;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--primary);
  margin-bottom: var(--space-lg);
}

.share-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.share-text {
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

/* Email capture */
.email-capture {
  margin-top: var(--space-lg);
  text-align: left;
}

.email-capture h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
  text-align: center;
}

.guide-teaser {
  padding-left: 20px;
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

#email-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

#email-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid #dfe6e9;
  border-radius: var(--radius);
  min-height: 48px;
}

#email-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-error {
  color: #d63031;
  font-size: 0.9rem;
  min-height: 0;
}

.form-success {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
}
