:root {
  color-scheme: light;
  --ink: #223331;
  --muted: #667471;
  --line: #d8e4e0;
  --paper: #f5faf7;
  --panel: #ffffff;
  --accent: #4f9f6c;
  --accent-dark: #2f7450;
  --gold: #c69744;
  --danger: #b84d3c;
  --shadow: 0 22px 60px rgba(47, 116, 80, 0.13);
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(79, 159, 108, 0.24), transparent 330px),
    linear-gradient(180deg, #fbfefc 0%, var(--paper) 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.survey-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  width: min(920px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.eyebrow,
.step-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  letter-spacing: 0;
}

.progress-wrap {
  display: grid;
  gap: 8px;
  min-width: 190px;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #dfeae3;
}

#progressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.22s ease;
}

.survey-card {
  position: relative;
  display: grid;
  align-content: center;
  min-height: min(720px, calc(100vh - 135px));
  padding: clamp(22px, 5vw, 52px);
  border: 1px solid rgba(47, 116, 80, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.step {
  display: none;
  animation: rise 0.22s ease;
}

.step.active {
  display: block;
}

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

.step h2 {
  max-width: 790px;
  margin-bottom: 16px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.lead,
.hint {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 28px;
  padding: 0;
  color: var(--accent-dark);
  font-weight: 900;
  list-style: none;
}

.check-list li::before {
  margin-right: 8px;
  content: "✓";
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.option-grid button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfb;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.5;
  padding: 14px 16px;
  text-align: left;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.option-grid button:hover {
  border-color: rgba(79, 159, 108, 0.8);
  background: #f1faf4;
  transform: translateY(-1px);
}

.option-grid button.selected {
  border-color: var(--accent-dark);
  background: #eaf7ef;
  box-shadow: inset 0 0 0 2px rgba(47, 116, 80, 0.18);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: #34413f;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(79, 159, 108, 0.2);
  border-color: var(--accent);
}

.notes {
  margin-top: 16px;
}

.name-field {
  max-width: 540px;
  margin-top: 22px;
}

.profile-label {
  margin: 26px 0 -10px;
  color: var(--accent-dark);
  font-weight: 900;
}

.profile-options,
.intent-grid {
  margin-top: 18px;
}

.score-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 14px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #eaf7ef;
  color: var(--accent-dark);
  font-weight: 900;
}

.score-pill span {
  font-size: 1.4rem;
}

.submit-status {
  min-height: 24px;
  color: var(--accent-dark);
  font-weight: 900;
}

.submit-status.error {
  color: var(--danger);
}

.impact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 680px;
  margin: 18px 0 24px;
}

.impact-list span {
  padding: 12px 14px;
  border: 1px solid rgba(47, 116, 80, 0.2);
  border-radius: 8px;
  background: #f2faf5;
  color: var(--accent-dark);
  font-weight: 900;
}

.report-box {
  max-width: 760px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(198, 151, 68, 0.35);
  border-radius: 10px;
  background: #fffdf7;
}

.report-box h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.report-box p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.survey-nav,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.survey-nav {
  justify-content: space-between;
}

.primary,
.secondary,
.ghost,
.line-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 900;
  padding: 0 18px;
  text-decoration: none;
}

.primary {
  border: 0;
  background: var(--accent-dark);
  color: #fff;
}

.primary:hover {
  background: #255e41;
}

.secondary {
  border: 0;
  background: var(--gold);
  color: #fff;
}

.line-cta {
  border: 0;
  background: #06c755;
  color: #fff;
}

.line-cta:hover {
  background: #05a947;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

@media (max-width: 760px) {
  .survey-shell {
    width: min(100% - 20px, 920px);
    padding: 16px 0;
  }

  .topbar {
    display: grid;
  }

  .progress-wrap {
    min-width: 0;
    text-align: left;
  }

  .survey-card {
    min-height: calc(100vh - 132px);
    padding: 20px;
    border-radius: 10px;
  }

  .step h2 {
    font-size: clamp(1.85rem, 10vw, 3rem);
  }

  .option-grid,
  .profile-grid,
  .impact-list {
    grid-template-columns: 1fr;
  }

  .survey-nav,
  .result-actions {
    display: grid;
  }

  .primary,
  .secondary,
  .ghost,
  .line-cta {
    width: 100%;
  }
}
