/* 단계형 신청서 — 테마 3종(ocean 파랑 띠 / night 어두운 보라 / paper 종이 베이지)
   테마색은 config의 theme.c1, c2 가 --c1, --c2 로 들어옵니다. */
:root {
  --c1: #2f6bff;
  --c2: #5b8cff;
  --bg: #f2f4f8;
  --card: #ffffff;
  --ink: #1d2433;
  --sub: #6b7385;
  --line: #e3e7ef;
  --opt: #f6f7fa;
  --opt-line: #e1e5ec;
  --ok: #22c55e;
  --err: #e5484d;
  --radius: 28px;
  --shadow: 0 18px 50px rgba(30, 45, 90, .12);
  --font: "Pretendard", "Pretendard Variable", "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
button, input { font-family: inherit; }

/* ---------- 바탕 ---------- */
.band { position: absolute; inset: 0 0 auto 0; height: 200px; background: var(--c1); z-index: 0; }
body.is-start .band { height: 470px; }
.concept-night { --bg: #120f24; --card: #1d1838; --ink: #f1efff; --sub: #a9a3c9; --line: #2e2853; --opt: #241e45; --opt-line: #342d60; --shadow: 0 20px 60px rgba(0,0,0,.45); }
.concept-night .band { background: radial-gradient(120% 100% at 20% 0%, var(--c1) 0%, #2a1f63 55%, transparent 100%); opacity: .9; }
.concept-paper { --bg: #ece7dd; --card: #faf8f3; --ink: #22252b; --sub: #6d6a62; --line: #e3ddd0; --opt: #f3efe6; --opt-line: #e0d9ca; --radius: 14px; --shadow: 0 10px 30px rgba(70, 55, 20, .10); }
.concept-paper .band { display: none; }

.wrap { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; padding: 16px 16px 64px; }

/* ---------- 시작 카드 ---------- */
.start-head { color: #fff; padding: 30px 52px 22px; min-height: 108px; }
.start-head h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; white-space: pre-line; color: #0f1630; }
.start-head p { margin: 0; font-size: 14px; color: rgba(15,22,48,.7); }
.concept-night .start-head h2 { color: #fff; }
.concept-night .start-head p { color: rgba(255,255,255,.7); }
.concept-paper .start-head { display: none; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 22px 26px;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--c1) 12%, transparent);
  color: var(--c1); font-weight: 700; font-size: 14px;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c1); }
.concept-night .chip { color: var(--c2); background: color-mix(in srgb, var(--c1) 25%, transparent); }
.start-title { font-size: 34px; line-height: 1.28; font-weight: 800; letter-spacing: -0.02em; margin: 22px 0 22px; white-space: pre-line; }
.start-desc { white-space: pre-line; color: var(--sub); font-size: 16px; line-height: 1.85; margin: -4px 0 26px; }
.concept-paper .start-title { margin-top: 6px; }
.btn-primary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; border: 0; cursor: pointer;
  background: var(--c1); color: #0d1324;
  font-size: 17px; font-weight: 800;
  padding: 20px 24px; border-radius: 18px;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--c1) 35%, transparent);
  transition: transform .12s ease, filter .12s ease;
}
.concept-night .btn-primary, .concept-paper .btn-primary { color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.start-meta { text-align: center; color: var(--sub); font-size: 13px; margin-top: 16px; }

/* ---------- 문항 ---------- */
.step-chip { font-size: 12px; font-weight: 800; letter-spacing: .02em; padding: 7px 13px; }
.q-label { font-size: 23px; font-weight: 800; line-height: 1.4; letter-spacing: -0.015em; margin: 18px 0 6px; }
.q-label .req { color: var(--c1); margin-left: 3px; }
.q-hint { font-size: 13.5px; color: var(--sub); margin: 0 0 14px; }
.q-body { margin-top: 14px; }
.opts { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px;
  padding: 17px 18px; border-radius: 14px;
  background: var(--opt); border: 1px solid var(--opt-line);
  cursor: pointer; font-weight: 600; font-size: 15.5px; user-select: none;
  transition: border-color .12s, background .12s;
}
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .box {
  flex: none; width: 24px; height: 24px; border-radius: 7px;
  border: 2px solid #8a90a0; display: grid; place-items: center; background: transparent;
}
.opt.radio .box { border-radius: 50%; }
.opt .box svg { width: 14px; height: 14px; opacity: 0; }
.opt.on { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 9%, var(--card)); }
.opt.on .box { background: var(--c1); border-color: var(--c1); }
.opt.on .box svg { opacity: 1; }
.opt:focus-within { outline: 2px solid color-mix(in srgb, var(--c1) 50%, transparent); outline-offset: 2px; }

.field {
  display: flex; align-items: stretch; width: 100%;
  border: 1.5px solid var(--opt-line); border-radius: 14px; background: var(--opt);
  overflow: hidden; transition: border-color .12s;
}
.field:focus-within { border-color: var(--c1); }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 17px; padding: 17px 16px; outline: none; }
.field .prefix { display: flex; align-items: center; gap: 6px; padding: 0 14px; font-weight: 700; font-size: 14px; color: var(--sub); border-right: 1px solid var(--opt-line); white-space: nowrap; }
.field .prefix b { color: var(--ink); font-weight: 800; }

.legal-box {
  white-space: pre-line; font-size: 14px; line-height: 1.75; color: var(--sub);
  background: var(--opt); border: 1px solid var(--opt-line); border-radius: 12px;
  padding: 16px 18px; max-height: 240px; overflow: auto; margin-bottom: 12px;
}
.legal-box strong { color: var(--ink); }

.err { color: var(--err); font-size: 13.5px; font-weight: 600; margin: 10px 2px 0; min-height: 1em; }
.shake { animation: shake .32s ease; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

.foot { display: flex; align-items: center; justify-content: space-between; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.btn-back { border: 0; background: none; color: var(--sub); font-size: 14.5px; cursor: pointer; padding: 10px 6px; display: inline-flex; gap: 8px; align-items: center; }
.btn-back[hidden] { visibility: hidden; display: inline-flex; }
.btn-next {
  border: 0; cursor: pointer; background: var(--c1); color: #0d1324; font-weight: 800; font-size: 16px;
  padding: 18px 28px; border-radius: 16px; display: inline-flex; gap: 12px; align-items: center;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--c1) 32%, transparent);
}
.concept-night .btn-next, .concept-paper .btn-next { color: #fff; }
.btn-next:disabled { opacity: .6; cursor: progress; }

/* 한 페이지형(single) */
.single-q { padding: 22px 0; border-bottom: 1px solid var(--line); }
.single-q:first-of-type { padding-top: 6px; }
.single-q:last-of-type { border-bottom: 0; }
.single-q .q-label { font-size: 19px; margin-top: 0; }
.single-q .num { color: var(--c1); margin-right: 8px; }
.single-title { font-size: 26px; font-weight: 800; margin: 0 0 4px; white-space: pre-line; line-height: 1.35; }

/* ---------- 완료 ---------- */
.done { text-align: center; padding: 46px 24px 38px; }
.done .check { width: 84px; height: 84px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; margin: 0 auto 22px; box-shadow: 0 14px 30px rgba(34,197,94,.35); animation: pop .45s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.done .check svg { width: 42px; height: 42px; }
.done h2 { font-size: 28px; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.02em; line-height: 1.35; }
.done .desc { font-size: 16.5px; color: var(--sub); margin: 0; line-height: 1.6; }
.done .desc .who { color: var(--c1); font-weight: 800; }
.concept-night .done .desc .who { color: var(--c2); }
.done .note { font-size: 13.5px; color: var(--sub); margin: 18px auto 0; max-width: 360px; line-height: 1.6; }
.done .again { display: inline-block; margin-top: 28px; color: var(--sub); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; background: none; border: 0; cursor: pointer; }

/* ---------- 기타 ---------- */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; width: 100%; height: 100%; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #111827; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .25s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.list-forms { display: grid; gap: 10px; margin-top: 18px; }
.list-forms a { display: block; padding: 14px 16px; border-radius: 12px; background: var(--opt); border: 1px solid var(--opt-line); color: var(--ink); text-decoration: none; font-weight: 700; }
.list-forms a small { display: block; font-weight: 500; color: var(--sub); margin-top: 4px; }
.demo-badge { position: fixed; right: 10px; bottom: 10px; z-index: 40; font-size: 11px; color: var(--sub); background: color-mix(in srgb, var(--card) 85%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }

@media (min-width: 768px) {
  .band { height: 220px; }
  body.is-start .band { height: 360px; }
  .wrap { padding-top: 26px; }
  .card { padding: 40px 32px 32px; }
  .start-head { padding-left: 36px; }
  .start-title { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) { .card, .done .check { animation: none; } }
