*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #2d3748;
  background: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.screen { display: none; }
.screen.active { display: block; }

/* WELCOME SCREEN */
.welcome-screen {
  min-height: 100vh;
  min-height: 100dvh;
  background: #1a365d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}
.welcome-inner {
  max-width: 600px;
  width: 100%;
  text-align: center;
}
.welcome-logo { width: 48px; height: 48px; margin: 0 auto 32px; }
.welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}
.welcome-subtitle {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 24px;
  line-height: 1.4;
}
.welcome-body {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.85;
  margin-bottom: 40px;
  line-height: 1.7;
}
.btn-start {
  display: inline-block;
  background: #319795;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 16px 48px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.15s ease;
  min-height: 56px;
  touch-action: manipulation;
}
.btn-start:hover { background: #38b2ac; }
.btn-start:active { transform: scale(0.97); }

/* QUESTION SCREEN */
.question-screen {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
}
.question-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.progress-wrapper {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
  padding: 16px 0 0;
}
.progress-track {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #319795;
  border-radius: 3px;
  transition: width 0.4s 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: 8px 4px;
  margin-top: 4px;
  min-height: 48px;
  touch-action: manipulation;
  transition: color 0.2s;
}
.back-btn:hover { color: #2d3748; }
.back-btn.hidden { visibility: hidden; }
.question-area {
  position: relative;
  margin-top: 16px;
  overflow: hidden;
}
.question-slide {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.question-slide.slide-out-left {
  transform: translateX(-30px);
  opacity: 0;
  position: absolute;
  width: 100%;
}
.question-slide.slide-out-right {
  transform: translateX(30px);
  opacity: 0;
  position: absolute;
  width: 100%;
}
.question-slide.slide-in {
  transform: translateX(0);
  opacity: 1;
}
.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.4;
  margin-bottom: 24px;
}
.options-list { list-style: none; 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;
  cursor: pointer;
  min-height: 56px;
  display: flex;
  align-items: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  touch-action: manipulation;
  line-height: 1.5;
}
.option-card:hover {
  background: #e6fffa;
  border-color: #319795;
}
.option-card.selected {
  background: #319795;
  border-color: #319795;
  color: #ffffff;
}

/* RESULTS SCREEN */
.results-screen {
  background: #ffffff;
}
.results-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}
.results-logo { width: 36px; height: 36px; margin: 0 auto 24px; display: block; }
.results-heading {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
}
.results-category {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.results-score-text {
  text-align: center;
  font-size: 0.95rem;
  color: #718096;
  margin-bottom: 24px;
}
.score-bar-container {
  width: 100%;
  margin-bottom: 28px;
}
.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 0.8s ease;
}
.score-bar-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: left 0.8s ease;
}
.results-description {
  font-size: 1rem;
  color: #2d3748;
  line-height: 1.7;
  margin-bottom: 40px;
  text-align: center;
}

/* BREAKDOWN */
.breakdown-section { margin-bottom: 48px; }
.breakdown-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 6px;
}
.breakdown-subtext {
  font-size: 0.95rem;
  color: #718096;
  margin-bottom: 24px;
  line-height: 1.5;
}
.breakdown-item {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}
.breakdown-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #2d3748;
  min-width: 110px;
  flex-shrink: 0;
  text-align: right;
}
.breakdown-bar-track {
  flex: 1;
  height: 12px;
  background: #f7fafc;
  border-radius: 6px;
  overflow: hidden;
}
.breakdown-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}

/* CTA SECTION */
.cta-section { margin-bottom: 40px; }
.cta-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 6px;
}
.cta-subtext {
  font-size: 0.95rem;
  color: #718096;
  margin-bottom: 24px;
  line-height: 1.5;
}
.cta-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.cta-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: #cbd5e0;
}
.cta-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cta-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.cta-card-text { flex: 1; }
.cta-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
}
.cta-card-desc {
  font-size: 0.9rem;
  color: #718096;
  line-height: 1.5;
}

/* INLINE FORM */
.form-area {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}
.form-area.open {
  max-height: 300px;
  opacity: 1;
  margin-top: 16px;
}
.form-area form { display: flex; flex-direction: column; gap: 12px; }
.form-area input {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  min-height: 48px;
}
.form-area input:focus { border-color: #319795; }
.btn-submit {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 24px;
  background: #319795;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.2s, opacity 0.2s;
  touch-action: manipulation;
}
.btn-submit:hover { background: #38b2ac; }
.btn-submit:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}
.form-success {
  color: #319795;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 0;
  line-height: 1.5;
}
.form-error {
  color: #e53e3e;
  font-size: 0.9rem;
  line-height: 1.5;
}
.form-error a { color: #e53e3e; }

/* RETAKE */
.retake-link {
  display: block;
  text-align: center;
  color: #319795;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  padding: 16px;
  margin-top: 16px;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  min-height: 48px;
  touch-action: manipulation;
  transition: color 0.2s;
}
.retake-link:hover { color: #38b2ac; 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;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease forwards; }

@media (min-width: 640px) {
  .welcome-title { font-size: 2.1rem; }
  .welcome-subtitle { font-size: 1.2rem; }
}