:root {
  --max-width: 480px;
  --gold: #ffc000;
  --blue: #1b74d6;      /* 정보·학습 강조 (새 랜딩 이미지의 하늘파랑 톤) */
  --pink: #e0316e;      /* 혜택·브랜드 소구 강조 (이미지 핑크 뱃지 톤) */
  --sky-soft: #e9f3fe;  /* 연하늘 카드/선택 배경 공용 */
  --border: #d9d9df;
  --text-muted: #9a9aa3;
  --danger: #e0432a;
  --bg: #f3f3f6;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: #1c1c22;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  position: relative;
  padding-bottom: 90px; /* 하단 고정 버튼 공간 */
}

/* 화면을 꽉 채우는 화면(시작/안내페이지)에서는 이 여백이 스크롤을 만들므로 제거 */
.page:has(.screen--fill:not([hidden])) {
  padding-bottom: 0;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content {
  padding: 10px 20px 20px; /* 제목 위 공백 축소 (20px → 10px) */
}

.content--done {
  text-align: center;
  padding-top: 24px;
}

/* 완료 화면의 혜택 리마인드 문구는 기본 eyebrow(13px)보다 크게 */
.content--done .eyebrow {
  font-size: 15px;
}

/* 화면을 꽉 채우면서 스크롤 없이 한눈에 보이게 하는 화면(시작/안내페이지)
   100dvh: 모바일 브라우저 주소창 유무에 따라 실제 보이는 높이에 맞춤 (미지원 브라우저는 100vh로 동작) */
.screen--fill {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* 전체 화면 이미지 배경 화면 */
.screen--fullimg {
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.quiz-header--overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.screen--fill .content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 76px; /* 하단 고정 버튼(64px)에 안 가리도록 여유 확보 */
}

.content--intro {
  text-align: center;
  align-items: center;
}

/* ===================== 공통: 이미지 placeholder ===================== */
.img-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f6f9;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  width: 100%;
  overflow: hidden;
}

.img-slot span { padding: 8px 16px; }

.img-slot--hero { aspect-ratio: 4 / 3; }

/* 실제 이미지 적용 시 — 원본 비율 그대로 표시 (잘림/왜곡 없음) */
.quiz-img { width: 100%; height: auto; border-radius: 12px; margin: 10px 0; display: block; }

/* 포크/폼 화면 이미지는 세로 스크롤을 줄이기 위해 높이 제한 (가운데 정렬) */
#screen-fork .quiz-img,
#screen-form-full-1 .quiz-img {
  width: auto;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
#screen-fork .quiz-img { max-height: 220px; }
#screen-form-full-1 .quiz-img { max-height: 160px; }
.img-slot--intro { flex: 1; min-height: 0; width: 100%; margin-top: 20px; border-radius: 12px; }
.img-slot--quiz { aspect-ratio: 16 / 9; margin: 16px 0; border-radius: 12px; }
.img-slot--answer { aspect-ratio: 16 / 9; margin: 16px 0; border-radius: 12px; }
.img-slot--banner { aspect-ratio: 2 / 1; margin: 16px 0; border-radius: 12px; }
.img-slot--small { aspect-ratio: 2 / 1; margin-bottom: 16px; border-radius: 12px; }
.img-slot--prize-all { flex: 1; min-height: 0; margin-top: 12px; border-radius: 12px; }

/* ===================== 공통: 상단 헤더(이전버튼+진행표시) ===================== */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}

.btn-back {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: #1c1c22;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

.progress-dots {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.progress-dots .dot.is-active {
  background: var(--blue);
}

.step-label {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* ===================== 텍스트 ===================== */
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 6px;
}

.title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 12px;
}

.lead {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 12px;
}

/* 시작페이지는 타이틀 화면 역할이라 더 크고 여유있게 */
#screen-intro .eyebrow {
  font-size: 15px;
  margin-bottom: 10px;
}

#screen-intro .title {
  font-size: 32px;
  line-height: 1.45;
  margin-bottom: 18px;
}

#screen-intro .lead {
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 0;
}

.desc {
  font-size: 14px;
  color: #4b4b55;
  line-height: 1.6;
  margin: 0 0 16px;
}

.ask {
  font-size: 16px;
  font-weight: 700;
  margin: 12px 0 10px;
}

.fork-note {
  font-size: 13px;
  color: #8a8a94;
  margin: 8px 0 0;
}

.highlight {
  color: var(--blue);
  font-weight: 800;
}

/* 안내페이지: 본문 설명을 정답화면 설명문(16px)과 같은 크기로 */
.desc--guide {
  font-size: 16px;
}

/* ===================== 퀴즈 문제/답변 ===================== */
.quiz-q-num {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 6px;
}

.quiz-q-text {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 24px;
}

.ox-choice {
  display: flex;
  gap: 12px;
}

.ox-btn {
  flex: 1;
  height: 88px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: #fff;
  font-size: 32px;
  font-weight: 800;
  color: #1c1c22;
  cursor: pointer;
}

.ox-btn:active {
  border-color: var(--blue);
  color: var(--blue);
}

.answer-feedback {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 12px;
}

.answer-explain {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 8px;
}

.answer-reassure {
  font-size: 14px;
  color: var(--blue);
  margin: 0 0 16px;
}

.brand-msg {
  font-size: 16px;
  font-weight: 500;
  color: #1c1c22;
  background: var(--sky-soft);
  border-radius: 10px;
  padding: 14px 16px;
  line-height: 1.5;
  margin-top: 16px;
}

/* 연하늘 카드 안에서는 파랑이 묻히므로 브랜드 소구 강조는 핑크로 */
.brand-msg .highlight {
  color: var(--pink);
}

/* 포크 화면의 혜택 강조(7일 무료, 다이소 5,000원권)도 혜택 색상인 핑크로 */
#screen-fork .desc .highlight {
  color: var(--pink);
}

/* ===================== 분기 화면 ===================== */
.fork-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ===================== 버튼 ===================== */
.btn-primary {
  display: block;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: var(--gold);
  color: #1c1c22;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: #1c1c22;
  border-radius: 10px;
  padding: 0 16px;
  height: 44px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-fixed {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: 64px;
  border-radius: 0;
  z-index: 30;
}

.btn-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--blue);
  text-decoration: underline;
}

/* ===================== 폼 ===================== */
.apply-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 80px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 13px;
  font-weight: 600;
}

.required { color: var(--danger); }

.field input[type="text"],
.field input[type="tel"] {
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 16px;
}

.field__detail {
  margin-top: 6px;
}

.address-row {
  display: flex;
  gap: 8px;
}

.address-row input { flex: 1; min-width: 0; }

/* 연도 자릿수 버그가 있는 네이티브 date input은 화면에는 보이지 않게 숨기고
   달력 버튼을 눌렀을 때만 피커로 사용한다 (wink-landing과 동일 패턴) */
#childBirthPicker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.gender-row {
  display: flex;
  gap: 8px;
}

.gender-btn {
  flex: 1;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.gender-btn.is-selected {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--sky-soft);
}

/* ===================== 동의 영역 ===================== */
.consent-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 14px;
}

.consent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

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

.consent-row--all {
  font-weight: 700;
  font-size: 14px;
}

.consent-row span { flex: 1; }

.tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
}

.tag--required { color: var(--danger); background: #fdeceb; }
.tag--optional { color: var(--text-muted); background: #f0f0f3; }

.consent-view {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
}

/* ===================== 완료 화면 ===================== */
.done-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 28px;
  margin: 0 auto 16px;
}

.notice-box {
  text-align: left;
  background: #f6f6f9;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: #4b4b55;
  line-height: 1.6;
  margin-top: 20px;
}

.notice-box p { margin: 0 0 4px; }

.soft-upsell {
  font-size: 14px;
  margin-top: 20px;
}

.soft-upsell a {
  color: var(--blue);
  font-weight: 700;
}

.soft-upsell--card {
  background: var(--sky-soft);
  border-radius: 12px;
  padding: 18px;
  line-height: 1.5;
  font-size: 17px;
  font-weight: 700;
}

.soft-upsell--card a {
  font-weight: 800;
  text-decoration: underline;
}

/* ===================== 약관/주소 팝업 (wink-landing과 동일 패턴) ===================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}

.consent-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: var(--max-width);
  height: 80vh;
  background: #fff;
  border-radius: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.consent-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.consent-popup__frame {
  flex: 1;
  border: none;
  width: 100%;
}

.bottom-sheet__close {
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
