/* calculator.css - 계산기 입력 폼 & 결과 (에디토리얼 모노) */

.calc-page-head { margin-top: 40px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.calc-page-head h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.calc-page-head .lead { margin-top: 12px; color: var(--text-sub); font-size: 16px; line-height: 1.55; }

/* 입력 폼 박스 */
.calc-card-box {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--ink);
  padding: 28px;
}
.calc-card-box h2 { font-size: 18px; font-weight: 800; margin-bottom: 20px; }

/* 탭 */
.calc-tabs { display: flex; gap: 0; margin-top: 24px; border: 1px solid var(--ink); }
.calc-tab {
  flex: 1;
  height: 48px;
  border: none;
  border-right: 1px solid var(--ink);
  background: #fff;
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.calc-tab:last-child { border-right: none; }
.calc-tab.active { background: var(--ink); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.form-row { display: flex; gap: 14px; }
.form-row > .form-group { flex: 1; }
.form-group { margin-bottom: 18px; }
.form-group > label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.form-group .hint { display: block; font-size: 12.5px; color: var(--text-muted); font-weight: 500; margin-top: 6px; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 0;
  transition: border-color .12s, box-shadow .12s;
}
.input-wrap input::placeholder { color: var(--text-muted); font-weight: 500; }
.input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.input-wrap input[type="date"] { font-weight: 600; }
.input-wrap select {
  width: 100%;
  height: 52px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23111' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 16px center;
  font-size: 16px;
  font-weight: 600;
  color: inherit;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.input-wrap select:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.input-wrap.unit input { padding-right: 44px; text-align: right; }
.input-wrap .unit-label { position: absolute; right: 16px; color: var(--text-muted); font-size: 15px; font-weight: 600; pointer-events: none; }

.btn-calc {
  width: 100%;
  height: 56px;
  margin-top: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background .12s, transform .05s;
}
.btn-calc:hover { background: var(--accent-dark); }
.btn-calc:active { transform: scale(.99); }

/* 결과 박스 — 에디토리얼: 블랙 박스 + 포인트색 숫자 */
.result-box {
  margin-top: 24px;
  background: var(--ink);
  padding: 30px 28px;
  color: #fff;
  border-radius: 0;
  display: none;
}
.result-box.show { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-box .result-label { font-size: 14px; color: #9a9a9a; font-weight: 600; letter-spacing: .02em; }
.result-box .result-main { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; color: #fff; }
.result-box .result-main small { font-size: 22px; font-weight: 700; color: var(--accent); }

.result-breakdown { margin-top: 22px; border-top: 1px solid rgba(255,255,255,.18); }
.result-breakdown .row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.result-breakdown .row:last-child { border-bottom: none; }
.result-breakdown .row .k { color: #b8b8b8; }
.result-breakdown .row .v { font-weight: 700; }
.result-breakdown .row.total { font-weight: 800; }
.result-breakdown .row.total .v { color: var(--accent); }
.result-breakdown .row.minus .v { color: #ff9b87; }

.result-note { margin-top: 18px; font-size: 12.5px; color: #9a9a9a; line-height: 1.6; }

/* 상환 스케줄 표 */
.schedule-wrap { display: none; margin-top: 24px; background: #fff; border: 1px solid var(--ink); padding: 24px; }
.schedule-wrap.show { display: block; }
.schedule-title { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.schedule-scroll { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); }
.amort-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.amort-table th, .amort-table td { padding: 10px 12px; text-align: right; white-space: nowrap; }
.amort-table th:first-child, .amort-table td:first-child { text-align: left; }
.amort-table thead th { position: sticky; top: 0; background: var(--ink); color: #fff; font-weight: 700; }
.amort-table tbody tr { border-bottom: 1px solid var(--line); }
.amort-table tbody tr:last-child { border-bottom: none; }
.amort-table tbody tr:nth-child(even) { background: var(--paper); }
.amort-table tbody td { font-weight: 600; }
.amort-table tbody tr.sum { background: var(--accent-soft) !important; }
.amort-table tbody tr.sum td { font-weight: 800; color: var(--accent-dark); }
.schedule-note { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }

/* 경고 박스 */
.alert { margin-top: 16px; padding: 14px 16px; font-size: 14px; font-weight: 600; border-radius: 0; display: none; }
.alert.show { display: block; }
.alert.warn { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #ffd2c8; border-left: 3px solid var(--accent); }
.alert.ok { background: #eef7f1; color: var(--success); border: 1px solid #cfe9d9; border-left: 3px solid var(--success); }
.alert.info { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--ink); }

@media (max-width: 768px) {
  .calc-page-head h1 { font-size: 27px; }
  .calc-card-box { padding: 20px; }
  .form-row { flex-direction: column; gap: 0; }
  .result-box { padding: 24px 20px; }
  .result-box .result-main { font-size: 32px; }
}
