:root {
  --forest-900: #173d2d;
  --forest-700: #147a50;
  --forest-050: #edf8f2;
  --line: #d5e4db;
  --danger: #a53131;
  --focus: #173d2d;
  --ink: #17251f;
  --muted: #5c6c64;
  --white: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  padding: 20px 14px;
  background: linear-gradient(155deg, var(--forest-050), #f8fbf9 55%, #e4f2ea);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.55;
}

.quote-card {
  width: min(100%, 720px);
  margin: 0 auto;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(23, 61, 45, .12);
}

.wizard-header { padding: 28px 22px 22px; background: var(--forest-900); color: var(--white); }
.eyebrow { margin: 0 0 4px; color: #bce1cd; font-size: .82rem; font-weight: 700; letter-spacing: .06em; }
h1 { margin: 0; font-size: clamp(1.55rem, 6vw, 2rem); line-height: 1.25; }
.progress-copy { display: flex; justify-content: space-between; margin: 22px 0 8px; font-size: .85rem; }
.progress-track { height: 8px; overflow: hidden; background: rgba(255,255,255,.22); border-radius: 999px; }
#progressBar { width: 16.6667%; height: 100%; background: #74d2a2; border-radius: inherit; transition: width .25s ease; }

form > section { min-height: 380px; padding: 28px 22px 16px; }
form > section[hidden], [hidden] { display: none !important; }
h2 { margin: 0; color: var(--forest-900); font-size: 1.35rem; }
h3 { margin: 0 0 8px; font-size: 1rem; }
.step-help { margin: 8px 0 22px; color: var(--muted); }
label, legend { display: block; margin: 18px 0 7px; font-weight: 700; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

input, textarea, button { font: inherit; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: var(--white);
  border: 1px solid #91a99d; border-radius: 9px;
}
textarea { resize: vertical; }
input:disabled { background: #eef1ef; color: var(--muted); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border: 2px solid var(--danger); outline: 2px dashed rgba(165,49,49,.22); }
input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.choice-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.choice-card { position: relative; min-height: 52px; margin: 0; }
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-card span {
  display: flex; align-items: center; min-height: 52px; padding: 11px 14px 11px 42px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--white); font-weight: 650; cursor: pointer;
}
.choice-card span::before { content: ""; position: absolute; left: 15px; width: 16px; height: 16px; border: 2px solid #71887d; border-radius: 50%; }
.choice-card input:checked + span { border: 2px solid var(--forest-700); background: var(--forest-050); box-shadow: inset 4px 0 var(--forest-700); }
.choice-card input:checked + span::before { border: 5px solid var(--forest-700); }
.choice-card input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.choice-card input[aria-invalid="true"] + span { border: 2px solid var(--danger); }

.conditional { margin-top: 18px; padding: 2px 15px 16px; border-left: 4px solid var(--forest-700); background: var(--forest-050); border-radius: 8px; }
.address-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.field-grid { display: grid; gap: 0 16px; }
.field-help, .optional { color: var(--muted); font-size: .88rem; font-weight: 400; }
.field-help { margin: 7px 0 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; margin: 12px 0; cursor: pointer; }
.check-row input { flex: 0 0 auto; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--forest-700); }
.check-row span { font-weight: 600; }
.timing-group, .reply-group { margin-top: 22px; }
.timing-group legend, .reply-group legend { margin-bottom: 10px; }

.review-list { margin: 18px 0 24px; border-top: 1px solid var(--line); }
.review-list div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.review-list dt { color: var(--muted); font-weight: 700; }
.review-list dd { margin: 0; overflow-wrap: anywhere; }
.privacy-box { padding: 16px; background: var(--forest-050); border: 1px solid var(--line); border-radius: 12px; }
.privacy-box p { margin: 6px 0; font-size: .9rem; }
.privacy-box .check-row { margin-bottom: 0; }

.error-message { min-height: 1.5em; margin: 4px 22px 0; color: var(--danger); font-weight: 700; }
.error-message:not(:empty) { padding: 10px 12px; border: 1px solid var(--danger); border-radius: 8px; background: #fff4f4; }
.wizard-footer { display: flex; gap: 10px; padding: 16px 22px 24px; border-top: 1px solid var(--line); }
button { min-height: 44px; padding: 10px 20px; border: 1px solid var(--forest-700); border-radius: 9px; background: var(--forest-700); color: var(--white); font-weight: 750; cursor: pointer; }
button:hover { background: var(--forest-900); }
button:disabled { cursor: wait; opacity: .65; }
button.secondary { background: var(--white); color: var(--forest-900); }
#prevButton { margin-right: auto; }

.success-panel { padding: 56px 24px; text-align: center; }
.success-panel h1 { color: var(--forest-900); }
.success-panel p { max-width: 520px; margin: 16px auto 0; }
.success-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 20px; border: 3px solid var(--forest-700); border-radius: 50%; color: var(--forest-700); font-size: 2rem; font-weight: 900; }
.bot-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 640px) {
  body { padding: 48px 20px; }
  .wizard-header { padding: 34px 36px 26px; }
  form > section { min-height: 430px; padding: 36px 36px 20px; }
  .wizard-footer { padding: 18px 36px 30px; }
  .error-message { margin-inline: 36px; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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