:root {
  --font-display: "Noto Serif SC", "Songti SC", STSong, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  --bg: #f8f5ed;
  --surface: #fffdf8;
  --surface-soft: #f2efe6;
  --surface-sage: #e3e9df;
  --surface-yellow: #f6edcf;
  --surface-lavender: #ece7f1;
  --surface-peach: #f5e5db;
  --text: #383a36;
  --text-soft: #6d7068;
  --text-faint: #91938d;
  --primary: #6f7e68;
  --primary-strong: #5d6b57;
  --primary-soft: #dfe7db;
  --border: #dcd8ce;
  --danger: #a95649;
  --danger-soft: #fbebe7;
  --focus: #9da990;

  --shadow-sm: 0 10px 28px rgba(70, 73, 63, 0.08);
  --shadow-md: 0 24px 60px rgba(70, 73, 63, 0.12);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  color-scheme: light;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(246, 237, 207, .72), transparent 32%),
    radial-gradient(circle at 90% 12%, rgba(236, 231, 241, .6), transparent 30%),
    var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header,
.site-footer {
  width: min(100% - 32px, 1040px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  color: var(--text-soft);
  font-size: 13px;
}

.site-header { min-height: 68px; }
.site-footer {
  min-height: 84px;
  padding: 12px 0;
  border-top: 1px solid rgba(220,216,206,.72);
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.site-footer__meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.icp-link {
  color: var(--text-soft);
  text-decoration: none;
}

.icp-link:hover,
.icp-link:focus-visible { text-decoration: underline; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 18px;
}

.draft-status { white-space: nowrap; }

.app {
  width: min(100% - 32px, 1040px);
  margin-inline: auto;
  padding: var(--space-8) 0 var(--space-16);
}

.screen { width: 100%; }
.screen[hidden] { display: none !important; }

.welcome-layout {
  min-height: min(700px, calc(100vh - 180px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: clamp(40px, 7vw, 88px);
}

.welcome-copy { max-width: 520px; }

.eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

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

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

h1 {
  margin-bottom: var(--space-5);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.26;
}

h2 {
  margin-bottom: var(--space-3);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.32;
}

.lead {
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.85;
}

.art-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.art-card--hero {
  transform: rotate(-1.2deg);
  padding: 10px;
}

.art-card--hero img,
.art-card--success img {
  width: 100%;
  border-radius: calc(var(--radius-lg) - 8px);
}

.soft-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: var(--space-7) 0;
  padding: var(--space-4);
  border: 1px solid rgba(111,126,104,.14);
  border-radius: var(--radius-md);
  background: var(--surface-sage);
  color: var(--text-soft);
}

.soft-note strong { display: block; color: var(--text); margin-bottom: 2px; }
.soft-note p { margin: 0; }
.soft-note__icon { color: var(--primary-strong); font-size: 18px; line-height: 1.4; }
.soft-note--center { justify-content: center; text-align: center; }

.button {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0 24px;
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .text-button:focus-visible, .icon-button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible, .choice:focus-visible {
  outline: 3px solid rgba(157,169,144,.36);
  outline-offset: 2px;
}

.button--primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(111,126,104,.22);
}

.button--primary:hover { background: var(--primary-strong); }

.button--secondary {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.button--wide { width: 100%; }

.text-button {
  display: block;
  margin: var(--space-4) auto 0;
  border: 0;
  padding: 4px 8px;
  color: var(--text-soft);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(109,112,104,.34);
  text-underline-offset: 4px;
}

.form-card,
.success-card {
  width: min(100%, 690px);
  margin-inline: auto;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgba(220,216,206,.8);
  border-radius: var(--radius-lg);
  background: rgba(255,253,248,.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.progress-wrap { margin-bottom: var(--space-10); }
.progress-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); color: var(--text-soft); font-size: 13px; font-weight: 650; }
.progress-track { height: 5px; overflow: hidden; border-radius: var(--radius-pill); background: var(--surface-soft); }
.progress-bar { width: 14.285%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #9eaa92); transition: width .28s ease; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--text); background: var(--surface); }

.step-header { margin-bottom: var(--space-8); }
.step-header > p:last-child { max-width: 56ch; margin-bottom: 0; color: var(--text-soft); }

.fields { display: grid; gap: var(--space-8); }
.field-group { display: grid; gap: var(--space-3); }
.field-label { display: flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 720; color: var(--text); }
.field-required { color: var(--danger); font-size: 12px; }
.field-optional { color: var(--text-faint); font-size: 12px; font-weight: 500; }
.field-help { margin: -4px 0 0; color: var(--text-soft); font-size: 13px; line-height: 1.75; }
.field-error { display: none; margin: 0; color: var(--danger); font-size: 13px; }
.field-group.has-error .field-error { display: block; }
.field-group.has-error input,
.field-group.has-error textarea,
.field-group.has-error select { border-color: var(--danger); background: var(--danger-soft); }

.text-input,
.textarea,
.select-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.text-input,
.select-input { min-height: 52px; padding: 0 16px; }
.textarea { min-height: 132px; padding: 14px 16px; resize: vertical; line-height: 1.75; }
.textarea--large { min-height: 168px; }
.text-input::placeholder, .textarea::placeholder { color: #aaa9a3; }

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

.choice {
  position: relative;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  line-height: 1.5;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.choice:hover { border-color: #bec6b9; transform: translateY(-1px); }
.choice.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.choice__indicator { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid #aaa; border-radius: 50%; background: #fff; }
.choice[data-control="checkbox"] .choice__indicator { border-radius: 6px; }
.choice.is-selected .choice__indicator { border-color: var(--primary); background: var(--primary); color: #fff; }
.choice.is-selected .choice__indicator::after { content: "✓"; font-size: 13px; font-weight: 800; }

.consent-list { display: grid; gap: var(--space-3); }
.consent-card { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; background: var(--surface-soft); }
.consent-card input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: 0 0 auto; }
.consent-card span { color: var(--text-soft); font-size: 13px; line-height: 1.75; }

.form-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; margin-top: var(--space-10); }

.inline-art { margin-top: var(--space-2); padding: 8px; border-radius: var(--radius-md); background: #f1eee6; }
.inline-art img { width: 100%; border-radius: calc(var(--radius-md) - 6px); }

.success-card { text-align: center; }
.success-check { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto var(--space-5); border-radius: 50%; color: #fff; background: var(--primary); font-size: 34px; box-shadow: 0 14px 30px rgba(111,126,104,.22); }
.success-card .lead { max-width: 48ch; margin-inline: auto; }
.art-card--success { margin: var(--space-7) auto; max-width: 520px; padding: 8px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(56,58,54,.08);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  color: #fff;
  background: rgba(56,58,54,.92);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .welcome-layout { grid-template-columns: 1fr; min-height: auto; gap: var(--space-8); }
  .art-card--hero { max-width: 620px; margin-inline: auto; }
  .welcome-copy { max-width: 620px; margin-inline: auto; }
}

@media (max-width: 620px) {
  .site-header, .site-footer, .app { width: min(100% - 24px, 1040px); }
  .site-header { min-height: 58px; }
  .site-footer { align-items: center; gap: 7px; padding: 14px 0; }
  .site-footer__meta { flex-direction: column; justify-content: center; gap: 0; }
  .draft-status { font-size: 11px; }
  .app { padding-top: var(--space-4); padding-bottom: var(--space-10); }
  .welcome-layout { gap: var(--space-6); }
  .welcome-copy { text-align: left; }
  h1 { font-size: 34px; }
  h2 { font-size: 30px; }
  .lead { font-size: 16px; }
  .form-card, .success-card { padding: 24px 18px; border-radius: 22px; }
  .progress-wrap { margin-bottom: var(--space-8); }
  .step-header { margin-bottom: var(--space-7); }
  .fields { gap: var(--space-7); }
  .choice-grid { grid-template-columns: 1fr; }
  .form-actions { margin-top: var(--space-8); }
  .button { min-height: 50px; padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


.choice__content { display: grid; gap: 3px; min-width: 0; }
.choice__content strong { font-size: 14px; font-weight: 680; }
.choice__content small { color: var(--text-soft); font-size: 12px; line-height: 1.65; }
.choice--service { align-items: flex-start; min-height: 78px; padding: 15px 16px; }
.choice--service .choice__indicator { margin-top: 2px; }
.choice--service .choice__content strong { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 16px; }
.welcome-title-sub { display: inline-block; margin-top: 8px; color: var(--text-soft); font-family: inherit; font-size: .52em; font-weight: 520; line-height: 1.5; }
