:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --surface: #ffffff;
  --text: #18201d;
  --muted: #65716a;
  --line: #dfe6df;
  --accent: #167768;
  --accent-dark: #0f5c51;
  --accent-soft: #e0f1ec;
  --warm: #a75d22;
  --warm-soft: #fff0df;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(20, 40, 34, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 18px 14px 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 4px 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--warm-soft);
  color: var(--warm);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.progress {
  display: flex;
  align-items: center;
  padding: 8px 4px 16px;
}

.progress-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8ece7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-dot.active,
.progress-dot.done {
  background: var(--accent);
  color: #fff;
}

.progress-line {
  flex: 1;
  height: 3px;
  margin: 0 6px;
  border-radius: 999px;
  background: #e8ece7;
}

.progress-line.done {
  background: var(--accent);
}

.form,
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-step {
  display: none;
  padding: 18px;
}

.form-step.active {
  display: block;
}

.section-title {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  font-size: 20px;
  line-height: 1.25;
}

.section-title p,
.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field {
  display: block;
  margin-top: 16px;
}

.field > span,
legend {
  display: block;
  margin-bottom: 8px;
  color: #29332f;
  font-size: 15px;
  font-weight: 800;
}

fieldset {
  padding: 0;
  border: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cdd8d1;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 119, 104, 0.14);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.province-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid label {
  min-width: 0;
}

.choice-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-grid span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #cdd8d1;
  border-radius: 8px;
  background: #fbfcfb;
  color: #26302c;
  font-size: 14px;
  font-weight: 750;
  text-align: center;
  line-height: 1.2;
}

.choice-grid input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.switch-list {
  display: grid;
  gap: 10px;
}

.switch-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  font-weight: 750;
}

.switch-list input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  font-weight: 850;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.primary-btn:disabled {
  background: #9ab5ae;
}

.secondary-btn {
  background: #e9eee9;
  color: #26302c;
}

.ghost-btn {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent-dark);
}

.hidden {
  display: none !important;
}

.result {
  margin-top: 14px;
  padding: 18px;
}

.result h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.result .message {
  color: var(--muted);
  line-height: 1.55;
}

.result .message.error {
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 520px) {
  .shell {
    padding: 12px 10px 26px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  h1 {
    font-size: 24px;
  }

  .field-row,
  .choice-grid,
  .province-grid {
    grid-template-columns: 1fr 1fr;
  }

  .actions {
    background: #fff;
  }
}
