/* ==========================================
   네트제 급여 계산기 — style.css
   파스텔 스카이블루 글래스모피즘 (4대보험 계산기 톤)
   ========================================== */

:root {
  --bg: #dff2ff;
  --bg2: #eef7fd;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --border: #b8d8ef;
  --border2: #93c4e2;
  --text: #1b3f5e;
  --text2: #3d7099;
  --text3: #6f9fba;
  --accent: #2196c9;
  --accent2: #43b0e8;
  --blue: #1976b8;
  --green: #2da44e;
  --red: #d9534f;
  --orange: #d9772a;
  --radius: 14px;
  --radius-sm: 8px;
  --mono: 'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 5%, rgba(168,220,245,0.6) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 85%, rgba(178,228,252,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(255,255,255,0.35) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  position: relative;
  z-index: 1;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text3); font-weight: 400; }

/* ── 헤더 ── */
header { text-align: center; margin-bottom: 32px; padding-top: 12px; }
.header-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(33,150,201,0.1);
  border: 1px solid rgba(33,150,201,0.3);
  color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  padding: 4px 12px; border-radius: 100px; margin-bottom: 14px;
}
h1 {
  font-family: 'Noto Serif KR', 'Noto Sans KR', serif;
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #1b3f5e 0%, #2196c9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.header-sub { color: var(--text3); font-size: 13px; word-break: keep-all; }

/* ── 카드 (글래스) ── */
.card {
  background: var(--card);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 14px rgba(33,150,201,0.08);
  min-width: 0;
}
.card-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text3);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; display: inline-block; width: 3px; height: 14px;
  background: var(--accent); border-radius: 2px;
}

/* ── 레이아웃 ── */
.layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.left-col, .right-col, .results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── 입력 ── */
.input-group { margin-bottom: 14px; }
.card > .input-group:last-child { margin-bottom: 0; }
label, .label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix, .input-suffix {
  position: absolute; color: var(--text3); font-size: 13px; pointer-events: none;
}
.input-prefix { left: 12px; font-family: var(--mono); }
.input-suffix { right: 12px; font-size: 12px; }

input[type="text"], select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px; /* iOS 확대 방지 */
  padding: 10px 40px 10px 32px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input.no-prefix { padding-left: 12px; }
#net-input { font-size: 18px; font-weight: 500; }
select {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  padding: 10px 32px 10px 12px;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237aaec8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input[type="text"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(33,150,201,0.15);
}
input::placeholder { color: var(--text3); opacity: 1; }

.input-hint { font-size: 11px; color: var(--text3); margin-top: 4px; word-break: keep-all; }
.input-error { font-size: 11px; color: var(--red); margin-top: 4px; display: none; }
.input-error.show { display: block; }
.card > .input-error.show { margin: -6px 0 12px; }

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--card-solid); color: var(--text2);
  font-family: inherit; font-size: 12px; padding: 4px 10px; border-radius: 100px; cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── 탭 ── */
.tab-group {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--bg2); padding: 4px; border-radius: var(--radius-sm);
}
.tab-group.three { grid-template-columns: repeat(3, 1fr); }
.tab-btn {
  padding: 8px; border: none; background: transparent; color: var(--text2);
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.tab-btn.active { background: var(--accent); color: #fff; font-weight: 700; }

/* ── 결과: 빈 상태 ── */
.empty-card { text-align: center; color: var(--text3); padding: 48px 20px; }

/* ── 히어로 ── */
.hero-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(226,244,255,0.92) 100%);
  border-color: rgba(33,150,201,0.35);
}
.hero-value {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  color: var(--accent);
}
.hero-value .num { font-size: clamp(32px, 7vw, 44px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.hero-unit { font-size: 18px; font-weight: 700; color: var(--text2); }
.hero-sub { font-size: 13px; color: var(--text3); margin-top: 4px; }

.verify-box {
  margin-top: 16px; padding: 12px 14px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.verify-line { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text2); }
.verify-line b { color: var(--text); font-weight: 500; }
.verify-diff { font-size: 12px; color: var(--orange); margin-top: 4px; font-family: var(--mono); }
.verify-diff.exact { color: var(--green); }
.min-gross-note { font-size: 11px; color: var(--text3); margin-top: 2px; }
.min-gross-note:empty { display: none; }

.hero-cost {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border2);
  font-size: 13px; color: var(--text2);
}
.hero-cost b { font-size: 20px; font-weight: 500; color: var(--orange); }

/* ── 표 ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.data-table td, .data-table th { padding: 9px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td:first-child { color: var(--text); font-weight: 500; word-break: keep-all; }
.data-table td.num, .data-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.data-table th { font-size: 11px; font-weight: 700; color: var(--text3); text-align: left; }
.data-table .row-sub { display: block; font-size: 11px; font-weight: 400; color: var(--text3); word-break: keep-all; }
.data-table tr.muted td { color: var(--text3); font-weight: 400; }
.data-table tr.strong td { font-weight: 700; }
.data-table tr.total td { font-weight: 700; border-top: 1px solid var(--border2); }
.data-table tr.net td { font-weight: 700; color: var(--accent); background: rgba(33,150,201,0.06); }
#deduction-table td:first-child { width: 62%; }
.data-table.compare td:first-child, .data-table.compare th:first-child { width: 46%; }
.data-table .worker { color: var(--blue); }
.data-table .employer { color: var(--orange); }

/* ── 총 인건비 ── */
.cost-breakdown { display: flex; flex-direction: column; gap: 6px; }
.cost-line {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text2);
}
.cost-line.total { background: rgba(217,119,42,0.08); border-color: rgba(217,119,42,0.35); color: var(--text); font-weight: 700; }
.cost-line.total .num { color: var(--orange); }
.cost-ratio { font-size: 12px; color: var(--text3); margin-top: 4px; word-break: keep-all; }
.cost-ratio b { color: var(--text2); }

/* ── 차트 ── */
.chart-wrap { position: relative; height: 210px; display: flex; align-items: center; justify-content: center; }
.donut-center { position: absolute; text-align: center; pointer-events: none; }
.donut-pct { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--accent); line-height: 1; }
.donut-label { font-size: 10px; color: var(--text3); margin-top: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── 연간 ── */
.annual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.annual-item { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; text-align: center; min-width: 0; }
.annual-item.highlight { background: rgba(33,150,201,0.08); border-color: rgba(33,150,201,0.3); }
.annual-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.annual-value { font-size: 15px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.annual-item.highlight .annual-value { color: var(--accent); }

/* ── 안내 ── */
.notice-card { background: rgba(255, 251, 240, 0.9); border-color: #f0d9a8; }
.notice-card .card-title::before { background: var(--orange); }
.notice-list { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--text2); word-break: keep-all; }
.notice-list li { padding-left: 14px; position: relative; }
.notice-list li::before { content: '•'; position: absolute; left: 0; color: var(--orange); }
.notice-list b { color: var(--text); }

/* ── 푸터 ── */
.page-footer {
  margin-top: 28px; text-align: center; font-size: 11px; color: var(--text3);
  display: flex; flex-direction: column; gap: 4px; word-break: keep-all;
}
.page-footer a { color: var(--accent); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.basis { color: var(--text2); }

/* ── 반응형 (모바일 우선 375px) ── */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .container { padding: 16px 14px 40px; }
  .card { padding: 18px 14px; }
  .data-table { font-size: 12px; }
  .data-table td, .data-table th { padding: 8px 4px; }
  .annual-grid { grid-template-columns: 1fr 1fr; }
  .annual-value { font-size: 13px; }
}
