/* 대출·이자 계산기 */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --slate: #475569;
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif; font-size: 14px; }

.wrap { max-width: 100%; padding: 0 0 60px; }

.top { padding: 20px 0 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px; flex-shrink: 0;
  background: linear-gradient(135deg, #1e40af, #0891b2);
  border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px;
}
h1 { font-size: 22px; font-weight: 700; }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── 2컬럼 그리드 ── */
.main-grid { display: grid; grid-template-columns: 340px 1fr; gap: 12px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

/* ── 상환방식 탭 ── */
.type-row { display: flex; gap: 4px; margin-bottom: 18px; }
.type-btn {
  flex: 1; padding: 9px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--bg); cursor: pointer; font-size: 12px; font-weight: 700;
  color: var(--muted); transition: all .12s; text-align: center;
}
.type-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── 폼 ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px;
  font-size: 14px; outline: none; transition: border-color .12s; background: var(--card);
}
.form-group input:focus, .form-group select:focus { border-color: var(--blue); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-calc {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--blue), #0891b2);
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity .12s;
}
.btn-calc:hover { opacity: .9; }

/* ── 결과 요약 ── */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.summary-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 14px; text-align: center; }
.sb-val { font-size: 18px; font-weight: 800; color: var(--blue); word-break: break-all; }
.sb-label { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── 상환 스케줄 ── */
.schedule-wrap { max-height: 320px; overflow-y: auto; }
.schedule-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.schedule-table th {
  padding: 8px 10px; background: #f1f5f9; text-align: right;
  font-weight: 700; color: var(--muted); position: sticky; top: 0; border-bottom: 1px solid var(--line);
}
.schedule-table th:first-child { text-align: center; }
.schedule-table td { padding: 7px 10px; text-align: right; border-bottom: 1px solid #f1f5f9; }
.schedule-table td:first-child { text-align: center; color: var(--muted); }
.schedule-table tr:hover td { background: #f0f9ff; }
.schedule-table tfoot td { font-weight: 700; background: #eff6ff; border-top: 2px solid #bfdbfe; }

/* ── 그래프 ── */
.chart-wrap { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
.pie-wrap { flex-shrink: 0; }
.pie-labels { display: flex; flex-direction: column; gap: 6px; }
.pie-label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pie-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* ── 사용 안내 섹션 공통 ── */
.guide-section {
  margin-top: 24px; background: rgba(246,248,255,.6);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.guide-section h2 { font-size: 15px; font-weight: 800; margin: 0 0 10px; color: var(--ink); }
.guide-section h2:not(:first-child) { margin-top: 18px; }
.guide-steps, .guide-features, .guide-usecase {
  margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8;
}
.guide-steps li, .guide-features li, .guide-usecase li { margin-bottom: 4px; }
.guide-steps strong, .guide-features strong { color: var(--ink); }
.guide-privacy {
  margin-top: 16px; background: #eff6ff; border: 1px solid rgba(37,99,235,.22);
  border-radius: 12px; padding: 12px 14px; font-size: 12px; color: #1e40af; line-height: 1.55;
}

@media (max-width: 680px) {
  .main-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
}
