/* Dense step-quote — layout density matched to remodel */
:root {
  --primary: #5b2c8a;
  --primary-deep: #481e6f;
  --primary-soft: #f3e8ff;
  --primary-mid: #8b5cf6;
  --primary-grad: linear-gradient(135deg, #6b3a9e 0%, #5b2c8a 50%, #481e6f 100%);
  --accent-gold: #d4a017;
  --ink: #111;
  --muted: #777;
  --muted-2: #aaa;
  --line: #e0e0e0;
  --bg: #f8f7ff;
  --bg-card: #fff;
  --summary-head-bg: var(--primary-soft);
  --summary-head-color: var(--primary);
  --safe: env(safe-area-inset-bottom, 0px);
  --pad-x: 18px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --radius: 14px;
  --shadow-btn: 0 8px 22px rgba(91, 44, 138, 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #111;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: #0a0a0a;
}

.phone {
  width: 100%;
  max-width: 430px;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.step {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
  animation: slideIn 0.3s ease both;
}

.step.is-active {
  display: flex;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.75);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes softPulse {
  0%,
  100% {
    box-shadow: var(--shadow-btn);
  }
  50% {
    box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 42%, transparent);
  }
}

@keyframes progressPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent);
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
  }
}

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes sheen {
  0% {
    transform: translateX(-120%) skewX(-18deg);
    opacity: 0;
  }
  30% {
    opacity: 0.5;
  }
  100% {
    transform: translateX(220%) skewX(-18deg);
    opacity: 0;
  }
}

/* ——— Progress ——— */
.progress {
  padding: 16px var(--pad-x) 8px;
  flex-shrink: 0;
}

.progress-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 12px;
}

.progress-label .dim {
  color: var(--muted-2);
  font-weight: 600;
}

.progress-track {
  display: flex;
  align-items: center;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d8d8d8;
  border: 2px solid #d8d8d8;
  flex-shrink: 0;
}

.progress-dot.is-done,
.progress-dot.is-current {
  background: var(--primary);
  border-color: var(--primary);
}

.progress-dot.is-current {
  animation: progressPulse 1.6s ease-in-out infinite;
}

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

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

/* ——— Shared ——— */
.step-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4px var(--pad-x) 0;
  min-height: 0;
}

.step-foot {
  padding: 10px var(--pad-x) calc(14px + var(--safe));
  flex-shrink: 0;
}

.step-title {
  text-align: center;
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.28;
  color: var(--ink);
  flex-shrink: 0;
}

.step-desc {
  text-align: center;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
  color: #8a8a8a;
  font-weight: 500;
  line-height: 1.45;
  flex-shrink: 0;
}

/* STEP 2~5: 세로로 골고루 배치 (상단 몰림 / 한쪽 여백 방지) */
.step:not(.step-landing) .step-body {
  padding-top: clamp(10px, 2vh, 20px);
  padding-bottom: clamp(6px, 1.2vh, 12px);
  justify-content: space-evenly;
  gap: clamp(10px, 1.8vh, 18px);
}

.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 58px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--primary-grad);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-btn);
  animation: softPulse 2.4s ease-in-out infinite;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 0;
  width: 42%;
  height: 140%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 40%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0.12) 60%,
    transparent 100%
  );
  animation: sheen 2.6s ease-in-out infinite;
  pointer-events: none;
}

.btn-primary .chev {
  position: absolute;
  right: 20px;
  font-size: 22px;
  font-weight: 400;
  z-index: 1;
}

.btn-primary:active {
  transform: scale(0.985);
}

.btn-primary:disabled {
  opacity: 0.65;
  pointer-events: none;
}

/* ——— STEP 01 Landing ——— */
.step-landing {
  background: var(--bg);
}

.landing-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad-x) calc(10px + var(--safe));
  min-height: 0;
  height: 100%;
}

.step-landing .progress {
  padding: 16px 0 0;
  flex-shrink: 0;
}

.landing-copy {
  margin-top: clamp(18px, 4.2vh, 36px);
  flex: 0 0 auto;
  animation: fadeUp 0.4s ease both;
}

.landing-title {
  font-size: clamp(40px, 7vh, 54px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.18;
  color: var(--ink);
  text-align: left;
  margin-bottom: 10px;
}

.landing-rating {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 0.8vh;
  font-size: clamp(20px, 3.2vh, 28px);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.stars {
  color: #f5b942;
  letter-spacing: 1px;
  font-size: clamp(24px, 3.6vh, 32px);
}

.landing-middle {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 0 4px;
}

.feature-list {
  list-style: none;
  margin: 0 auto;
  padding: 0 0 0 36px;
  width: max-content;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: content-box;
  animation: fadeIn 0.4s 0.05s ease both;
}

.feature-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

.feature-row:last-child {
  border-bottom: none;
}

.feature-ico {
  width: clamp(36px, 4.2vh, 42px);
  height: clamp(36px, 4.2vh, 42px);
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--primary) 55%, transparent);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.feature-ico svg {
  width: 62%;
  height: 62%;
}

.feature-row strong {
  font-size: clamp(28px, 4.2vh, 36px);
  font-weight: 800;
  letter-spacing: -0.025em;
  text-align: left;
  line-height: 1.2;
  min-width: 8.5em;
}

.landing-hero {
  flex: 0.95 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 140px;
  margin: 0 calc(var(--pad-x) * -1);
  padding: 0 0 2px;
  animation: fadeUp 0.4s 0.08s ease both;
}

.landing-hero img {
  width: 96%;
  max-width: 420px;
  height: auto;
  max-height: 30vh;
  object-fit: contain;
  object-position: center bottom;
  animation: floatY 3.2s ease-in-out infinite;
}

.landing-bottom {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-bottom: 2px;
  animation: fadeUp 0.4s 0.1s ease both;
}

/* ——— STEP 02 Vehicle ——— */
.step[data-step="2"] .step-body {
  align-items: stretch;
  justify-content: flex-start;
  padding-top: clamp(36px, 7vh, 64px);
  gap: 0;
}

.step[data-step="2"] .step-title {
  margin: 0;
}

.step[data-step="2"] .step-desc {
  margin-top: clamp(14px, 2.2vh, 20px);
  margin-bottom: clamp(22px, 3.5vh, 36px);
}

.search-wrap {
  position: relative;
  margin: 0 0 clamp(18px, 3vh, 28px);
  flex-shrink: 0;
}

.search-wrap .si {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #b5b5b5;
  pointer-events: none;
}

.search-wrap .si svg {
  width: 20px;
  height: 20px;
}

.search-input {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px 16px 52px;
  border: 1.5px solid #d8d8d8;
  border-radius: 999px;
  background: #fff;
  font-size: 16px;
  color: #222;
  outline: none;
}

.search-input::placeholder {
  color: #b0b0b0;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.covered-img {
  width: calc(100% + var(--pad-x) * 2);
  margin-left: calc(var(--pad-x) * -1);
  margin-right: calc(var(--pad-x) * -1);
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin-top: 0;
  padding: 0;
  animation: fadeUp 0.4s 0.06s ease both;
}

.covered-img img {
  width: 90%;
  max-width: 400px;
  height: auto;
  max-height: min(30vh, 260px);
  object-fit: contain;
  object-position: center center;
}

.step[data-step="2"] .step-foot {
  padding-top: 8px;
  padding-bottom: calc(12px + var(--safe));
}

/* ——— STEP 03 Entity ——— */
.step[data-step="3"] .step-body {
  justify-content: flex-start;
  padding-top: clamp(32px, 6vh, 56px);
  gap: clamp(20px, 3vh, 28px);
}

.step[data-step="3"] .step-title {
  margin: 0;
}

.entity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 0;
  justify-content: flex-start;
}

.entity-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  min-height: clamp(76px, 10vh, 92px);
  border-radius: 16px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  text-align: left;
  transition: 0.18s;
}

.entity-card.is-selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

.entity-ico {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}

.entity-ico svg {
  width: 28px;
  height: 28px;
}

.entity-label {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.entity-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  color: transparent;
  opacity: 0;
  flex-shrink: 0;
}

.entity-card.is-selected .entity-check {
  opacity: 1;
  background: var(--primary);
  color: #fff;
}

.entity-check svg {
  width: 16px;
  height: 16px;
}

.step[data-step="3"] .step-foot {
  padding-top: 10px;
  padding-bottom: calc(12px + var(--safe));
}

/* ——— STEP 04 Contact ——— */
.step[data-step="4"] .step-body {
  justify-content: flex-start;
  padding-top: clamp(32px, 6vh, 56px);
  gap: 14px;
}

.step[data-step="4"] .step-title {
  margin-top: 0;
}

.step[data-step="4"] .step-desc {
  margin: 0 0 4px;
}

.field {
  margin-bottom: 0;
  flex-shrink: 0;
}

.field label {
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  border: 2px solid #ddd;
  border-radius: 14px;
  background: #fff;
  font-size: 17px;
  outline: none;
}

.field input::placeholder {
  color: #b0b0b0;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.privacy-note {
  font-size: 12px;
  color: #aaa;
  line-height: 1.55;
  margin: 0;
}

/* ——— STEP 05 Done ——— */
.step-done .step-body {
  overflow-y: auto;
  gap: clamp(10px, 1.8vh, 16px);
}

.step[data-step="5"] .center {
  justify-content: space-evenly;
  padding: 0;
  gap: clamp(8px, 1.5vh, 14px);
}

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 0;
}

.done-img {
  width: min(120px, 30vw);
  height: min(120px, 30vw);
  margin: 0;
  flex-shrink: 0;
  animation: pop 0.45s ease both, floatY 2.4s ease-in-out 0.45s infinite;
}

.done-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.done-title {
  font-size: clamp(24px, 6.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
}

.done-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.summary {
  width: 100%;
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.4s 0.08s ease both;
}

.summary-head {
  text-align: center;
  padding: 14px 18px 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--summary-head-color);
  background: var(--summary-head-bg);
  border-bottom: 2px solid var(--primary);
  flex-shrink: 0;
}

.summary dl {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.summary-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  min-height: 48px;
  font-size: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row dt {
  color: #777;
  font-weight: 600;
}

.summary-row dd {
  font-weight: 800;
  color: var(--ink);
  text-align: right;
}

.toast {
  display: none;
}

.ui-modal,
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.ui-modal[hidden],
.loading-overlay[hidden] {
  display: none !important;
}

.ui-modal {
  display: grid;
  place-items: center;
  padding: 18px;
}

.ui-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 20, 0.55);
  backdrop-filter: blur(2px);
}

.ui-modal-panel {
  position: relative;
  width: min(100%, 360px);
  background: #fff;
  border-radius: 18px;
  padding: 24px 22px 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  animation: modal-pop 0.28s ease both;
}

.ui-modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--ink);
}

.ui-modal-body {
  color: #555;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  margin-bottom: 18px;
}

.ui-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ui-modal-actions .btn-modal {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 800;
  background: var(--primary-grad);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.loading-overlay {
  display: grid;
  place-items: center;
  background: rgba(12, 10, 20, 0.42);
}

.loading-box {
  width: min(88vw, 260px);
  background: #fff;
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.loading-bar {
  height: 6px;
  border-radius: 999px;
  background: #ece8f5;
  overflow: hidden;
  margin-bottom: 12px;
}

.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-grad);
  animation: loading-slide 1s ease-in-out infinite;
}

.loading-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes loading-slide {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(280%);
  }
}

@media (max-width: 479px) {
  .phone {
    max-width: none;
  }
}

@media (min-width: 480px) {
  .app {
    align-items: center;
    padding: 24px 0;
  }

  .phone {
    max-width: 430px;
    width: 430px;
    height: min(900px, calc(100dvh - 48px));
    min-height: min(900px, calc(100dvh - 48px));
    border-radius: 28px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    overflow: hidden;
  }

  .step {
    min-height: 100%;
    height: 100%;
  }
}

@media (max-height: 700px) {
  .landing-title {
    font-size: 34px;
    margin-bottom: 6px;
  }
  .landing-rating {
    font-size: 18px;
  }
  .landing-copy {
    margin-top: 16px;
  }
  .landing-middle {
    padding: 4px 0;
  }
  .feature-row {
    padding: 8px 0;
  }
  .feature-ico {
    width: 36px;
    height: 36px;
  }
  .feature-row strong {
    font-size: 26px;
  }
  .landing-hero img,
  .covered-img img {
    max-height: 22vh;
  }
  .entity-card {
    min-height: 72px;
  }
  .btn-primary {
    min-height: 52px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .btn-primary::before,
  .progress-dot.is-current,
  .landing-hero img,
  .done-img {
    animation: none !important;
  }
}
