@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1b2420;
  --body-text: #3a4440;
  --muted: #767f7a;
  --line: #e2ddd3;
  --accent: #0f6e5f;
  --accent-ink: #0a4e43;
  --accent-soft: #e8f2ef;
  --warn: #a15c1f;
  --warn-soft: #fbf1e6;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
          'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181a;
    --surface: #1c2225;
    --ink: #ece9e2;
    --body-text: #c9d1cc;
    --muted: #8b938e;
    --line: #303a37;
    --accent: #3fb39c;
    --accent-ink: #7fd4c1;
    --accent-soft: #1c3330;
    --warn: #d99a55;
    --warn-soft: #2e2419;
  }
}

* { box-sizing: border-box; }

/* [hidden] 이 display:flex/grid 를 쓰는 클래스와 같은 요소에 같이 붙으면,
   저작 스타일시트끼리는 특정성이 아니라 등장 순서로 우선순위가 갈려서
   [hidden]이 무시되는 경우가 흔하다(실측 — .field-group[hidden]이 그대로
   보임). !important로 확실히 이긴다. */
[hidden] { display: none !important; }

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body-text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* 한글은 word-break 기본값(normal)이면 아무 글자에서나 줄바꿈해 "있는"이
     "있"+"는"으로 잘리는 식으로 단어 중간이 끊긴다. keep-all로 띄어쓰기
     단위로만 줄바꿈되게 한다(실측 — text-wrap:balance만으로는 안 막힘). */
  word-break: keep-all;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding-inline: 20px;
}

a { color: var(--accent-ink); }

/* ── 헤더 ───────────────────────────────────────────────── */

.site-header {
  padding-block: 40px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: balance;
}

/* ── 폼 ─────────────────────────────────────────────────── */

main.wrap { padding-block: 32px 60px; }

.notice {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.profile-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label,
.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.field-group input[type="number"] {
  font: inherit;
  font-size: 16px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  max-width: 260px;
  width: 100%;
}

.field-group input[type="number"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--body-text);
  cursor: pointer;
}

.radio-row input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.submit-btn {
  margin-top: 4px;
  padding: 14px 20px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}

.submit-btn:hover { background: var(--accent-ink); }
.submit-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── 결과 ───────────────────────────────────────────────── */

.results-section { margin-top: 32px; }

.results-summary {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px;
}

.results-empty {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14.5px;
}

#results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 20px 22px;
}

.result-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.result-category {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.result-card-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.result-summary {
  margin: 0 0 8px;
  font-size: 14.5px;
  color: var(--body-text);
}

.result-detail {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.result-amount {
  margin: 0 0 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.result-caveat {
  margin: 0 0 14px;
  padding: 9px 12px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  border-radius: 8px;
}

.result-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.result-links a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* ── 푸터 ───────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 24px 40px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p { margin: 0 0 6px; }
.update-note { color: var(--muted); opacity: 0.8; }

/* ── 모바일 ─────────────────────────────────────────────── */

@media (max-width: 480px) {
  .tagline { font-size: 21px; }
  .profile-form { padding: 22px 18px; }
  .field-group input[type="number"] { max-width: 100%; }
}
