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

:root {
  --navy: #1a365d;
  --navy-light: #2c5282;
  --red: #e53e3e;
  --teal: #319795;
  --teal-light: #38b2ac;
  --teal-bg: #e6fffa;
  --text: #2d3748;
  --text-light: #718096;
  --bg: #ffffff;
  --bg-alt: #f7fafc;
  --bg-dark: #1a202c;
  --border: #e2e8f0;
  --orange: #dd6b20;

  --radius: 8px;
  --transition: 300ms ease;
  --max-width: 600px;
}

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

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   SCREENS
   ============================================ */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ============================================
   SCREEN 1 — WELCOME
   ============================================ */
.screen-welcome {
  background-color: var(--navy);
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.welcome-content {
  max-width: var(--max-width);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.welcome-logo {
  display: block;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.welcome-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.welcome-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.welcome-body {
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  text-align: left;
}

.btn-primary {
  display: inline-block;
  background-color: var(--teal);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 16px 36px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 56px;
  transition: background-color var(--transition), transform var(--transition);
  margin-top: 8px;
  width: 100%;
  max-width: 360px;
}

.btn-primary:hover {
  background-color: var(--teal-light);
  transform: translateY(-1px);
}

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

/* ============================================
   SCREEN 2 — QUESTIONS
   ============================================ */
.screen-questions {
  background-color: var(--bg);
  flex-direction: column;
}

.questions-header {
  width: 100%;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Progress Bar */
.progress-bar-track {
  width: 100%;
  height: 5px;
  background-color: var(--border);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--teal);
  width: 0%;
  transition: width var(--transition);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 4px;
}

.btn-back {
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
  visibility: hidden;
}

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

.btn-back:hover {
  color: var(--text);
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
  margin-left: auto;
}

/* Question Area */
.question-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding: 0;
}

.question-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.question-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Option Cards */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  width: 100%;
  min-height: 56px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
  display: flex;
  align-items: center;
}

.option-card:hover {
  background-color: var(--teal-bg);
  border-color: var(--teal);
}

.option-card.selected {
  background-color: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

/* Slide Transitions */
.question-inner.slide-out-left {
  animation: slideOutLeft 300ms ease forwards;
}

.question-inner.slide-out-right {
  animation: slideOutRight 300ms ease forwards;
}

.question-inner.slide-in-right {
  animation: slideInRight 300ms ease forwards;
}

.question-inner.slide-in-left {
  animation: slideInLeft 300ms ease forwards;
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   SCREEN 3 — RESULTS
   ============================================ */
.screen-results {
  background-color: var(--bg);
}

.results-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 20px 40px;
  width: 100%;
}

/* Results Top */
.results-top {
  text-align: center;
  margin-bottom: 40px;
}

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

.results-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.result-category {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.result-score {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 16px;
}

/* Score Bar */
.score-bar-track {
  position: relative;
  width: 100%;
  height: 8px;
  background-color: var(--border);
  border-radius: 999px;
  margin: 0 auto 20px;
  max-width: 420px;
}

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

.score-bar-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--border);
  transition: left 600ms ease;
}

.result-description {
  font-size: 0.975rem;
  color: var(--text);
  line-height: 1.7;
  text-align: left;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 20px;
}

/* ============================================
   BREAKDOWN SECTION
   ============================================ */
.breakdown-section {
  margin-bottom: 40px;
}

.breakdown-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.breakdown-subtext {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.breakdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.breakdown-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  width: 150px;
  flex-shrink: 0;
  line-height: 1.3;
}

.breakdown-bar-track {
  flex: 1;
  height: 10px;
  background-color: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

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

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

.cta-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.cta-subtext {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.cta-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}

.cta-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.cta-card-link {
  display: block;
}

.cta-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cta-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.cta-card-text {
  flex: 1;
}

.cta-card-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.cta-card-subtext {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Form inside Card 1 */
.cta-form-wrapper {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.cta-form-wrapper.open {
  display: block;
}

.results-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  min-height: 48px;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--teal);
}

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

.btn-submit:hover:not(:disabled) {
  background-color: var(--teal-light);
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-message {
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 10px;
  line-height: 1.5;
}

.form-message.success {
  color: var(--teal);
}

.form-message.error {
  color: var(--red);
}

/* Start Over */
.start-over-wrap {
  text-align: center;
  margin-top: 8px;
}

.btn-restart {
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--teal);
  cursor: pointer;
  padding: 8px 0;
  text-decoration: underline;
  transition: color var(--transition);
}

.btn-restart:hover {
  color: var(--teal-light);
}

/* ============================================
   FOOTER — POWERED BY
   ============================================ */
.powered-by {
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.powered-by:hover {
  opacity: 1;
}

.powered-by-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
}

.powered-by-link img {
  width: 16px;
  height: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 600px) {
  .welcome-title {
    font-size: 2.4rem;
  }

  .question-inner {
    padding: 36px 32px 48px;
  }

  .results-content {
    padding: 48px 32px 48px;
  }

  .breakdown-label {
    width: 180px;
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  .welcome-title {
    font-size: 1.65rem;
  }

  .breakdown-label {
    width: 120px;
    font-size: 0.75rem;
  }
}