@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #13201b;
  --muted: #607067;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --line: #dfe6df;
  --green: #0f8f64;
  --green-dark: #076848;
  --mint: #d9f4e7;
  --blue: #315d8f;
  --gold: #b7791f;
  --red: #c2413a;
  --shadow: 0 18px 45px rgba(24, 45, 35, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans Thai", "Inter", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(217, 244, 231, 0.85), rgba(251, 250, 245, 0.98) 34%, rgba(230, 237, 246, 0.92)),
    var(--paper);
  line-height: 1.65;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-family: "Inter", sans-serif;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.time-pill,
.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 6px 12px;
}

.screen {
  display: none;
  padding: 32px 0 64px;
}

.screen.active {
  display: block;
  animation: enter 360ms ease both;
}

.welcome-screen {
  min-height: calc(100vh - 98px);
  display: none;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 48px;
  align-items: center;
}

.welcome-screen.active {
  display: grid;
}

.hero-copy h1 {
  max-width: 780px;
  margin: 18px 0;
  font-size: clamp(2rem, 5vw, 4.65rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.lead,
.result-header p,
.cta-panel p,
.form-intro p,
.thank-card p {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.lead {
  max-width: 720px;
}

.hero-actions,
.quiz-actions,
.thank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 10px 24px rgba(15, 143, 100, 0.22);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.checkup-preview,
.question-panel,
.progress-panel,
.score-card,
.priority-card,
.breakdown-item,
.insight-card,
.cta-panel,
.lead-form,
.thank-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.checkup-preview {
  padding: 24px;
}

.preview-score {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 18px;
}

.preview-score span {
  color: var(--muted);
  font-weight: 700;
}

.preview-score strong {
  color: var(--green-dark);
  font-family: "Inter", sans-serif;
  font-size: 3.2rem;
  line-height: 0.9;
}

.checkup-preview ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.quiz-screen,
.result-screen,
.lead-screen,
.thank-screen {
  max-width: 820px;
  margin: 0 auto;
}

.progress-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: center;
  padding: 20px;
  margin-bottom: 18px;
}

.progress-panel h2 {
  margin: 2px 0 0;
  font-size: 1.18rem;
}

.progress-label,
.question-kicker {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.progress-track,
.meter {
  height: 10px;
  border-radius: 999px;
  background: #e8eee9;
  overflow: hidden;
}

.progress-fill,
.meter div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 280ms ease;
}

.question-panel {
  padding: clamp(20px, 4vw, 34px);
}

.question-panel h3 {
  margin: 8px 0 24px;
  font-size: clamp(1.24rem, 3vw, 1.8rem);
  line-height: 1.35;
}

.options-list {
  display: grid;
  gap: 12px;
}

.option-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 16px;
  cursor: pointer;
}

.option-button:hover,
.option-button.selected {
  border-color: rgba(15, 143, 100, 0.52);
  background: var(--mint);
}

.option-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #edf3ef;
  color: var(--green-dark);
  font-family: "Inter", sans-serif;
  font-weight: 800;
}

.option-button.selected .option-index {
  color: #fff;
  background: var(--green);
}

.quiz-actions {
  justify-content: space-between;
}

.result-header {
  text-align: center;
  margin-bottom: 24px;
}

.result-header .eyebrow {
  margin: 0 auto;
}

.result-header h2 {
  margin: 14px auto 10px;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.18;
}

.score-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.score-card,
.priority-card {
  padding: 22px;
}

.score-card span,
.priority-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 8px;
}

.score-card strong {
  font-family: "Inter", sans-serif;
  color: var(--green-dark);
  font-size: 4.4rem;
  line-height: 0.95;
}

.score-card small {
  color: var(--muted);
  font-weight: 800;
}

.priority-card strong {
  display: block;
  font-size: clamp(1.3rem, 3vw, 2.15rem);
  line-height: 1.28;
}

.breakdown-section,
.insight-section {
  margin-top: 28px;
}

.breakdown-section h3,
.insight-section h3,
.cta-panel h3 {
  margin: 0 0 14px;
  font-size: 1.35rem;
}

.breakdown-list,
.insight-list {
  display: grid;
  gap: 12px;
}

.breakdown-item {
  padding: 18px;
}

.breakdown-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

.breakdown-copy span {
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-weight: 800;
}

.breakdown-item.low .meter div {
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.breakdown-item.mid .meter div {
  background: linear-gradient(90deg, var(--gold), var(--blue));
}

.breakdown-item p {
  margin: 12px 0 0;
  color: var(--muted);
}

.insight-list {
  grid-template-columns: repeat(3, 1fr);
}

.insight-card {
  padding: 18px;
}

.insight-card span {
  display: inline-block;
  color: var(--green-dark);
  font-weight: 900;
  margin-bottom: 8px;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
}

.cta-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-top: 30px;
  padding: clamp(20px, 4vw, 30px);
  background: linear-gradient(135deg, #ffffff, #eef8f2);
}

.cta-panel p {
  margin-bottom: 0;
}

.form-intro {
  text-align: center;
  margin-bottom: 22px;
}

.form-intro .eyebrow {
  margin: 0 auto;
}

.form-intro h2,
.thank-card h2 {
  margin: 14px 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.2;
}

.lead-form {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 4vw, 32px);
}

.lead-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.lead-form input,
.lead-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

.lead-form input:focus,
.lead-form select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 143, 100, 0.12);
}

.field-error {
  min-height: 18px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 700;
}

.thank-screen {
  min-height: calc(100vh - 120px);
  align-content: center;
}

.thank-card {
  padding: clamp(24px, 5vw, 44px);
  text-align: center;
}

.thank-actions {
  justify-content: center;
}

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 1080px);
  }

  .topbar {
    align-items: flex-start;
  }

  .time-pill {
    display: none;
  }

  .welcome-screen.active,
  .score-layout,
  .cta-panel,
  .progress-panel {
    grid-template-columns: 1fr;
  }

  .welcome-screen {
    gap: 24px;
    align-items: start;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 13vw, 3.3rem);
  }

  .progress-panel {
    gap: 12px;
  }

  .insight-list {
    grid-template-columns: 1fr;
  }

  .quiz-actions .btn,
  .hero-actions .btn,
  .cta-panel .btn {
    width: 100%;
  }

  .quiz-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .brand strong {
    font-size: 0.92rem;
  }

  .screen {
    padding-top: 16px;
  }

  .option-button {
    grid-template-columns: 1fr;
  }

  .score-card strong {
    font-size: 3.7rem;
  }
}
