/* 홈와트 — 공통 스타일 (HomeWatt Utility Precision 리디자인) */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css');

:root {
  --bg: #f9f9ff;            /* 살짝 파란빛 흰색 (main surface) */
  --surface-alt: #f0f3ff;   /* 입력창·표 헤더 등 옅은 tonal 배경 */
  --surface-tint: #e7eeff;  /* 아이콘 칩 배경 */
  --card: #ffffff;
  --text: #111c2d;
  --muted: #57646e;
  --line: #e3e8f3;
  --accent: #0f766e;
  --accent-soft: #d6f5ef;
  --accent-dark: #005c55;
  --bolt: #14b8a6;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #ba1a1a;
  --danger-soft: #ffdad6;
  --danger-on: #93000a;
  --radius: 0.75rem;        /* 12px 카드 */
  --radius-sm: 0.5rem;      /* 8px 입력·디테일 */
  --shadow: 0 1px 3px rgba(15, 118, 110, 0.05), 0 1px 2px rgba(15, 118, 110, 0.04);
  --shadow-hover: 0 8px 24px rgba(15, 118, 110, 0.10);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Hanken Grotesk", "Pretendard Variable", Pretendard, -apple-system,
    BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

/* 헤더 (glassmorphism) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(249, 249, 255, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent-dark);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo .watt { color: var(--accent); }
.logo .bolt {
  width: 1em;
  height: 1em;
  fill: var(--accent);
  vertical-align: -0.12em;
}
.gnb { display: flex; gap: 20px; }
.gnb a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.gnb a:hover { color: var(--accent); }

/* 본문 */
main.wrap { padding: 102px 20px 96px; }
h1 {
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 10px;
}
h1 u, h1 .under {
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 1px;
}
.subtitle { color: var(--muted); margin: 0 0 64px; font-size: 1.05rem; }
h2 { font-size: 1.4rem; font-weight: 700; margin: 64px 0 16px; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 28px 0 10px; }
p { margin: 12px 0; }
small, .fineprint { color: var(--muted); font-size: 0.8rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}

/* 폼 */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; margin-left: 4px; }
input[type="number"], select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface-alt);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input[type="number"]:focus, select:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* 토글형 라디오 (세그먼트) */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.seg input[type="radio"] { display: none; }
.seg label {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  background: #fff;
  margin: 0;
  transition: all 0.2s ease;
}
.seg label:hover { border-color: var(--accent); color: var(--accent); }
.seg input[type="radio"]:checked + label {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.20);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn:active { transform: translateY(0); }

/* 결과 */
.result {
  display: none;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}
.result.show { display: block; }
.result .big {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: -0.02em;
  margin: 2px 0;
}
.result .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(15, 118, 110, 0.25);
  font-size: 0.92rem;
}
.result .row:last-child { border-bottom: none; }
.result .row b { font-weight: 700; }

.notice {
  background: var(--warn-soft);
  border-left: 4px solid var(--warn);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin: 16px 0;
}
.notice.red { background: var(--danger-soft); border-left-color: var(--danger); }

/* 누진 구간 시각화 바 */
.tier-bar {
  display: flex;
  height: 34px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0 4px;
  border: 1px solid var(--line);
}
.tier-bar .seg1 { background: #99f6e4; }
.tier-bar .seg2 { background: #fcd34d; }
.tier-bar .seg3 { background: #fca5a5; }
.tier-bar > div {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.tier-legend { display: flex; gap: 14px; font-size: 0.75rem; color: var(--muted); flex-wrap: wrap; }
.tier-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px;
}

/* 표 */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 14px 0; border-radius: var(--radius-sm); overflow: hidden; }
th, td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
th { background: var(--surface-tint); font-weight: 700; }
td.num, th.num { text-align: right; }
tbody tr:nth-child(even) { background: var(--surface-alt); }

/* 도구 목록 (허브) */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin: 28px 0; }
@media (min-width: 560px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
.tool-card {
  position: relative;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(15, 118, 110, 0.35);
}
.tool-card .emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.tool-card b { display: block; margin: 0 0 6px; font-size: 1.1rem; font-weight: 600; }
.tool-card span { color: var(--muted); font-size: 0.9rem; }
.tool-card .badge {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-block;
  background: var(--danger-soft);
  color: var(--danger-on);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 0;
}

/* 광고/제휴 슬롯 */
.ad-slot {
  min-height: 120px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b6c0d6;
  font-size: 0.75rem;
  margin: 32px 0;
  background: var(--surface-alt);
}
.partner-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}
.partner-box b { font-size: 0.95rem; }
.partner-box ul { margin: 8px 0 4px; padding-left: 18px; font-size: 0.9rem; }
.partner-box .disclosure { color: var(--muted); font-size: 0.72rem; margin-top: 8px; }

/* FAQ */
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 20px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}
.faq summary {
  font-weight: 600;
  cursor: pointer;
  padding: 16px 28px 16px 0;
  font-size: 0.98rem;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%) rotate(0deg);
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2357646e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  transition: transform 0.3s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(180deg); }
.faq details p { font-size: 0.92rem; color: #334155; padding-bottom: 6px; }

/* 푸터 */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 40px 0 48px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 40px;
}
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 600; transition: color 0.2s ease; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 480px) {
  main.wrap { padding: 56px 20px 64px; }
  .subtitle { margin-bottom: 40px; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.25rem; margin-top: 48px; }
  .subtitle { font-size: 0.98rem; }
  .gnb { display: none; }
  .card, .tool-card { padding: 22px; }
}
