:root {
  --blue-700: #1b64da;
  --blue-600: #3182f6;
  --blue-500: #4e9bff;
  --blue-100: #ebf2fe;
  --blue-50: #f5f9ff;
  --gray-900: #191f28;
  --gray-700: #4e5968;
  --gray-400: #8b95a1;
  --gray-300: #b0b8c1;
  --gray-200: #e5e8eb;
  --gray-100: #f2f4f6;
  --white: #ffffff;
  --red-500: #f04452;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --bottom-bar-h: 84px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--gray-100);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  touch-action: pan-y;
}
body {
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    system-ui,
    sans-serif;
  color: var(--gray-900);
}

/* ===== 모바일 컨테이너: max-width로 고정, 확대/흔들림 방지 ===== */
.app-frame {
  position: relative;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--white);
  overflow: hidden;
}
@media (min-width: 520px) {
  .app-frame {
    min-height: calc(100dvh - 48px);
    margin: 24px auto;
    border-radius: 28px;
    box-shadow: 0 8px 40px rgba(25, 31, 40, 0.14);
  }
}

/* ===== 상단바 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--white);
  padding: 8px 16px 14px;
}
.back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--gray-900);
  border-radius: 50%;
  transition: background 0.15s ease;
}
.back-btn:active {
  background: var(--gray-100);
}
.back-btn.hidden {
  visibility: hidden;
}

/* ===== progress bar ===== */
.progress-track {
  margin-top: 6px;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-200);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blue-600);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ===== 컨텐츠 영역 ===== */
.content {
  padding: 20px 20px calc(var(--bottom-bar-h) + 28px);
  min-height: calc(100dvh - 64px);
}

.step {
  opacity: 0;
  transform: translateY(14px);
  animation: stepIn 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes stepIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.step.fade-out {
  animation: stepOut 0.16s ease forwards;
}
@keyframes stepOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.title {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.3px;
  margin: 4px 0 0;
  white-space: pre-line;
}
.subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--gray-700);
  line-height: 1.55;
  margin: 10px 0 0;
  white-space: pre-line;
}
.subdesc {
  text-align: center;
}
.brand {
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
}
.brand img {
  height: 20px;
  width: auto;
}

/* ===== 히어로 이미지 ===== */
.hero-image {
  margin: 32px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hero-image img {
  width: 100%;
  max-width: 280px;
  border-radius: var(--radius-md);
  display: block;
}
.hero-image .emoji-hero {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  position: relative;
}
.hero-image .emoji-badge {
  position: absolute;
  right: 6px;
  top: 10px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffc53d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 6px 16px rgba(255, 197, 61, 0.5);
  animation: pop 0.5s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pop {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

/* ===== 옵션: 그리드(이미지 카드) ===== */
.options.grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.opt-card {
  /* border: 1.5px solid var(--gray-200); */
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 18px 12px 14px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.12s ease;
}
.opt-card .opt-emoji {
  font-size: 40px;
  margin-bottom: 10px;
  transition: transform 0.18s ease;
}
.opt-card .opt-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1.4;
}
.opt-card.selected {
  border-color: var(--blue-600);
  background: var(--blue-50);
  animation: cardPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.opt-card.selected .opt-label {
  color: var(--blue-700);
}
@keyframes cardPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.045);
  }
  100% {
    transform: scale(1);
  }
}

/* ===== 옵션: 리스트(텍스트) ===== */
.options.list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  /* border: 1.5px solid var(--gray-200); */
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}
.opt-row .opt-mark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  /* border: 1.5px solid var(--gray-300); */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--white);
  transition: all 0.15s ease;
}
.opt-mark {
  border: 1.5px solid var(--gray-300);
}
.opt-row.selected {
  /* border-color: var(--blue-500); */
  background: var(--blue-50);
}
.opt-row.selected .opt-mark {
  background: var(--blue-500);
  border-color: var(--blue-500);
}
.opt-row .opt-text {
  font-size: 15.5px;
  font-weight: 500;
}

/* ===== 선택 요약 리스트 ===== */
.summary {
  margin-top: 20px;
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
}
.summary-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.summary-head button {
  border: none;
  background: none;
  color: var(--gray-400);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  font-size: 14.5px;
  color: var(--gray-700);
  font-weight: 500;
  animation: rowIn 0.25s ease both;
}
@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.summary-item .check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue-600);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* ===== 정보 카드 ===== */
.info-cards {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.info-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: none;
}
.info-card .label {
  font-size: 13.5px;
  color: var(--gray-700);
  font-weight: 500;
}
.info-card .value {
  font-size: 21px;
  font-weight: 700;
  margin-top: 2px;
}
.info-card .value .unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-left: 2px;
}
.info-source {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 10px;
}

/* ===== 폼 ===== */
.form-fields {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--gray-200);
  padding: 10px 2px;
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  background: transparent;
  outline: none;
  transition: border-color 0.15s ease;
  font-family: inherit;
}
.field input::placeholder {
  color: var(--gray-300);
  font-weight: 500;
}
.field input:focus {
  border-bottom-color: var(--blue-600);
}
.field .error-msg {
  font-size: 12.5px;
  color: var(--red-500);
  margin-top: 6px;
  min-height: 15px;
  display: block;
}

.agree {
  margin-top: 26px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  color: var(--gray-700);
  cursor: pointer;
}
.agree input {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  accent-color: var(--blue-600);
  flex: none;
}

/* ===== 하단 고정 버튼 ===== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: linear-gradient(to top, var(--white) 65%, rgba(255, 255, 255, 0));
  padding: 18px 20px calc(16px + env(safe-area-inset-bottom));
  z-index: 30;
}
.cta-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 0;
  font-size: 17px;
  font-weight: 700;
  background: var(--blue-600);
  color: #fff;
  cursor: pointer;
  transition:
    background 0.18s ease,
    transform 0.1s ease;
}
.cta-btn:active {
  transform: scale(0.98);
}
.cta-btn:disabled {
  background: var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
}

/* ===== 완료 화면 ===== */
.complete-wrap {
  min-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}
.complete-check {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.complete-check svg {
  width: 44px;
  height: 44px;
}
.complete-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
}
.complete-sub {
  font-size: 15px;
  color: var(--gray-700);
  margin-top: 10px;
  line-height: 1.6;
}
