/* 이로재 신청서 — 목록 화면은 어두운 면 무늬, 신청서 화면은 기존 사이트의 파란 바탕과 회색 카드 */
:root {
  --ink: #17181b;
  --text: #23262d;
  --muted: #5b6370;
  --line: #cfd3da;
  --line-strong: #9aa3b0;
  --sheet: #f1f1f3;
  --page-blue: #3f84c6;
  --accent: #0b6bea;
  --accent-d: #0856bd;
  --accent-soft: #e3eefc;
  --danger: #bf2a24;
  --danger-soft: #fdecea;
  --sans: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  --serif: 'Noto Serif KR', 'Noto Serif CJK KR', 'Batang', 'Nanum Myeongjo', serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid #7db3ff; outline-offset: 2px; }

/* ───────── 목록 화면 ───────── */
.page-home {
  min-height: 100vh;
  background: #0b0b0c url('/img/facets.svg') center / cover fixed no-repeat;
  color: #fff;
}
.home {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 44px 20px 0;
}
.home-head { text-align: center; max-width: 36rem; }
.brand-name { font-size: 15px; font-weight: 500; letter-spacing: .06em; color: #e9e9ea; }
.brand-logo { display: block; margin: 0 auto; height: 93px; width: auto; max-width: 100%; object-fit: contain; }
.intro {
  margin: 26px 0 0;
  font-size: 15.5px; line-height: 1.95; font-weight: 500;
  color: #f4f4f5;
  text-wrap: balance;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.tiles {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px;
  width: 100%; max-width: 700px;
  margin: 46px auto 64px;
}
.tile {
  flex: 0 0 calc(50% - 9px);
  min-height: 236px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 24px 16px;
  text-align: center; text-decoration: none; color: #fff;
  background: rgba(24, 24, 26, .74);
  border: 2px solid #f2f2f2;
  border-radius: 22px;
  transition: background-color .15s ease, border-color .15s ease;
}
.tile svg { margin-bottom: 12px; }
.tile strong { font-size: 22px; font-weight: 700; line-height: 1.35; }
.tile span { font-size: 15px; font-weight: 500; color: #ececee; }
.tile:hover { background: rgba(255, 255, 255, .13); }
.tile:focus-visible { outline-offset: 5px; }
.load-error { color: #ffd1ce; text-align: center; }

.site-footer {
  width: 100%; max-width: 900px;
  margin-top: auto;
  padding: 26px 20px 34px;
  font-size: 13px; line-height: 1.8;
  color: #9ea4b0;
}
.site-footer p { margin: 0; }
.site-footer .copy { margin-top: 4px; }

/* ───────── 신청서 화면 ───────── */
.page-form {
  min-height: 100vh;
  background: var(--page-blue);
  color: var(--text);
}
.page {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 16px 0;
}
.sheet {
  width: 100%; max-width: 760px;
  background: var(--sheet);
  border-radius: 18px;
  padding: 32px 36px 36px;
  box-shadow: 0 10px 40px rgba(10, 40, 80, .22);
}
.sheet h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700; font-size: 26px; line-height: 1.4;
  text-align: center; color: var(--ink);
}
.sheet h1:focus { outline: none; }
.sheet-intro {
  margin: 14px 0 0; padding: 12px 16px;
  font-size: 14.5px; color: var(--muted);
  background: #fff; border-radius: 10px;
}
.loading { text-align: center; color: var(--muted); }
.page-form .load-error { text-align: center; color: var(--danger); font-weight: 500; }
.page-form .site-footer { color: rgba(255, 255, 255, .82); text-align: center; padding-top: 30px; }

/* 단계 표시 */
.stepper {
  list-style: none; margin: 22px 0 30px; padding: 0;
  display: grid; grid-template-columns: repeat(var(--n, 3), 1fr);
}
.stepper li {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 4px;
  font-size: 13px; color: var(--muted); text-align: center;
}
.stepper li::before {
  content: ''; position: absolute; top: 11px; left: -50%; right: 50%;
  height: 2px; background: var(--ink);
}
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.current::before { background: var(--accent); }
.stepper .box {
  position: relative; z-index: 1;
  width: 24px; height: 24px; display: grid; place-items: center;
  background: #fff; border: 1.5px solid var(--ink);
  font-size: 12px; font-weight: 700; color: var(--ink);
}
.stepper li.done .box, .stepper li.current .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.current { color: var(--accent); font-weight: 700; }

/* 구역 제목 */
.section-title {
  display: flex; align-items: center; gap: 9px;
  margin: 30px 0 16px; padding-bottom: 9px;
  font-size: 17.5px; font-weight: 700; line-height: 1.4; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.section-title::before { content: ''; flex: none; width: 11px; height: 11px; background: var(--ink); }
.step > .section-title:first-child { margin-top: 6px; }

/* 입력칸 */
.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.lbl { display: block; margin: 0 0 6px; padding: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.req { color: var(--danger); margin-left: 3px; }
.field input[type='text'], .field input[type='tel'], .field input[type='email'], .field textarea {
  width: 100%; min-height: 46px; padding: 10px 13px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: #8c94a1; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 107, 234, .22);
}
.field.invalid input[type='text'], .field.invalid input[type='tel'], .field.invalid input[type='email'], .field.invalid textarea {
  border-color: var(--danger); background: var(--danger-soft);
}
.help { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.err { margin: 7px 0 0; font-size: 14px; font-weight: 500; color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* 선택지 */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 8px 18px 8px 14px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 15.5px; color: var(--ink);
}
.choice span::before {
  content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--ink); background: #fff;
}
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.choice input:checked + span::before { border-color: var(--accent); background: radial-gradient(var(--accent) 0 45%, #fff 50%); }
.choice input:focus-visible + span { outline: 3px solid #7db3ff; outline-offset: 2px; }
.field.invalid .choice span { border-color: var(--danger); }

.checkline { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15.5px; }
.checkline input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); }

/* 안내문 */
.notice {
  margin: 0 0 18px; padding: 10px 14px;
  font-size: 14.5px; line-height: 1.7; color: var(--muted);
  border-left: 3px solid var(--line-strong); background: rgba(255, 255, 255, .6);
  border-radius: 0 8px 8px 0;
}
.notice p { margin: 0; }
.notice .gap, .success .gap, .consent-block .gap { height: .7em; }
.notice.strong p, .notice p.b { font-weight: 500; color: var(--text); }

/* 파일 */
.filebox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-file { cursor: pointer; }
.filebox input:focus-visible + .btn-file, .filebox input:focus-visible ~ .btn-file { outline: 3px solid #7db3ff; outline-offset: 2px; }
.filelist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.filelist:empty { display: none; }
.filelist li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px 7px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14.5px;
}
.fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { flex: none; color: var(--muted); font-size: 13px; }
.fremove {
  flex: none; min-height: 32px; padding: 0 12px;
  font: inherit; font-size: 13.5px; color: var(--danger);
  background: transparent; border: 1px solid #e3b6b3; border-radius: 6px; cursor: pointer;
}
.fremove:hover { background: var(--danger-soft); }

/* 동의문 */
.consent-box {
  height: 300px; overflow: auto; margin: 6px 0 14px; padding: 14px 16px;
  font-size: 14px; line-height: 1.7; color: var(--muted);
  background: #fafafb; border: 1px solid var(--line-strong); border-radius: 8px;
}
.consent-block h3 { margin: 0 0 6px; font-size: 14.5px; color: var(--ink); }
.consent-block p { margin: 0 0 3px; }
.consent-block + .consent-block { margin-top: 18px; }
.consent-check {
  padding: 12px 14px; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
  font-weight: 700; color: var(--ink);
}
.consent-checks { display: grid; gap: 10px; }
.consent-checks.grouped { gap: 0; padding: 2px 14px; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; }
.consent-checks.grouped .consent-check { padding: 12px 0; background: none; border: 0; border-radius: 0; }
.consent-checks.grouped .consent-all { border-bottom: 1px solid var(--line); }
.consent-checks.grouped .consent-sub { padding-left: 24px; font-weight: 500; }

/* 버튼 */
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 26px;
  font: inherit; font-size: 16px; font-weight: 700;
  border-radius: 8px; border: 1.5px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; min-width: 108px; }
.btn-primary:hover { background: var(--accent-d); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: #eceef2; }
.btn-file { background: #fff; color: var(--accent-d); border-color: var(--accent); min-height: 44px; font-size: 15px; }
.btn-file:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .6; cursor: progress; }

.form-error {
  margin: 18px 0 0; padding: 12px 14px;
  font-size: 15px; font-weight: 500; color: var(--danger);
  background: var(--danger-soft); border: 1px solid #e8b4b0; border-radius: 8px;
}
.total-info { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); text-align: right; }
.total-info.over { color: var(--danger); font-weight: 700; }
progress { display: block; width: 100%; height: 8px; margin-top: 12px; accent-color: var(--accent); }

/* 전송 완료 */
.success { text-align: center; padding: 18px 0 8px; }
.success .badge {
  display: inline-block; margin: 0 0 22px; padding: 6px 22px;
  background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; border-radius: 4px;
}
.success p { margin: 0; font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.85; }
.success .back { margin-top: 26px; font-size: 15px; font-weight: 400; }
.success .back a { color: var(--accent-d); }

/* 안내문·완료 화면 안의 링크 버튼 */
.btn-link {
  display: inline-block; margin-top: 6px; padding: 7px 14px; border-radius: 8px;
  background: #fff; color: var(--accent-d); border: 1.5px solid var(--accent);
  font-size: 14.5px; font-weight: 700; text-decoration: none; line-height: 1.4;
}
.btn-link:hover { background: var(--accent-soft); }
.success .btn-link { margin-top: 4px; font-size: 15.5px; }

/* 목록 화면: 포괄위임 안내 버튼 */
.guide-wrap { margin: 36px 0 0; text-align: center; }
.guide-btn {
  display: inline-block; padding: 20px 44px; border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, .85); color: #fff; text-decoration: none;
  font-size: 30px; font-weight: 700; line-height: 1.3; background: rgba(255, 255, 255, .08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
.guide-btn:hover { background: rgba(255, 255, 255, .16); }

/* 포괄위임 안내 화면 */
.guide-intro { margin-top: 14px; }
.guide-intro p { margin: 0 0 4px; font-size: 16.5px; color: var(--ink); }
.guide-req {
  margin: 18px 0 26px; padding: 16px 18px; border-radius: 10px;
  background: #fff8e1; border: 1px solid #f0d27a; color: #4a3b00;
}
.guide-req-title { margin: 0 0 6px; font-weight: 700; }
.guide-req ul { margin: 0; padding-left: 1.2em; }
.guide-mobile { margin: 10px 0 0; font-size: 14.5px; }
.guide-url { color: #0b4fae; font-weight: 700; text-decoration: underline; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.guide-step {
  display: flex; gap: 16px; padding: 20px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
}
.guide-num {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 18px;
}
.guide-body { min-width: 0; flex: 1; }
.guide-body h2 { margin: 6px 0 12px; font-size: 19px; color: var(--ink); }
.guide-open { display: inline-flex; text-decoration: none; margin-bottom: 12px; white-space: normal; text-align: center; }
.guide-flow { margin: 0; padding-left: 1.3em; color: var(--text); }
.guide-flow li { margin: 2px 0; }
.guide-flow li::marker { color: var(--accent-d); font-weight: 700; }
.guide-note { margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
.guide-contact { margin-top: 26px; text-align: center; }
.guide-contact p { margin: 0 0 10px; }
.guide-contact .btn { text-decoration: none; display: inline-flex; }
.guide-sign { margin-top: 18px !important; color: var(--muted); font-size: 14.5px; }

/* 오른쪽 바로가기 */
.quick {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  width: 84px; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
  border-radius: 6px 0 0 6px; overflow: hidden; z-index: 10;
}
.quick-bar { height: 20px; background: #1b2a6b; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px 9px;
  font-size: 11.5px; line-height: 1.3; text-align: center; text-decoration: none; color: #20242b;
  border-bottom: 1px solid #e2e5ea;
}
.quick-item:last-child { border-bottom: 0; }
.quick-item svg { color: #1b2a6b; }
.quick-item img { display: block; width: 46px; height: 46px; object-fit: contain; border-radius: 4px; }
.quick-item:hover { background: #eef3fb; }

/* ───────── 좁은 화면 ───────── */
@media (max-width: 1000px) {
  .page-form .page { padding-bottom: 76px; }
  .page-home .home { padding-bottom: 76px; }
  .quick {
    top: auto; bottom: 0; left: 0; right: 0; transform: none; width: auto;
    display: flex; border-radius: 0; box-shadow: 0 -2px 14px rgba(0, 0, 0, .22);
  }
  .quick-bar { display: none; }
  .quick-item { flex: 1; flex-direction: row; justify-content: center; gap: 6px; padding: 12px 4px; border-bottom: 0; border-right: 1px solid #e2e5ea; font-size: 12px; }
  .quick-item:last-child { border-right: 0; }
  .quick-item svg, .quick-item img { width: 26px; height: 26px; }
}
@media (max-width: 640px) {
  .page { padding: 20px 10px 0; }
  .sheet { padding: 24px 16px 28px; border-radius: 14px; }
  .sheet h1 { font-size: 22px; }
  .stepper .name { font-size: 12px; }
  .row { grid-template-columns: 1fr; }
  .tile { flex-basis: 100%; min-height: 168px; }
  .tile strong { font-size: 20px; }
  .intro { font-size: 14.5px; }
  .brand-logo { height: 75px; }
  .consent-box { height: 260px; }
  .actions .btn { flex: 1; }
  .actions span:empty { display: none; }
  .quick-item { flex-direction: column; gap: 2px; font-size: 11px; }
  .guide-btn { font-size: 21px; padding: 15px 26px; border-width: 2px; }
  .guide-step { padding: 16px 14px; gap: 12px; }
  .guide-num { width: 32px; height: 32px; font-size: 16px; }
  .guide-body h2 { font-size: 17px; margin-top: 3px; }
  .guide-open { width: 100%; justify-content: center; }
}
@media (max-width: 380px) {
  .guide-btn { font-size: 18px; padding: 14px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
