/* =====================================================================
   도란(Doran) public(자녀용) — 입력 화면 공용 스타일 (S0 간편신청 · 기입폼 · S4 설문 블록)
   의존: tokens.css · base.css (child.css 와 독립). 토큰 값만 쓴다 — 새 값 없음.
   ★규칙: 빨강(--c-accent)은 화면당 주 동작 1개(.btn--primary)에만. 선택·오류·진행 표시는 먹색.
          오류는 빨강이 아니라 먹색 굵은 글씨 + 아이콘(.field__err).
   ★클래스는 의미 단위(.form-* / .field-* / .pick / .consent / .sheet-state)로 둔다 — 시안이 오면 이 파일만 바꾼다.
   ===================================================================== */

/* ── 공용 입력 블록 ── */
.hero--form { padding-top: var(--sp-8); }
.form { display: flex; flex-direction: column; gap: var(--sp-8); }
.form-section { display: flex; flex-direction: column; gap: var(--sp-5); padding-top: var(--sp-6); border-top: 1px solid var(--c-line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section__title { font-size: var(--fs-xl); font-weight: 700; line-height: var(--lh-tight); }
.form-section__hint { font-size: var(--fs-sm); color: var(--c-text-3); line-height: var(--lh-body); }
.form-lead { font-size: var(--fs-lg); line-height: 1.667; color: var(--c-text-2); }

.field-block { display: flex; flex-direction: column; gap: var(--sp-2); }
.field-block__label { font-size: var(--fs-md); font-weight: 600; line-height: var(--lh-tight); }
.field-block__opt { font-weight: 400; color: var(--c-text-3); margin-left: var(--sp-1); }
.field-block__hint { font-size: var(--fs-sm); color: var(--c-text-3); line-height: 1.5; }
.field-block .input { font-size: var(--fs-md); }
.field-block .input[aria-invalid="true"] { border-color: var(--c-text); box-shadow: inset 0 0 0 1px var(--c-text); }

/* 오류: 빨강 아님 — 먹색 굵은 글씨 + 아이콘. 칸 바로 아래. */
.field__err {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); line-height: 1.5;
}
.field__err::before {
  content: "!";
  flex: 0 0 auto;
  width: 18px; height: 18px; margin-top: 2px;
  border-radius: var(--r-pill);
  background: var(--c-text); color: var(--c-on-ink);
  font-size: 12px; line-height: 18px; text-align: center;
}

/* 선택 칩/라디오 — 선택 표시는 먹색(체크 + 굵기). 탭 영역 48px. */
.pick-set { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pick-set--stack { flex-direction: column; }
.pick {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-md);
  cursor: pointer;
  text-align: center;
}
.pick-set--stack .pick { justify-content: flex-start; border-radius: var(--r-md); text-align: left; width: 100%; }
.pick[aria-pressed="true"],
.pick[aria-checked="true"] {
  border-color: var(--c-text);
  box-shadow: inset 0 0 0 1px var(--c-text);
  background: var(--c-surface-2);
  font-weight: 700;
}
.pick[aria-pressed="true"]::before,
.pick[aria-checked="true"]::before { content: "✓"; font-weight: 700; }
.pick:disabled { color: var(--c-text-3); border-color: var(--c-line); background: var(--c-surface-2); cursor: default; }

/* 줄 추가형(금기) */
.line-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.line-list__row { display: flex; gap: var(--sp-2); align-items: center; }
.line-list__row .input { flex: 1 1 auto; min-width: 0; }

/* 동의 5개 — 문장 전체가 탭 대상, 각각 따로 */
.consent-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.consent {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  min-height: var(--tap);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  cursor: pointer;
  font-size: var(--fs-md);
  line-height: 1.6;
}
.consent input { flex: 0 0 auto; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--c-text); }
.consent:has(input:checked) { border-color: var(--c-text); background: var(--c-surface-2); }
.consent:has(input:focus-visible) { outline: var(--focus-w) solid var(--c-focus); outline-offset: var(--focus-w); }
.consent[data-invalid="true"] { border-color: var(--c-text); box-shadow: inset 0 0 0 2px var(--c-text); }
.consent--single { margin-top: var(--sp-2); }

/* 진행 표시 점 5개 — 숫자·점수 아님 */
.stepper {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
}
.stepper__dots { display: flex; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.stepper__dot { width: 10px; height: 10px; border-radius: var(--r-pill); border: 1px solid var(--c-line-strong); background: var(--c-surface); }
.stepper__dot[data-state="done"] { background: var(--c-text); border-color: var(--c-text); }
.stepper__dot[data-state="now"] { background: var(--c-text); border-color: var(--c-text); box-shadow: 0 0 0 3px var(--c-line); }
.stepper__note { font-size: var(--fs-sm); color: var(--c-text-3); }

/* 제출 영역 */
.submit-area { display: flex; flex-direction: column; gap: var(--sp-3); }
.submit-area__note { font-size: var(--fs-sm); color: var(--c-text-2); text-align: center; line-height: 1.5; }
.form-banner { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); background: var(--c-surface-2); font-size: var(--fs-sm); font-weight: 700; line-height: 1.5; }

/* 허니팟 — 화면 밖(display:none 은 일부 봇이 건너뛴다). 접근성 트리에서도 제외(aria-hidden). */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* 상태 화면 4종(링크 없음·만료·이미 접수·제출 완료) — 완료 톤은 오류처럼 보이면 안 된다 */
.sheet-state { text-align: left; padding: var(--sp-16) 0 var(--sp-12); display: flex; flex-direction: column; gap: var(--sp-3); }
.sheet-state__title { font-size: var(--fs-2xl); font-weight: 700; line-height: var(--lh-tight); }
.sheet-state__msg { font-size: var(--fs-lg); line-height: 1.667; color: var(--c-text-2); }
.sheet-state__mark { font-size: var(--fs-2xl); color: var(--c-text); }

/* ── S4 설문 블록(2·4주차) — 체크인 카드와 같은 카드 언어 ── */
.survey { display: flex; flex-direction: column; gap: var(--sp-5); }
.survey__q { font-size: var(--fs-md); font-weight: 600; line-height: 1.75; }
.survey__req { font-weight: 400; color: var(--c-text-3); margin-left: var(--sp-1); font-size: var(--fs-sm); }
.survey__opts { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.survey__opts .pick { flex: 1 1 0; }
.survey__done { color: var(--c-text-2); font-weight: 600; font-size: var(--fs-sm); }

/* ── 승인 시안(2026-10-15) 반영: CSS 층 ── */
.btn--ink { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-on-ink); }
.btn--ink:hover:not(:disabled) { background: var(--c-text-2); border-color: var(--c-text-2); }

/* 1b 퀴즈 이어받기 */
.quiz-recap { background: var(--c-surface-2); border-radius: var(--r-md); padding: var(--sp-4); margin-top: var(--sp-4); }
.quiz-recap__k { font-size: var(--fs-sm); color: var(--c-text-3); }
.quiz-recap__v { font-size: var(--fs-md); font-weight: 700; line-height: 1.5; }

/* 오류: 먹색 2px 테두리 */
.field-block .input[aria-invalid="true"] { border: 2px solid var(--c-text); box-shadow: none; }

/* 목록형 선택(경로·설문) — 한 줄씩, 선택은 먹색 ✓ 오른쪽 */
[data-field="경로"] .pick-set, .survey__opts { flex-direction: column; gap: 0; }
[data-field="경로"] .pick, .survey__opts .pick {
  justify-content: space-between; width: 100%; border: 0; border-bottom: 1px solid var(--c-line);
  border-radius: 0; background: transparent; box-shadow: none; padding: 0; text-align: left; flex: 0 0 auto;
}
[data-field="경로"] .pick[aria-checked="true"], .survey__opts .pick[aria-checked="true"] { background: transparent; box-shadow: none; }
[data-field="경로"] .pick[aria-checked="true"]::before, .survey__opts .pick[aria-checked="true"]::before { content: none; }
[data-field="경로"] .pick[aria-checked="true"]::after, .survey__opts .pick[aria-checked="true"]::after { content: "✓"; font-weight: 700; }

/* 2c 고정 하단 [제출하기] 바 */
.submit-area--bar { position: sticky; bottom: 0; z-index: var(--z-bar); background: var(--c-surface); padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--c-line); margin: 0 calc(-1 * var(--sp-6)); padding-left: var(--sp-6); padding-right: var(--sp-6); }
