/* ===== 금융계산기 허브 — 공통 디자인 시스템 ===== */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f0f4f9;
  --text: #14202e;
  --text-soft: #55647a;
  --border: #e2e8f2;
  --brand: #1f6feb;
  --brand-soft: #e8f0ff;
  --accent: #10a37f;
  --danger: #d1425c;
  --shadow: 0 1px 2px rgba(20,32,46,.06), 0 8px 24px rgba(20,32,46,.06);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141c;
    --surface: #161f2b;
    --surface-2: #1d2836;
    --text: #eaf1fa;
    --text-soft: #9fb0c6;
    --border: #263341;
    --brand: #4c8dff;
    --brand-soft: #17263f;
    --accent: #2dd4a7;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 레이아웃 */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(180%) blur(6px);
}
header.site .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--text); }
.logo span { color: var(--brand); }
header.site nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; font-weight: 600; }
header.site nav a { color: var(--text-soft); }

main { padding: 28px 0 60px; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 6px; }
.sub { color: var(--text-soft); margin: 0 0 24px; font-size: 15px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 32px 0 12px; }

/* 카드 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 16px; }

/* 계산기 그리드(홈) */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.tool {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 18px; box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.tool:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.tool .emoji { font-size: 26px; }
.tool .t { font-weight: 700; color: var(--text); margin-top: 8px; font-size: 16px; }
.tool .d { color: var(--text-soft); font-size: 13px; margin-top: 3px; }

/* 폼 */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.field .hint { font-weight: 400; color: var(--text-soft); font-size: 12px; }
.input-row { display: flex; align-items: stretch; }
input[type="number"], input[type="text"], select {
  width: 100%; font-size: 16px; padding: 12px 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; outline: none; transition: border-color .12s;
  font-family: inherit;
}
input:focus, select:focus { border-color: var(--brand); }
.input-row input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-row .suffix {
  display: flex; align-items: center; padding: 0 14px; font-size: 14px; font-weight: 600;
  color: var(--text-soft); background: var(--surface-2);
  border: 1px solid var(--border); border-left: 0;
  border-top-right-radius: 12px; border-bottom-right-radius: 12px; white-space: nowrap;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }
button.calc {
  width: 100%; font-size: 16px; font-weight: 700; color: #fff; background: var(--brand);
  border: 0; border-radius: 12px; padding: 14px; cursor: pointer; margin-top: 6px;
  transition: filter .12s;
}
button.calc:hover { filter: brightness(1.06); }

/* 결과 */
.result { margin-top: 22px; }
.result .headline {
  text-align: center; padding: 20px; background: var(--brand-soft);
  border-radius: 14px; margin-bottom: 16px;
}
.result .headline .label { font-size: 14px; color: var(--text-soft); font-weight: 600; }
.result .headline .big {
  font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--brand); margin-top: 4px;
}
.breakdown { width: 100%; border-collapse: collapse; font-size: 15px; }
.breakdown tr { border-bottom: 1px solid var(--border); }
.breakdown tr:last-child { border-bottom: 0; }
.breakdown td { padding: 11px 2px; }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.breakdown .minus td:last-child { color: var(--danger); }
.breakdown .total td { font-weight: 800; font-size: 16px; padding-top: 14px; }
.breakdown .total { border-top: 2px solid var(--border); }

/* 광고 슬롯 */
.ad-slot {
  margin: 24px 0; min-height: 90px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 12px; color: var(--text-soft);
  font-size: 12px; background: var(--surface-2);
}

/* 정보/면책 */
.note { font-size: 13px; color: var(--text-soft); }
.disclaimer {
  margin-top: 28px; padding: 14px 16px; font-size: 12.5px; color: var(--text-soft);
  background: var(--surface-2); border-radius: 12px; line-height: 1.7;
}
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--text-soft); }

footer.site {
  border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px;
  font-size: 13px; color: var(--text-soft);
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
footer.site a { color: var(--text-soft); }
.crumbs { font-size: 13px; color: var(--text-soft); margin-bottom: 4px; }
