/* ── 쎄롬케어 누수 신청 온보딩 (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; }
/* 위 outline:none 의 안전망 — 키보드 사용자에게 포커스가 보여야 합니다 */
input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── 앱 셸 — 모바일 풀스크린, 데스크탑에서는 중앙 정렬 ───────────── */
.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; }
.privacy-more {
  margin-left: 5px;
  white-space: nowrap;
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.privacy-more:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }

.field-hint { margin-top: 7px; font-size: 12px; line-height: 1.45; color: var(--ink-4); 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; }

/* 결제 시점 고지 — .pays 가 flex:1 로 남은 공간을 먹으므로 이 블록은 flex:none */
.pay-note {
  flex: none;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 14px 0 0;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--accent-bg);
}
.pay-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.pay-note span { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); font-weight: 500; word-break: keep-all; }
.pay-note b { color: var(--ink); font-weight: 700; }

/* ── 약관 동의 ─────────────────────────────────────────────────
   기존 관용구만 조합했습니다 — 카드는 .pay 의 surface, 체크 표시는 .opt-check
   의 오렌지 원형, 필수/선택 칩은 .pay-tag. 새 색·새 radius 없음. */
.screen--consent { padding-bottom: 0; }   /* CTA 가 sticky 라 바닥 여백은 CTA 가 가짐 */

.consent { flex: none; }

/* 마스터 — .pay 카드의 축소판 */
.consent-all {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.consent-all:hover { background: var(--surface-2); }
.consent-all-tx { font-size: 15.5px; font-weight: 700; color: var(--ink); }

.consent-list { margin-top: 8px; }

.consent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  border-radius: 8px;
  transition: background .2s;
}
/* 필수인데 체크되지 않은 항목을 잠깐 강조 (script.js 가 1.4초 뒤 해제) */
.consent-row.is-miss { background: var(--accent-bg); box-shadow: inset 0 0 0 2px var(--brand); }

.consent-lb {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  padding: 0 4px 0 6px;
  cursor: pointer;
  user-select: none;
}
.consent-tag {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--brand-press);
  font-size: 11px;
  font-weight: 700;
}
.consent-tag--opt { background: var(--surface-2); color: var(--ink-4); }
.consent-tx {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 정책 링크 — 반드시 <label> 밖에 있어야 합니다.
   label 안에 넣으면 HTML 명세 위반이고 링크 클릭이 체크박스까지 토글합니다. */
.consent-view {
  flex: none;
  padding: 6px 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-4);
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 6px;
}
.consent-view:hover { color: var(--brand); }
.consent-view-sp { flex: none; width: 33px; }   /* '보기' 없는 행의 자리맞춤 */

/* 체크박스 — .opt-check 의 오렌지 원형 관용구를 그대로 계승 */
.consent-cb {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  transition: background .15s;
}
.consent-cb:hover { background: #E2E5EA; }
.consent-cb:checked { background: var(--brand); }
.consent-cb::after {
  content: "";
  position: absolute;
  left: 6px; top: 6.5px;
  width: 9px; height: 5px;
  border-left: 2.4px solid #fff;
  border-bottom: 2.4px solid #fff;
  transform: rotate(-45deg);
  opacity: 0;
  transition: opacity .12s;
}
.consent-cb:checked::after { opacity: 1; }
.consent-cb:indeterminate { background: var(--brand); }
.consent-cb:indeterminate::after {
  opacity: 1;
  left: 5.5px; top: 10px;
  width: 11px; height: 0;
  border-left: 0;
  border-bottom: 2.4px solid #fff;
  transform: none;
}
.consent-cb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.consent-notice {
  flex: 1;
  margin-top: 12px;
  padding: 0 6px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-4);
  font-weight: 500;
}

/* CTA — 텍스트 확대·safe-area 변동에도 항상 보이도록 sticky.
   /landing/ 의 .cta-bar 그라디언트 관용구를 재사용. */
.consent-cta {
  position: sticky;
  bottom: 0;
  flex: none;
  padding: 10px 0 calc(28px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, 0));
}

/* 소프트 게이트 — 외형은 :disabled 와 동일하되 클릭은 받습니다.
   무엇이 빠졌는지 알려주려면 클릭 이벤트가 나야 합니다. */
.btn-primary.is-locked,
.btn-primary.is-locked:hover,
.btn-primary.is-locked:active {
  background: var(--line);
  color: #AFB4BC;
  box-shadow: none;
}

/* ── 인트로 하단 정책 링크 ─────────────────────────────────────
   이 파일에는 a 규칙이 하나도 없어서 명시하지 않으면 기본 파란 밑줄이 됩니다. */
.mini-legal {
  flex: none;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.mini-legal a { font-size: 12.5px; font-weight: 600; color: var(--ink-4); text-decoration: none; }
.mini-legal a:hover { color: var(--ink-3); text-decoration: underline; }
.mini-legal a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.mini-sep { width: 1px; height: 10px; background: var(--line); }
.mini-legal--wrap { flex-wrap: wrap; row-gap: 6px; }

/* ── 인트로 하단 사업자 정보 ───────────────────────────────────
   전자상거래법 §10 — 통신판매업자의 신원 정보는 이용자가 쉽게 알 수 있도록
   초기화면에 표시해야 합니다. 이 페이지엔 푸터가 없어 인트로가 그 자리입니다. */
.mini-biz {
  flex: none;
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-4);
  font-weight: 500;
  word-break: keep-all;
}

/* ── 완료 ──────────────────────────────────────────────────────── */
.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); }
.done-note { margin-top: 18px; font-size: 12.5px; line-height: 1.6; color: var(--ink-4); font-weight: 500; }

/* ── 토스트 ────────────────────────────────────────────────────── */
.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); }
}
