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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #2d3748;
  background: #ffffff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.screen {
  display: none;
  opacity: 0;
  transition: opacity 300ms ease;
}

.screen.active {
  display: block;
  opacity: 1;
}

/* ========== WELCOME SCREEN ========== */
#welcome {
  min-height: 100vh;
  min-height: 100dvh;
  background: #1a365d;
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

#welcome.active {
  display: flex;
}

.welcome-inner {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.welcome-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 32px;
}

.welcome-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.welcome-subtitle {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 24px;
  opacity: 0.92;
}

.welcome-body {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  margin-bottom: 40px;
  opacity: 0.82;
}

.btn-start {
  display: inline-block;
  background: #319795;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 16px 48px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 200ms ease, transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}

.btn-start:hover {
  background: #2c7a7b;
}

.btn-start:active {
  transform: scale(0.97);
}

/* ========== QUESTIONS SCREEN ========== */
#questions {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  padding: 0;
}

.questions-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

.progress-wrap {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
  padding: 20px 20px 0;
  max-width: 600px;
  margin: 0 auto;
}

.progress-track {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #319795;
  border-radius: 3px;
  transition: width 400ms ease;
  width: 0%;
}

.progress-text {
  font-size: 0.85rem;
  color: #718096;
  margin-top: 8px;
  text-align: center;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #718096;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 12px 0;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}

.back-btn:hover {
  color: #4a5568;
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.back-btn.hidden {
  visibility: hidden;
}

.question-viewport {
  position: relative;
  overflow: hidden;
  min-height: 400px;
  padding-bottom: 40px;
}

.question-slide {
  width: 100%;
  transition: transform 300ms ease, opacity 300ms ease;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.5;
  margin-bottom: 24px;
  padding-top: 8px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #2d3748;
  line-height: 1.5;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.option-card:hover {
  background: #e6fffa;
  border-color: #319795;
}

.option-card.selected {
  background: #319795;
  border-color: #319795;
  color: #ffffff;
}

/* ========== RESULTS SCREEN ========== */
#results {
  background: #ffffff;
  padding: 0 0 40px;
}

.results-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
}

.results-logo {
  width: 36px;
  height: 36px;
  margin: 0 auto 24px;
  display: block;
}

.results-heading {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: #718096;
  margin-bottom: 8px;
}

.results-category {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.results-score-text {
  text-align: center;
  font-size: 1rem;
  color: #718096;
  margin-bottom: 24px;
}

.score-bar-wrap {
  margin-bottom: 32px;
}

.score-bar-track {
  position: relative;
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: visible;
}

.score-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 800ms ease;
}

.score-bar-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: left 800ms ease;
}

.results-description {
  font-size: 1rem;
  line-height: 1.7;
  color: #4a5568;
  margin-bottom: 48px;
  text-align: center;
}

/* Breakdown */
.breakdown-section {
  margin-bottom: 48px;
}

.breakdown-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 4px;
}

.breakdown-sub {
  font-size: 0.95rem;
  color: #718096;
  margin-bottom: 24px;
}

.breakdown-item {
  margin-bottom: 16px;
}

.breakdown-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #2d3748;
  margin-bottom: 6px;
}

.breakdown-bar-track {
  width: 100%;
  height: 10px;
  background: #edf2f7;
  border-radius: 5px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 600ms ease;
}

/* CTA Section */
.cta-section {
  margin-bottom: 40px;
}

.cta-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 4px;
}

.cta-sub {
  font-size: 0.95rem;
  color: #718096;
  margin-bottom: 24px;
}

.cta-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 200ms ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  display: block;
  color: inherit;
}

.cta-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cta-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.cta-card-heading {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
}

.cta-card-sub {
  font-size: 0.95rem;
  color: #718096;
  line-height: 1.5;
}

/* Form inside CTA card 1 */
.form-area {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease, margin-top 400ms ease, opacity 300ms ease;
  opacity: 0;
  margin-top: 0;
}

.form-area.open {
  max-height: 400px;
  opacity: 1;
  margin-top: 20px;
}

.form-field {
  display: block;
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 200ms ease;
  color: #2d3748;
  background: #f7fafc;
  min-height: 48px;
}

.form-field:focus {
  border-color: #319795;
}

.form-field::placeholder {
  color: #a0aec0;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: #319795;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 200ms ease, opacity 200ms ease;
  min-height: 48px;
}

.btn-submit:hover:not(:disabled) {
  background: #2c7a7b;
}

.btn-submit:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

.form-success {
  font-size: 1rem;
  font-weight: 500;
  color: #319795;
  padding: 12px 0 4px;
  line-height: 1.5;
}

.form-error {
  font-size: 0.95rem;
  color: #e53e3e;
  padding: 12px 0 4px;
  line-height: 1.5;
}

.form-error a {
  color: #e53e3e;
  text-decoration: underline;
}

/* Start Over */
.start-over {
  text-align: center;
  margin-top: 32px;
  margin-bottom: 48px;
}

.start-over a {
  color: #319795;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.start-over a:hover {
  text-decoration: underline;
}

/* ========== POWERED BY FOOTER ========== */
.powered-by-footer {
  text-align: center;
  padding: 24px 20px 16px;
  opacity: 0.6;
}

.powered-by-footer a {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #718096;
}

.powered-by-footer img {
  width: 24px;
  height: 24px;
}

.powered-by-text {
  font-size: 0.75rem;
  color: #718096;
}

/* Responsive */
@media (min-width: 640px) {
  .welcome-title {
    font-size: 2.5rem;
  }
  .welcome-subtitle {
    font-size: 1.2rem;
  }
  .questions-container {
    padding: 0 24px;
  }
  .progress-wrap {
    padding: 24px 24px 0;
  }
}

@media (max-width: 380px) {
  .welcome-title {
    font-size: 1.65rem;
  }
  .question-text {
    font-size: 1.1rem;
  }
  .results-category {
    font-size: 1.5rem;
  }
}