:root {
  color-scheme: light;
  --green: #0f6b4f;
  --green-dark: #0a4c39;
  --green-soft: #e8f3ee;
  --ink: #17231f;
  --muted: #65716c;
  --line: #dce5e0;
  --surface: #ffffff;
  --page: #f4f7f5;
  --danger: #b83232;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--page);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px max(20px, env(safe-area-inset-left));
  color: #fff;
  background: rgba(10, 76, 57, 0.96);
  backdrop-filter: blur(12px);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  font-weight: 800;
}

.topbar div {
  display: grid;
}

.topbar strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.topbar div span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

main,
footer {
  width: min(100%, 760px);
  margin-inline: auto;
}

.intro {
  min-height: 360px;
  padding: 54px 24px 42px;
  color: #fff;
  background: var(--green);
  animation: enter 420ms ease-out both;
}

.eyebrow {
  margin: 0 0 10px;
  color: #97e0c4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 560px;
  margin-bottom: 18px;
  font-size: clamp(30px, 8vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.intro__copy {
  max-width: 560px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
}

.intro__copy span {
  color: #fff;
  font-weight: 800;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 800;
  text-underline-offset: 5px;
}

.calculator,
.results,
.survey,
.privacy {
  scroll-margin-top: 76px;
  padding: 32px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.calculator {
  animation: enter 480ms 80ms ease-out both;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 26px;
}

.section-heading > span {
  flex: 0 0 auto;
  padding-top: 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.section-heading h2,
.survey h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.section-heading p,
.survey p,
.privacy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.field em,
.field small {
  margin-left: 5px;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.field em {
  color: var(--green);
}

.field small {
  color: var(--muted);
}

.money-input,
.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.money-input b {
  position: absolute;
  left: 15px;
  color: var(--muted);
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cdd8d2;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input {
  padding: 12px 14px 12px 38px;
}

select {
  appearance: none;
  padding: 12px 40px 12px 14px;
}

.select-wrap::after {
  position: absolute;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: rotate(45deg) translateY(-3px);
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 107, 79, 0.12);
}

[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fff8f8;
}

.form-note {
  margin: -4px 0 0;
  padding: 12px 14px;
  border-left: 3px solid #88bba8;
  color: var(--muted);
  background: var(--green-soft);
  font-size: 12px;
}

.form-error {
  margin: 0;
  padding: 11px 13px;
  border-radius: 8px;
  color: var(--danger);
  background: #fff0f0;
  font-size: 13px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  transition: transform 120ms ease, background-color 160ms ease, opacity 160ms ease;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

.primary-button,
.survey button {
  padding-inline: 20px;
  color: #fff;
  background: var(--green);
}

.primary-button:hover,
.survey button:hover:not(:disabled) {
  background: var(--green-dark);
}

.plain-button {
  padding-inline: 18px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.results--visible {
  animation: reveal 340ms ease-out both;
}

.result-summary {
  padding: 22px 18px;
  color: #fff;
  background: var(--green-dark);
}

.result-summary p {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.result-summary strong {
  display: block;
  margin-bottom: 12px;
  font-size: 32px;
  line-height: 1.2;
}

.result-summary span {
  font-size: 13px;
}

.result-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 16px 0;
  color: var(--muted);
  font-size: 12px;
}

.result-context b {
  color: var(--ink);
}

.comparison {
  overflow: hidden;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.comparison__head,
.comparison__row {
  display: grid;
  grid-template-columns: minmax(74px, 1.25fr) repeat(3, minmax(62px, 1fr));
  align-items: center;
}

.comparison__head {
  color: var(--muted);
  background: #f7f9f8;
  font-weight: 700;
}

.comparison__head span,
.comparison__row span {
  padding: 11px 5px;
  text-align: right;
}

.comparison__head span:first-child,
.comparison__row span:first-child {
  padding-left: 8px;
  text-align: left;
}

.comparison__row {
  border-top: 1px solid var(--line);
}

.comparison__row--accent {
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 800;
}

.comparison__row--strong {
  font-weight: 800;
}

.comparison__row--total {
  color: var(--green-dark);
  background: #f0f7f3;
  font-weight: 800;
}

details {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

summary {
  min-height: 44px;
  padding-block: 12px;
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 800;
}

details ul {
  margin: 0;
  padding-left: 20px;
}

.survey {
  display: grid;
  gap: 20px;
}

.survey button {
  width: 100%;
}

.survey button:disabled {
  color: #8a9691;
  background: #e4e9e6;
  cursor: not-allowed;
}

.privacy {
  background: #f8faf9;
}

.privacy strong {
  font-size: 15px;
}

footer {
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  color: #7d8984;
  text-align: center;
  font-size: 11px;
}

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

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

@media (min-width: 680px) {
  .topbar {
    padding-inline: calc((100% - 720px) / 2);
  }

  .intro,
  .calculator,
  .results,
  .survey,
  .privacy {
    padding-inline: 48px;
  }

  .calculator form {
    grid-template-columns: 1fr 1fr;
  }

  .field:last-of-type,
  .form-note,
  .form-error,
  .form-actions {
    grid-column: 1 / -1;
  }

  .survey {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .survey button {
    width: auto;
    min-width: 140px;
  }

  .comparison {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
