/* =====================================================================
   styles.css — 재무·투자 연구용 (네이비 + 골드 포인트, 절제된 전문가 톤)
   색을 바꾸고 싶으면 아래 :root 안의 값만 고치면 됩니다.
   ===================================================================== */
:root {
  --navy: #0f2540;          /* 메인 색: 상단바, 버튼, 제목, 표 머리글 */
  --navy-dark: #091a2f;     /* 버튼에 마우스 올렸을 때 */
  --navy-soft: #eaf0f8;     /* 선택된 항목 배경 */
  --gold: #b08d3c;          /* 포인트 색(가는 선, 강조) */
  --ink: #1b2430;           /* 본문 글자색 */
  --muted: #5d6b7c;         /* 보조 글자색 */
  --line: #cfd6df;          /* 테두리 */
  --line-soft: #e6eaf0;     /* 아주 연한 구분선 */
  --paper: #f3f5f8;         /* 바깥 배경 */
  --red: #b42318;
  --orange: #b54708;
  --radius: 6px;
  /* 기존 코드가 쓰는 이름도 남겨둠 */
  --sky: var(--navy);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Arial, sans-serif;
  font-size: 16.5px; line-height: 1.8; word-break: keep-all;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: 48px 0;
}
[hidden] { display: none !important; }

/* ===== 틀 ===== */
.container {
  width: calc(100% - 40px); max-width: 880px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 37, 64, .06), 0 12px 32px rgba(15, 37, 64, .08);
}
.topbar {
  background: var(--navy); color: #fff;
  padding: 13px 36px; font-weight: 600; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase;
  border-bottom: 3px solid var(--gold);
}
.debug-banner { background: #fff8e1; border-bottom: 1px solid #e0c36a; padding: 8px 20px; font-size: .85rem; line-height: 1.4; }
.page { padding: 32px 40px 8px; }
.actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 18px 40px 28px; margin-top: 8px; border-top: 1px solid var(--line-soft);
}
.status { flex: 1; font-size: .9rem; color: var(--muted); }
.status.err-text { color: var(--red); }
.btn {
  background: var(--navy); color: #fff; border: 1px solid var(--navy); border-radius: 4px;
  padding: 11px 40px; font: inherit; font-size: .95rem; font-weight: 600; letter-spacing: .04em;
  cursor: pointer; transition: background .15s;
}
.btn:hover:not(:disabled) { background: var(--navy-dark); }
.btn:disabled { background: #e8ecf1; color: #9aa6b4; border-color: #dbe1e8; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ===== 글 ===== */
.hd { font-weight: 700; margin: 24px 0 10px; line-height: 1.4; color: var(--navy); }
h1.hd { font-size: 1.6rem; letter-spacing: -0.02em; }
h2.hd {
  font-size: 1.4rem; letter-spacing: -0.02em;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); position: relative;
}
h2.hd::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 3px; background: var(--gold); }
h3.hd { font-size: 1.08rem; padding-left: 12px; border-left: 3px solid var(--gold); }
.body { margin: 0 0 14px; }
.small { font-size: .88rem; color: var(--muted); }
.bul { margin: 0 0 14px; padding-left: 1.3em; }
.bul li { margin-bottom: 6px; }
.bul li::marker { color: var(--gold); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.box { border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: var(--radius); background: #fafbfc; padding: 14px 22px 8px; margin: 20px 0; }
.box > .hd:first-child { margin-top: 4px; border-bottom: 1px solid var(--line-soft); padding-bottom: 6px; }
/* 설문 묶음(척도)별 구분 박스 — 은은한 바탕색 + 굵은 윗선 + 넉넉한 간격 */
.box.sec { background: #f6f8fb; border: 1px solid #c9d3e0; border-top: 4px solid var(--navy); margin: 34px 0; padding: 18px 26px 10px; }
.box.sec > .hd:first-child { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid #c9d3e0; font-size: 1.15rem; color: var(--navy); border-left: 0; padding-left: 0; }
.box.sec .q, .box.sec .lk { background: transparent; }
.box.sec textarea, .box.sec input[type=text], .box.sec input[type=number] { background: #fff; }
/* 진행자 대기 경고: 빨간 바탕 + 흰 글자 + 경고 줄무늬 (움직임 없음) */
.warn {
  position: relative; overflow: hidden; margin: 24px 0 12px; padding: 20px 20px 14px; text-align: center;
  background: var(--red); color: #fff; border: 2px solid #7a150d; border-radius: 8px;
  font-size: 1.12rem; font-weight: 700; line-height: 1.6;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .15), 0 10px 24px rgba(180, 35, 24, .30);
}
.warn strong { display: block; font-size: 1.6rem; font-weight: 900; letter-spacing: -0.01em; margin-bottom: 6px; }
.hero { margin: 8px 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); position: relative; }
.hero::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 72px; height: 3px; background: var(--gold); }
.hero-title { margin: 0 0 8px; font-size: 1.85rem; line-height: 1.35; letter-spacing: -0.02em; color: var(--navy); }
.hero-sub { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* ===== 질문 ===== */
.q { margin: 22px 0 28px; }
.qtext { display: block; font-weight: 600; margin-bottom: 10px; color: var(--navy); }
.err { color: var(--red); font-size: .88rem; margin-top: 4px; }
textarea, input[type=text], input[type=number] {
  width: 100%; border: 1px solid #b8c2cf; border-radius: 4px;
  padding: 10px 14px; font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input[type=text]:focus, input[type=number]:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 37, 64, .1); }
textarea { resize: vertical; }
input.idin { text-transform: uppercase; font-size: 1.15rem; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.idnorm { margin: 6px 0 10px; font-weight: 700; color: var(--navy); }
input[type=radio], input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--navy); cursor: pointer; margin: 0; flex: none; }
.radios { display: flex; flex-direction: column; gap: 10px; }
.radios.row { flex-direction: row; flex-wrap: wrap; gap: 20px; }
.ropt { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cards { display: flex; gap: 14px; flex-wrap: wrap; }
.card {
  flex: 1 1 200px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  cursor: pointer; font-weight: 600; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s;
}
.card:hover { border-color: var(--navy); }
.card:has(input:checked) { background: var(--navy-soft); border-color: var(--navy); box-shadow: inset 3px 0 0 var(--gold); }
.alloc-row { display: grid; grid-template-columns: 1fr 120px 60px; gap: 10px; align-items: center; margin: 8px 0; max-width: 460px; }
.alloc-row input { text-align: right; font-variant-numeric: tabular-nums; }
.alloc-sum { font-weight: 700; margin-top: 6px; color: var(--navy); font-variant-numeric: tabular-nums; }

/* ===== 척도 문항(7점·9점): 큰 숫자 버튼 ===== */
.tscroll { overflow-x: auto; }
.likert-set { margin: 6px 0 14px; }
.lk { padding: 22px 0 18px; border-top: 1px solid var(--line-soft); }
.lk:first-child { border-top: 0; padding-top: 8px; }
.lk-q { font-weight: 600; font-size: 1.08rem; line-height: 1.65; color: var(--ink); margin-bottom: 14px; }
.lk-scale { display: flex; gap: 2px; max-width: 560px; }
.lk-pt { position: relative; flex: 1 1 0; min-width: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 4px; }
.lk-pt input[type=radio] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* 동그라미(구글 폼 선형 배율 스타일): 선택하면 안쪽에 채운 원이 나타남 */
.lk-dot {
  position: relative; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #8493a6; background: #fff;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.lk-dot::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--navy);
  transform: scale(0); transition: transform .12s;
}
.lk-n { font-size: 1rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.2; }
.lk-pt:hover .lk-dot { border-color: var(--navy); background: var(--navy-soft); }
.lk-pt:hover .lk-n { color: var(--navy); }
.lk-pt input[type=radio]:checked ~ .lk-dot { border-color: var(--navy); border-width: 3px; }
.lk-pt input[type=radio]:checked ~ .lk-dot::after { transform: scale(1); }
.lk-pt input[type=radio]:checked ~ .lk-n { color: var(--navy); font-weight: 800; }
.lk-pt input[type=radio]:focus-visible ~ .lk-dot { outline: 2px solid var(--gold); outline-offset: 3px; }
/* 양 끝 문구는 굵게, 가운데 문구는 보조 */
.lk-caps { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 10px; max-width: 560px; font-size: .9rem; line-height: 1.45; }
.lk-caps.two { grid-template-columns: 1fr 1fr; }
.lk-cl, .lk-cr { font-weight: 800; color: var(--ink); font-size: .95rem; }
.lk-cm { font-weight: 500; color: var(--muted); }
.lk-cl { text-align: left; }
.lk-cm { text-align: center; }
.lk-cr { text-align: right; }

/* ===== 재무 표 ===== */
.fin {
  border-collapse: collapse; width: 100%; min-width: 520px; font-size: .92rem; margin: 10px 0 6px;
  font-variant-numeric: tabular-nums; border-bottom: 2px solid var(--navy);
}
.fin th {
  background: var(--navy); color: #fff; border: 0;
  padding: 9px 6px; text-align: center; font-weight: 600; font-size: .86rem; letter-spacing: .02em;
}
.fin td { text-align: center; padding: 7px 6px; border-bottom: 1px solid var(--line-soft); }
.fin tbody tr:nth-child(even) td { background: #f7f9fb; }
.fin td.l, .fin th.l { text-align: left; padding-left: 12px; }
.fin th.vs { border-left: 1px solid rgba(255, 255, 255, .25); }
.fin td.vs { border-left: 1px solid var(--line); }
.fin tbody tr:last-child td { border-bottom: 0; }
.fin .neg { color: var(--red); }
.fin tr.proj td { text-decoration: underline; }
.fn { font-size: .86rem; margin: 2px 0; color: var(--muted); }

/* ===== 로딩 ===== */
.loading { text-align: center; padding: 64px 0; color: var(--muted); }
.spinner { width: 44px; height: 44px; margin: 0 auto 18px; border: 3px solid var(--line-soft); border-top-color: var(--navy); border-radius: 50%; animation: spin 1s linear infinite; }
.bar { height: 6px; border-radius: 3px; background: var(--line-soft); margin: 18px auto 0; max-width: 360px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--navy); animation-name: fill; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fill { to { width: 100%; } }

/* ===== 모바일 ===== */
@media (max-width: 600px) {
  body { padding: 0; background: #fff; font-size: 16px; }
  .container { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { padding: 12px 18px; }
  .page { padding: 22px 18px 8px; }
  .box.sec { padding: 16px 16px 8px; margin: 26px 0; }
  .actions { padding: 16px 18px 28px; }
  .lk-scale { gap: 0; }
  .lk-dot { width: 24px; height: 24px; }
  .lk-n { font-size: .95rem; }
  .lk-caps { font-size: .86rem; gap: 6px; }
  .lk-cl, .lk-cr { font-size: .9rem; }
  .warn { padding: 28px 16px 20px; }
  .warn strong { font-size: 1.4rem; }
  .alloc-row { grid-template-columns: 1fr 100px 50px; }
  .fin { min-width: 480px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .lk-dot, .lk-dot::after { transition: none; } }
