/*
  기준
  글꼴: Pretendard 하나
  강조색: 메타 파랑 하나 (버튼, 켜진 스위치, 강조 숫자)
  간격: 4의 배수 (8 / 12 / 16 / 20 / 24 / 32 / 48)
  글자 크기: 13 / 15 / 17 / 20 / 22 / 34~44
*/
:root {
  --bg: #F2F4F6;
  --card: #FFFFFF;
  --text: #191F28;
  --sub: #4E5968;
  --muted: #8B95A1;
  --line: #EEF0F3;
  --blue: #0866FF;
  --blue-press: #0657D9;
  --blue-soft: #EAF2FF;
  --navy: #1C2B33;
  --green: #31A24C;
  --radius: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
[id] { scroll-margin-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: hidden;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

p { margin: 0; }
h2 {
  margin: 0 0 20px;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* 버튼: 한 가지 색, 크기만 둘 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--blue-press); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid rgba(8, 102, 255, 0.4); outline-offset: 2px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn-lg { width: 100%; height: 56px; padding: 0 20px; font-size: 17px; border-radius: 16px; }

/* 상단 바 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.topbar-in {
  max-width: 680px;
  height: 56px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

/* 배너: 이미지가 없어도 남색 단색. 아래쪽은 히어로로 녹아든다 */
.banner {
  height: clamp(180px, 42vw, 300px);
  background: var(--navy);
  overflow: hidden;
}
.banner-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}

/* 히어로 */
.hero {
  display: flow-root;
  background: var(--navy);
  color: #FFFFFF;
  text-align: center;
  padding-bottom: 48px;
}
.logo {
  width: 84px;
  height: 84px;
  margin: -42px auto 0;
  border-radius: 50%;
  border: 4px solid var(--navy);
  background: #2A3B45;
  overflow: hidden;
  position: relative;
}
.logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-hook {
  margin: 28px 0 16px;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 600;
  color: #7DB3FF;
}
h1 {
  margin: 0 0 20px;
  font-size: 44px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.hero-lead {
  margin: 0 auto 32px;
  font-size: 19px;
  line-height: 1.6;
  color: #9AA4AD;
}
.hero-lead strong { color: #FFFFFF; font-weight: 700; }
.hero-lead em { font-style: normal; color: #7DB3FF; }
.hero .btn-lg { max-width: 400px; }
.hero-trust {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: #8A949C;
}
.dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

main { padding-top: 20px; }

/* 카드 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 12px;
}
.card-sub {
  margin: -8px 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--sub);
}

/* 받으시는 것: 이름과 값 한 줄씩 */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--sub);
}
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }
.rows b { flex: 0 0 auto; color: var(--text); font-size: 20px; font-weight: 700; }

.price {
  margin-top: 20px;
  padding: 20px;
  border-radius: 16px;
  background: var(--blue-soft);
}
.price-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-weight: 600;
}
.price-line b { font-size: 26px; font-weight: 800; color: var(--blue); letter-spacing: -0.03em; }
.price-note { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--sub); }

/* 진단서 견본: 종이 문서처럼 */
.sample {
  border: 1px solid #E5E8EB;
  border-radius: 16px;
  overflow: hidden;
}
.finding { padding: 20px; }
.finding + .finding { border-top: 1px dashed #D1D6DB; }
.finding-no {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.finding dl { margin: 0; }
.finding dt { font-size: 13px; color: var(--muted); }
.finding dd { margin: 2px 0 14px; font-size: 16px; line-height: 1.6; }
.finding dd b { font-weight: 700; }
.finding dt.q { color: var(--blue); font-weight: 600; }
.finding dd.q {
  margin-bottom: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  font-weight: 600;
}

/* 진행 순서 */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li {
  counter-increment: s;
  position: relative;
  padding: 0 0 24px 44px;
  min-height: 28px;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}
.steps li::after {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 34px;
  bottom: 6px;
  width: 1px;
  background: #DDE1E6;
}
.steps li:last-child::after { display: none; }
.steps b { display: block; font-weight: 600; line-height: 28px; }
.steps span { display: block; margin-top: 2px; font-size: 15px; color: var(--muted); }

/* 진행하는 사람 */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.stats div {
  padding: 16px 12px;
  border-radius: 14px;
  background: var(--bg);
  text-align: center;
}
.stats b { display: block; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.03em; }
.stats small { font-size: 14px; font-weight: 600; margin-left: 1px; color: var(--sub); letter-spacing: 0; }
.stats span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.prose p { color: #333D4B; line-height: 1.75; }
.prose p + p { margin-top: 16px; }

/* 셀프 점검: 설정 화면처럼 문장 왼쪽, 스위치 오른쪽 */
.checks { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.checks li {
  counter-increment: q;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.checks li:first-child { border-top: 0; padding-top: 0; }
.checks li > span { flex: 1; line-height: 1.5; }
.checks li > span::before {
  content: counter(q) ". ";
  color: var(--muted);
  font-weight: 600;
}
.switch {
  flex: 0 0 auto;
  position: relative;
  width: 51px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #E1E4E8;
  cursor: pointer;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
}
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid rgba(8, 102, 255, 0.4); outline-offset: 2px; }

.result {
  margin-top: 20px;
  padding: 20px;
  border-radius: 16px;
  background: var(--bg);
  text-align: center;
}
.result-title { font-size: 20px; font-weight: 700; }
.result-title em { font-style: normal; color: var(--blue); }
.result-desc { margin-top: 4px; font-size: 15px; color: var(--sub); }
.result .btn { margin-top: 16px; }

/* 중간 버튼 */
.cta { padding: 20px 0 32px; text-align: center; }
.cta-note { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* 신청 페이지 (apply.html) */
.back {
  color: var(--sub);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.back:hover { color: var(--text); }
.page-apply main { padding-top: 16px; }
.apply-title {
  margin: 0 0 16px;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-apply .price { margin-top: 0; }
.apply-guide { margin: 20px 0 4px; font-size: 14px; color: var(--muted); }

.form-wrap { position: relative; }
.form-loading {
  position: absolute;
  top: 32px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .form-loading { animation: none; } }

/* 신청 영역 */
.apply { padding-bottom: 12px; }
#tally-form { display: block; width: 100%; min-height: 900px; border: 0; }

.footer {
  padding-top: 20px;
  padding-bottom: 48px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.footer p + p { margin-top: 8px; }

/* 휴대폰 하단 고정 버튼 */
.dock { display: none; }

@media (max-width: 600px) {
  .topbar .btn-sm { display: none; }
  .dock {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(242, 244, 246, 0), var(--bg) 35%);
    transform: translateY(110%);
    transition: transform 0.25s ease;
  }
  .dock.show { transform: none; }
  .footer { padding-bottom: 104px; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .topbar-in { padding: 0 16px; }
  .logo { width: 72px; height: 72px; margin-top: -36px; }
  .hero { padding-bottom: 40px; }
  .hero-hook { font-size: 17px; margin-top: 24px; }
  h1 { font-size: 36px; }
  .hero-lead { font-size: 17px; margin-bottom: 28px; }
  .hero-trust { font-size: 12px; }
  main { padding-top: 16px; }
  .card { padding: 24px 20px; }
  h2 { font-size: 20px; }
  .rows b { font-size: 18px; }
  .stats b { font-size: 24px; }
  .stats small { font-size: 12px; }
  .stats div { padding: 14px 8px; }
}
