:root {
  --primary: #05141f;
  --primary-dark: #0a2233;
  --secondary: #111111;
  --bg: #f2f2f2;
  --white: #ffffff;
  --text-muted: #6b7280;
  --border: #d4d4d4;
  --border-light: #e8e8e8;
  --radius-btn: 8px;
  --radius-card: 12px;
  --radius-pill: 999px;
  --shadow-card: none;
  --transition: 250ms ease;
  --font: "Noto Sans KR", -apple-system, sans-serif;
  --max-w: 480px;
  --header-h: 76px;
  --hero-stage-h: 220px;
  --hero-meta-h: 92px;
  --hero-compact-h: 108px;
  --hero-sticky-h: calc(var(--hero-stage-h) + var(--hero-meta-h));
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: auto;
}

@media (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--secondary);
  min-height: 100vh;
  line-height: 1.5;
}

button, input {
  font: inherit;
}

.app {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* 헤더 + 진행률 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border-light);
}

.logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  text-decoration: none;
  display: block;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.step-indicator__text {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.step-indicator__text strong {
  color: var(--secondary);
  font-weight: 700;
}

.step-indicator__bar {
  height: 3px;
  background: var(--border-light);
  border-radius: 0;
  overflow: hidden;
}

.step-indicator__fill {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 0;
  transition: width var(--transition);
}

/* 스텝 컨테이너 */
.steps {
  flex: 1;
  padding: 28px 20px 24px;
  position: relative;
  overflow: visible;
}

.step {
  display: none;
}

.step.is-active {
  display: block;
  position: relative;
  z-index: 2;
}

.step.is-active:not(.is-revealed) {
  opacity: 0;
}

.step.is-active.is-revealed {
  animation: stepEnter 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes stepEnter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 단계별 순차 노출 */
.step.is-active .reveal-item {
  opacity: 0;
  transform: translateY(18px);
}

.step.is-active.is-revealed .reveal-item {
  animation: revealItemIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--reveal-order, 0) * 0.07s);
}

/* sticky 고정 시 transform이 깨지므로 히어로는 페이드만 */
.step.is-active .vehicle-hero.reveal-item {
  transform: none;
}

.step.is-active.is-revealed .vehicle-hero.reveal-item {
  animation: revealHeroIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes revealHeroIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes revealItemIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step.is-active.is-revealed .vehicle-hero__img:not(.is-hero-shown) {
  animation: heroImgIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

@keyframes heroImgIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .step.is-active,
  .step.is-active.is-revealed,
  .step.is-active.is-revealed .reveal-item,
  .step.is-active.is-revealed .vehicle-hero__img,
  .step.is-active.is-revealed .vehicle-hero--compact .vehicle-hero__img,
  .option-group.is-appearing,
  .form-field.is-appearing,
  .checkbox-field.is-appearing,
  .app-nav.is-appearing,
  .complete__icon {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* 히어로 카피 */
.hero-copy {
  margin-bottom: 24px;
}

.hero-copy__main {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
  color: var(--secondary);
  margin-bottom: 10px;
}

.hero-copy__sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  font-weight: 400;
}

.trust-banner {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  margin-bottom: 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-card);
  font-size: 13px;
  font-weight: 500;
}

.step-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--secondary);
}

.step-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.55;
}

.step-hint--inline {
  margin-top: -12px;
  margin-bottom: 20px;
}

.step-hint.is-hidden,
.option-group.is-hidden,
.form-field.is-hidden,
.checkbox-field.is-hidden {
  display: none;
}

.option-group.is-appearing,
.form-field.is-appearing,
.checkbox-field.is-appearing {
  animation: optionGroupIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes optionGroupIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 필터 pill */
.vehicle-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.vehicle-filter::-webkit-scrollbar {
  display: none;
}

.vehicle-filter__btn {
  flex-shrink: 0;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.vehicle-filter__btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.vehicle-card.is-hidden {
  display: none;
}

/* STEP 1 차량 카드 — 트림 카드 스타일 */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.vehicle-grid--duo {
  max-width: 360px;
  margin: 0 auto;
}

.vehicle-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 14px 12px 16px;
  text-align: center;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition), border-width var(--transition);
}

.vehicle-card__logo {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: auto;
  max-height: 14px;
  object-fit: contain;
  object-position: right top;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.vehicle-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.vehicle-card.is-active {
  border: 2px solid var(--primary);
}

.vehicle-card__img {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
}

.vehicle-card__img img {
  width: 100%;
  max-height: 88px;
  object-fit: contain;
  object-position: center bottom;
}

.vehicle-card__brand {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.vehicle-card__name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--secondary);
}

.vehicle-card__fuel {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* STEP 2·3·4 차량 히어로 */
.step[data-step="1"] {
  padding-top: 0;
}

.step[data-step="2"],
.step[data-step="3"] {
  padding-top: 12px;
}

.step[data-step="3"] {
  padding-bottom: calc(360px + env(safe-area-inset-bottom, 0px));
}

.vehicle-hero {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  margin: 0 -20px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 12px rgba(5, 20, 31, 0.06);
}

.vehicle-hero__stage {
  height: var(--hero-stage-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ececec 0%, var(--bg) 100%);
  padding: 16px 12px;
  overflow: hidden;
}

.vehicle-hero__img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: calc(var(--hero-stage-h) - 32px);
  object-fit: contain;
  object-position: center center;
}

.vehicle-hero__img[hidden] {
  visibility: hidden;
  height: calc(var(--hero-stage-h) - 32px);
}

.vehicle-hero__meta {
  height: var(--hero-meta-h);
  padding: 14px 20px 16px;
  background: var(--white);
  box-sizing: border-box;
  overflow: hidden;
}

.vehicle-hero__name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--secondary);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}

.vehicle-hero__badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-hero__badge[hidden] {
  display: none;
}

.vehicle-hero__note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.vehicle-hero__note[hidden] {
  display: none;
}

/* STEP 3·4 — 컴팩트 가로 카드 히어로 */
.vehicle-hero--compact {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: var(--hero-compact-h);
  margin: 0 0 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(5, 20, 31, 0.05);
  overflow: hidden;
}

.vehicle-hero--compact .vehicle-hero__stage {
  flex: 0 0 96px;
  width: 96px;
  height: auto;
  min-height: var(--hero-compact-h);
  padding: 10px 8px;
  border-right: 1px solid var(--border-light);
}

.vehicle-hero--compact .vehicle-hero__img {
  width: 100%;
  max-width: 80px;
  height: 72px;
  margin: 0 auto;
}

.vehicle-hero--compact .vehicle-hero__img[hidden] {
  height: 72px;
}

.vehicle-hero--compact .vehicle-hero__meta {
  flex: 1;
  min-width: 0;
  height: auto;
  min-height: var(--hero-compact-h);
  padding: 12px 14px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.vehicle-hero--compact .vehicle-hero__name {
  font-size: 16px;
  margin-bottom: 6px;
}

.vehicle-hero--compact .vehicle-hero__badges {
  gap: 4px;
  min-height: 22px;
}

.vehicle-hero--compact .vehicle-hero__badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--bg);
}

.step.is-active.is-revealed .vehicle-hero--compact .vehicle-hero__img:not(.is-hero-shown) {
  animation: heroImgInCompact 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

@keyframes heroImgInCompact {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 옵션 — pill 버튼 (엔진/인승/트림 참조) */
.option-group {
  margin-bottom: 28px;
  scroll-margin-top: calc(var(--header-h) + var(--hero-sticky-h));
}

.option-group__label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--secondary);
  letter-spacing: -0.01em;
}

.option-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.option-cards--row .option-card {
  flex: 1;
  min-width: calc(50% - 4px);
}

.option-card {
  min-height: 40px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--secondary);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.option-card:hover {
  border-color: var(--secondary);
}

.option-card.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.option-card--trim {
  width: 100%;
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
  padding: 12px 14px;
}

/* STEP 4 신뢰 + 폼 */
.trust-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 28px;
  padding: 18px 8px;
  background: var(--primary);
  border-radius: var(--radius-card);
  pointer-events: none;
  user-select: none;
}

.trust-block__item {
  position: relative;
  padding: 0 6px;
  text-align: center;
  background: transparent;
  border: none;
}

.trust-block__item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
}

.trust-block__item strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.trust-block__item span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.lead-form {
  padding-top: 4px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label,
.form-field__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--secondary);
}

.phone-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-row__sep {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
}

.form-field .phone-row .phone-segment {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 0 8px;
  text-align: center;
}

.form-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--white);
  transition: border-color var(--transition);
}

.form-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: none;
}

.form-field input.is-error,
.phone-row.is-error .phone-segment {
  border-color: #dc2626;
}

.field-hint {
  font-size: 12px;
  color: #dc2626;
  font-weight: 500;
  margin-top: 6px;
  line-height: 1.4;
  min-height: 0;
}

.field-hint:empty {
  display: none;
}

.step-error-msg {
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
  margin: -4px 0 14px;
  line-height: 1.45;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 8px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checkbox-field em {
  color: var(--secondary);
  font-style: normal;
  font-weight: 700;
}

/* 완료 */
.step--complete .step-title {
  display: none;
}

.complete {
  text-align: center;
  padding: 48px 20px;
}

.complete__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.complete__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.complete__desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.complete__time {
  font-size: 14px;
  color: var(--text-muted);
}

.complete__time strong {
  color: var(--secondary);
  font-weight: 700;
}

/* 하단: CTA → 사이트 푸터 */
.app-bottom {
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
}

.site-footer {
  padding: 20px 20px 28px;
  background: var(--white);
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.site-footer__brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.site-footer__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.site-footer__contact {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.site-footer__contact a {
  color: var(--primary);
  text-decoration: none;
}

.site-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 14px;
}

.site-footer__links a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

.site-footer__links span {
  color: var(--border);
}

.site-footer__biz {
  margin-bottom: 14px;
}

.site-footer__biz .site-footer__desc {
  margin-bottom: 4px;
}

.site-footer__biz .site-footer__desc:last-child {
  margin-bottom: 0;
}

.site-footer__biz-label::after {
  content: ":";
  margin-right: 0.25em;
}

.site-footer__copy {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* 하단 CTA (푸터 위) */
.app-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px 20px 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  z-index: 50;
}

.app-nav.is-hidden {
  display: none;
}

.app-nav--inline {
  position: static;
  margin: 20px -20px 0;
  z-index: auto;
}

.app-nav--inline.is-appearing {
  animation: optionGroupIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.btn {
  flex: 1;
  min-height: 56px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  letter-spacing: -0.01em;
  transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn--ghost {
  flex: 0 0 96px;
  background: var(--white);
  color: var(--secondary);
  border: 1px solid var(--border);
}

.btn--ghost:not(:disabled):hover {
  border-color: var(--secondary);
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
}

.btn--primary:not(:disabled)::after {
  content: " ›";
  font-weight: 400;
  margin-left: 2px;
}

.btn--primary:not(:disabled):hover {
  background: var(--primary-dark);
}

.btn--primary.is-ready:not(:disabled) {
  animation: none;
}

.app-nav.is-complete {
  display: none;
}

.app-bottom--complete .site-footer {
  padding-bottom: 32px;
}

@media (min-width: 480px) {
  .hero-copy__main {
    font-size: 30px;
  }
  .steps {
    padding-left: 24px;
    padding-right: 24px;
  }
  .vehicle-hero:not(.vehicle-hero--compact) {
    margin-left: -24px;
    margin-right: -24px;
  }
  .app-nav--inline {
    margin-left: -24px;
    margin-right: -24px;
  }
}
