/*! styles.css — 모바일 우선 (SPEC §9) */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #14181f;
  --ink-2: #4a5361;
  --ink-3: #7a8494;
  --line: #e3e6ec;
  /* ── 브랜드 색 ──
     본사이트 ebcpa.kr와 맞춘 색. 헤더·버튼·강조가 전부 이 한 줄을 따라간다.
     색을 바꾸려면 --brand만 고치면 되고, 아래 4개는 그 색에 맞춘 보조값이다. */
  --brand: #24282f;
  --header-bg: var(--brand);
  --brand-ink: #ffffff;       /* 버튼 위 글자 */
  --brand-hover: #363c47;     /* 버튼에 마우스 올렸을 때 */
  --brand-tint: #f0f1f4;      /* 「확인 방법」·CTA 박스의 연한 배경 */
  --brand-tint-line: #dcdee4; /* 그 박스의 테두리 */
  --brand-tint-ink: #2f343d;  /* 그 박스의 글자 */

  --green: #157347;
  --green-bg: #e8f5ee;
  --amber: #9a6200;
  --amber-bg: #fdf3e2;
  --gray: #6b7280;
  --gray-bg: #f2f3f5;
  --danger: #b42318;
  --kakao: #fee500;
  --kakao-ink: #191600;
  --radius: 12px;
  --gap: 16px;
  --maxw: 640px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
               "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ---------- 헤더 · 진행률 ---------- */

/* 노란 별(#e9c924)이 선명하게 보이려면 어두운 배경이 필요하다.
   색을 바꾸려면 :root의 --header-bg 한 줄만 고치면 된다. */
.site-head {
  background: var(--header-bg);
  padding: 12px 0;
  margin-bottom: 18px;
}
.head-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* 별은 이미지, 상호는 텍스트 */
.site-head .logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.site-head .logo-star {
  display: block;
  height: 30px;
  width: auto;
}
.site-head .logo-text {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.progress { margin: 0 0 18px; }
.progress[hidden] { display: none; }
.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 999px;
  transition: width .25s ease;
}
.progress-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  text-align: right;
}

/* ---------- 카드 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: var(--gap);
}

.card h1 { font-size: 22px; margin: 0 0 10px; line-height: 1.4; }
.card h2 { font-size: 19px; margin: 0 0 8px; line-height: 1.45; }
.card h3 { font-size: 16px; margin: 0; line-height: 1.45; }
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }

.lead { color: var(--ink-2); }
.help { font-size: 14px; color: var(--ink-3); margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

.bullets { margin: 0 0 20px; padding-left: 18px; color: var(--ink-2); }
.bullets li { margin-bottom: 4px; }

.qnum { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: .04em; margin: 0 0 6px; }

/* ---------- 버튼 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--gray-bg); }
.btn-kakao { background: var(--kakao); color: var(--kakao-ink); }
.btn-block { width: 100%; }

.nav {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.nav .btn { flex: 1; }

/* ---------- 선택지 ---------- */

.choices { display: grid; gap: 10px; }

.choice {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.choice:hover { border-color: var(--brand); }
.choice.selected {
  border-color: var(--brand);
  background: var(--brand-tint);
  font-weight: 600;
}

/* ---------- 입력 ---------- */

.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 120px; }

.labeled { display: block; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 5px;
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
}
.field:focus-within { border-color: var(--brand); }
.field .unit { font-size: 14px; color: var(--ink-3); flex: none; }

.input, .select {
  width: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  font-size: 16px; /* iOS 자동 확대 방지 */
  font-family: inherit;
  color: var(--ink);
  outline: none;
}
.select { appearance: none; -webkit-appearance: none; padding-right: 18px; cursor: pointer; }
.labeled .field, .row .field { position: relative; }
.field:has(.select)::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 8px; height: 8px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: translateY(-3px) rotate(45deg);
  pointer-events: none;
}
.select:disabled { color: var(--ink-3); cursor: default; }

.field-error { color: var(--danger); font-size: 14px; margin: 10px 0 0; }
.field-error[hidden] { display: none; }

/* ---------- 결과지 ---------- */

.result-head .summary { font-size: 17px; font-weight: 600; margin-bottom: 12px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 10px 4px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-amber { background: var(--amber-bg); color: var(--amber); }
.tag-gray  { background: var(--gray-bg);  color: var(--gray); }
.tag .sicon { width: 14px; height: 14px; }

/* ---------- 상태 뱃지 ----------
   색만으로 구분하지 않는다. 체크 / 느낌표 / 줄표로 모양도 다르게 두어
   색각 이상 이용자와 흑백 인쇄에서도 구분되게 한다. */
.sicon { width: 22px; height: 22px; display: block; flex: none; }
.sicon .bg { fill: currentColor; }
.sicon path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sicon .dot { fill: #fff; }
.sicon-green { color: var(--green); }
.sicon-amber { color: var(--amber); }
.sicon-gray  { color: #b3bac4; }
.tag-gray .sicon-gray { color: #9aa2ae; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* `.card p { margin: 0 0 10px }` 가 특정도에서 이기므로 .card를 함께 적어야 한다 */
.card .notice-inline {
  margin: 22px 0 0;
  padding: 10px 12px;
  background: var(--amber-bg);
  border-radius: 8px;
  font-size: 14px;
  color: var(--amber);
}

.item { border-left: 4px solid var(--line); }
.item-green { border-left-color: var(--green); }
.item-amber { border-left-color: var(--amber); }
.item-gray  { border-left-color: var(--gray); }

.item-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.item-icon { flex: none; padding-top: 2px; }
.law { font-size: 12px; color: var(--ink-3); margin: 2px 0 0; }
.headline { color: var(--ink-2); }

.block {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14.5px;
}
.block p { margin: 0; }
.block-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0 0 4px !important;
  text-transform: none;
}
.block-verify  { background: var(--brand-tint); color: var(--brand-tint-ink); }
.block-caution { background: var(--amber-bg); color: #6f4700; }
.block-conflict{ background: var(--amber-bg); color: #6f4700; font-weight: 600; }
.block-warning { background: #fdeceb; color: #8a2018; font-weight: 600; }

.gray-group { margin-bottom: var(--gap); }
.gray-group > summary {
  cursor: pointer;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--ink-2);
  list-style: none;
}
.gray-group > summary::-webkit-details-marker { display: none; }
.gray-group > summary::after { content: " ▾"; color: var(--ink-3); }
.gray-group[open] > summary { border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 0; }
.gray-group[open] > summary::after { content: " ▴"; }
.gray-group .item { margin-top: var(--gap); }

/* ---------- 고정 안내문 ---------- */

.notice { background: #fbfbfc; font-size: 14px; color: var(--ink-2); }
.notice-title { font-weight: 700; color: var(--ink); }
.privacy-note { font-weight: 600; color: var(--green); }

/* ---------- CTA ---------- */

.cta { background: var(--brand-tint); border-color: var(--brand-tint-line); }
.cta-lead { font-weight: 600; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.cta-row .btn { flex: 1; min-width: 140px; }
.cta .collection-notice { margin-top: 14px; }
.cta .check { margin-top: 12px; }
.cta-alt { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); text-align: center; }
.cta-alt a { color: var(--brand); }

/* ---------- 쿠키 동의 배너 ---------- */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--brand); color: #fff;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 -6px 24px rgba(0,0,0,.18);
}
.consent-text { margin: 0; flex: 1 1 320px; font-size: 13.5px; line-height: 1.55; color: #e9ecf2; }
.consent-text a { color: #fee500; }
.consent-btns { display: flex; gap: 10px; flex: 0 0 auto; }
.consent-btns .btn { padding: 10px 22px; font-size: 14px; }
.consent-btns .btn-ghost { background: transparent; color: #cfd4dd; border: 1px solid #59606c; }
.consent-btns .btn-ghost:hover { background: rgba(255,255,255,.06); }

/* ---------- 리드 폼 ---------- */

.lead-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--brand-tint-line);
  display: grid;
  gap: 12px;
}
.lead-form h3 { margin: 0; }
.lead-form .help { margin: 0; }

.collection-notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.collection-notice ul { margin: 0; padding-left: 16px; }
.collection-notice li { margin-bottom: 2px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }

/* 허니팟 — 화면·스크린리더 모두에서 감춘다 */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lead-done {
  margin-top: 20px;
  padding: 18px;
  background: var(--green-bg);
  border-radius: 10px;
  color: #0f4d31;
}
.lead-done h3 { margin: 0 0 6px; }
.lead-done p { margin: 0; }

.error { border-color: #f0c8c4; }

/* ---------- 푸터 ---------- */

.site-foot {
  padding: 24px 0 8px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.site-foot a { color: var(--ink-2); }
.site-foot .sep { margin: 0 6px; color: var(--line); }

/* ---------- 본문형 페이지 (개인정보처리방침) ---------- */

.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; margin-bottom: var(--gap); }
.doc h1 { font-size: 22px; margin: 0 0 6px; }
.doc h2 { font-size: 17px; margin: 26px 0 8px; }
.doc p, .doc li { color: var(--ink-2); font-size: 15px; }
.doc ul { padding-left: 18px; }
.doc table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--gray-bg); font-weight: 600; color: var(--ink); }

@media (min-width: 560px) {
  .card { padding: 24px; }
  .card h1 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
