/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #373f4c;
  --gray-dark: #515c62;
  --sage: #bac7c7;
  --sage-light: #e8f0f0;
  --sage-dark: #8fa3a3;
  --blush: #ddbeaf;
  --charcoal: #373f4c;
  --gray-600: #515c62;
  --gray-400: #a8a8a8;
  --gray-200: #e5e5e5;
  --gray-100: #f7f7f5;
  --white: #ffffff;
  --font-heading: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(55,63,76,0.06);
  --shadow-lg: 0 4px 24px rgba(55,63,76,0.10);
}

html { font-size: 16px; }
body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--charcoal);
  background: var(--gray-100);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.screen {
  display: none;
  min-height: 100dvh;
  padding: 2rem 1rem;
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; }

.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* === INTRO === */
#screen-intro .container {
  display: flex;
  flex-direction: column;
}

.logo-row {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 0;
  order: 1;
}
.logo {
  height: 32px;
  opacity: 0.6;
}

.intro-content { text-align: center; order: 0; }
.intro-content h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 3.5rem;
  line-height: 1.1;
  color: var(--navy);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--gray-600);
  margin-bottom: 2rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.micro {
  font-size: 0.875rem;
  font-style: italic;
  color: var(--gray-600);
  margin-top: 1rem;
  letter-spacing: 0.02em;
}

/* === PROGRESS BAR === */
.progress-bar {
  height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--sage);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.step-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0.75rem;
  font-weight: 300;
  font-style: italic;
}

/* === QUESTIONS === */
h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.625rem;
  line-height: 1.3;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.helper {
  font-size: 0.9375rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* === CHIPS === */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.chip {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--charcoal);
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { border-color: var(--sage-dark); color: var(--navy); }
.chip.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.custom-input-row { margin-bottom: 1.5rem; }

/* === INPUTS === */
.input-text, .input-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}
.input-text:focus, .input-textarea:focus {
  border-color: var(--sage-dark);
}
.input-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}
.input-textarea::placeholder, .input-text::placeholder {
  color: var(--gray-400);
  font-weight: 300;
}
.optional-label {
  font-size: 0.8125rem;
  color: var(--gray-400);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

/* === NUDGES === */
.nudge {
  font-size: 0.8125rem;
  color: var(--gray-400);
  line-height: 1.5;
  margin-top: 0.5rem;
  min-height: 1.5em;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.nudge.visible {
  opacity: 1;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: var(--gray-dark); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  color: var(--gray-600);
  font-weight: 300;
}
.btn-secondary:hover { color: var(--charcoal); }
.btn-full { width: 100%; }

.btn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

/* === EMAIL SCREEN === */
.email-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.email-card h2 { margin-bottom: 0.75rem; }
.email-card p {
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.email-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.email-form .input-text { text-align: center; }

/* === LOADING === */
.loading-content { text-align: center; }
.loading-content h2 { margin-bottom: 0.5rem; }
.loading-sub { color: var(--gray-600); }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--sage-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === RESULTS === */
.results-container { max-width: 640px; }
.results-container h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}
.results-intro {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  position: relative;
}
.result-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.formula-tag {
  font-size: 0.6875rem;
  font-weight: 400;
  background: var(--sage-light);
  color: var(--gray-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.result-text {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--charcoal);
  font-weight: 300;
}

.btn-copy {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--gray-100);
  border: none;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-copy:hover {
  background: var(--sage-light);
  color: var(--navy);
}
.btn-copy.copied {
  background: var(--navy);
  color: var(--white);
}

/* === RETRY ROW === */
.retry-row {
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* === CTA CARD === */
.cta-card {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
}
.cta-card h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.375rem;
  color: var(--white);
  margin-bottom: 0.75rem;
}
.cta-card p {
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 300;
}
.cta-card .btn-primary {
  background: var(--sage);
  color: var(--navy);
  font-weight: 500;
}
.cta-card .btn-primary:hover {
  background: var(--sage-dark);
  color: var(--white);
}

/* === ERROR === */
.error-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.error-card h2 { margin-bottom: 0.75rem; }
.error-card p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .screen { padding: 1.5rem 1rem; }
  .intro-content h1 { font-size: 2.5rem; }
  .intro-content .btn-primary { font-size: 1.125rem; padding: 1rem 2.5rem; }
  h2 { font-size: 1.375rem; }
  .email-card { padding: 1.75rem 1.25rem; }
  .result-card { padding: 1.25rem; }
  .result-text { font-size: 1rem; }
}
