/* ── 쎄롬케어 누수 신청 온보딩 (A 확정) ───────────────────────────
   모바일 풀스크린 5단계 흐름: 인트로 → 문제 → 정보 → 결제 → 완료
   ───────────────────────────────────────────────────────────── */

:root {
  --brand: #ED7F1A;
  --brand-hover: #D8700F;
  --brand-press: #C9650A;
  --ink: #191D24;
  --ink-2: #5B616E;
  --ink-3: #797F8A;
  --ink-4: #9AA0AA;
  --ink-5: #A4A9B3;
  --surface: #F5F6F8;
  --surface-2: #EEF0F3;
  --surface-3: #F3F4F6;
  --bg: #EDEEF0;
  --line: #E6E8EB;
  --accent-bg: #FFF6ED;
  --badge-bg: #FEF3E8;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { width: 0; height: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--ink);
  display: flex;
  justify-content: center;
}

input { outline: none; font-family: inherit; border: none; }

/* ── 앱 셸 — 모바일 풀스크린, 데스크탑에서는 중앙 정렬 ───────────── */
.app {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow: clip;
}

.viewport {
  flex: 1;
  /* clip(스크롤 컨테이너 미생성)으로 포커스-스크롤에 의한 가로 밀림 방지 */
  overflow: hidden;
  overflow: clip;
  position: relative;
}

.track {
  display: flex;
  height: 100%;
  transition: transform .5s cubic-bezier(.4, 0, .1, 1);
  will-change: transform;
}

.screen {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 28px calc(28px + env(safe-area-inset-bottom));
}

.screen--intro { padding-top: max(28px, env(safe-area-inset-top)); }

/* ── 버튼 ──────────────────────────────────────────────────────── */
.btn {
  flex: none;
  width: 100%;
  font-family: inherit;
  border: none;
  cursor: pointer;
}

.btn-primary {
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(237, 127, 26, .30);
  transition: background .15s;
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-press); }
.btn-primary:disabled,
.btn-primary:disabled:hover,
.btn-primary:disabled:active {
  background: var(--line);
  color: #AFB4BC;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-text {
  height: 50px;
  margin-top: 6px;
  background: none;
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 600;
}

.btn-soft {
  height: 52px;
  margin-top: 36px;
  background: var(--surface);
  border-radius: 16px;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 700;
  transition: background .15s;
}
.btn-soft:hover { background: var(--surface-2); }

/* ── 인트로 ────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand-mark { width: 28px; height: 28px; display: block; }
.brand-nm { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }

.intro-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.intro-h {
  margin: 0 0 18px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.035em;
  color: var(--ink);
}
.accent { color: var(--brand); }
.intro-sub { font-size: 16px; line-height: 1.65; color: var(--ink-2); font-weight: 500; }

/* ── 화면 공통 헤더 ────────────────────────────────────────────── */
.scr-head { display: flex; align-items: center; gap: 12px; height: 36px; flex: none; }
.back {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: -8px;
  color: var(--ink);
  display: flex;
}
.back svg { width: 22px; height: 22px; }

.progress { flex: 1; height: 4px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }

.scr-h {
  margin: 22px 0 6px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink);
}
.scr-h--gap { margin-bottom: 14px; }
.scr-sub { margin: 0 0 22px; font-size: 15px; color: var(--ink-4); font-weight: 500; }
.scr-sub--lh { line-height: 1.5; }

/* ── 문제 선택 그리드 ──────────────────────────────────────────── */
.opt-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-content: start;
  padding-top: 4px;
}
.opt-cell { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.opt {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 20px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background .15s, box-shadow .15s;
}
.opt:hover { background: var(--surface-2); }
.opt.is-selected { background: var(--accent-bg); box-shadow: inset 0 0 0 2px var(--brand); }

.opt-ic { width: 46px; height: 46px; position: relative; }

.opt-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand);
  display: none;
  align-items: center;
  justify-content: center;
}
.opt-check svg { width: 13px; height: 13px; }
.opt.is-selected .opt-check { display: flex; }

.opt-label { font-size: 15px; font-weight: 700; color: var(--ink); }

/* ── 정보 입력 ─────────────────────────────────────────────────── */
.privacy {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 22px;
  flex: none;
}
.privacy svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.privacy span { font-size: 13px; line-height: 1.55; color: var(--ink-2); font-weight: 500; }

.fields { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.field input {
  width: 100%;
  height: 54px;
  border-radius: 14px;
  background: var(--surface);
  padding: 0 16px;
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  transition: box-shadow .15s;
}
.field input::placeholder { color: var(--ink-4); }
.field input:focus { box-shadow: inset 0 0 0 2px var(--brand); }

/* ── 결제 방식 ─────────────────────────────────────────────────── */
.pays { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.pay {
  position: relative;
  text-align: left;
  width: 100%;
  padding: 20px;
  border: none;
  border-radius: 18px;
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, box-shadow .15s;
}
.pay:hover { background: var(--surface-2); }
.pay.is-selected { background: var(--accent-bg); box-shadow: inset 0 0 0 2px var(--brand); }
.pay-t { display: block; font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.pay-d { display: block; font-size: 13px; color: var(--ink-3); font-weight: 500; }

/* 앱으로 결제 — 준비 중(비활성) */
.pay.is-disabled { cursor: not-allowed; }
.pay.is-disabled:hover { background: var(--surface); }
.pay.is-disabled .pay-t,
.pay.is-disabled .pay-d { color: var(--ink-4); }
.pay-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

/* ── 완료 ──────────────────────────────────────────────────────── */
.screen--done { align-items: center; justify-content: center; text-align: center; padding: 32px 28px; }
.done-mark { width: 96px; height: 96px; display: block; animation: srPop .5s ease both; }
.done-h { margin: 24px 0 10px; font-size: 27px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.done-sub { font-size: 16px; line-height: 1.6; color: var(--ink-2); font-weight: 500; }
.done-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--badge-bg);
}
.done-badge .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--brand); }
.done-badge span:last-child { font-size: 13px; font-weight: 700; color: var(--brand-press); }

/* ── 토스트 ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(36px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
}
.toast.show { animation: srToast .25s ease both; }

@keyframes srPop {
  0% { transform: scale(.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes srToast {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
