/* =========================================================
   shared.css — 유용한 계산기 공통 스타일
   색상은 각 페이지 <style> 블록의 CSS 변수로 오버라이드
   ========================================================= */

/* ── 기본값 (파란 테마 = 직장인 계산기 기준) ────────────── */
:root {
  --accent:            #1a56db;
  --accent-dark:       #1445b7;
  --sidebar-hover-bg:  #f0f4ff;
  --accent-light:      #e8f0fe;
  --result-bg:         #f0f4ff;
  --result-border:     #b6ccf8;
  --result-row-border: #dde8fc;
}

/* ── 리셋 ───────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  background: #f5f6fa;
  color: #222;
}

/* ── 레이아웃 ───────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.main { flex: 1; padding: 32px 36px; overflow-y: auto; }

/* ── 사이드바 ───────────────────────────────────────────── */
.sidebar-header { padding: 24px 20px 16px; border-bottom: 1px solid #f0f0f0; }
.sidebar-header h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.3px;
}
.sidebar-header p { font-size: 12px; color: #888; margin-top: 3px; }

.sidebar-nav { flex: 1; overflow-y: auto; }
.sidebar-section { padding: 14px 12px 6px; }
.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 4px;
}

.sidebar-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 7px;
  font-size: 14px;
  color: #444;
  transition: background 0.15s;
}
.sidebar-btn:hover { background: var(--sidebar-hover-bg); color: var(--accent); }
.sidebar-btn.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* ── 홈 버튼 (사이드바 헤더 상단) ──────────────────────── */
.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.home-btn:hover { opacity: 1; }

/* ── 사이드바 하단 (rates 배지) ─────────────────────────── */
.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid #f0f0f0;
}
.rates-info {
  font-size: 11px;
  color: #bbb;
  padding: 4px 12px;
  line-height: 1.5;
}

/* ── 메인 헤더 ──────────────────────────────────────────── */
.calc-header { margin-bottom: 28px; }
.calc-header h2 { font-size: 22px; font-weight: 700; color: #111; }
.calc-header p { font-size: 14px; color: #666; margin-top: 6px; line-height: 1.5; }

/* ── 폼 ─────────────────────────────────────────────────── */
.calc-form {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  max-width: 640px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  color: #222;
  transition: border-color 0.15s;
  background: #fafafa;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.form-hint { font-size: 12px; color: #999; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── 버튼 ───────────────────────────────────────────────── */
.calc-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s;
}
.calc-btn:hover { background: var(--accent-dark); }
.calc-btn-reset { background: #f0f0f0; color: #555; margin-left: 10px; }
.calc-btn-reset:hover { background: #e0e0e0; color: #333; }

/* ── 결과 박스 ──────────────────────────────────────────── */
.result-box {
  background: var(--result-bg);
  border: 1.5px solid var(--result-border);
  border-radius: 10px;
  padding: 22px 24px;
  margin-top: 22px;
  max-width: 640px;
}
.result-box h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--result-row-border);
  font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: #555; }
.result-row .value { font-weight: 600; color: #222; text-align: right; }
.result-row.highlight .label { color: var(--accent); font-weight: 700; }
.result-row.highlight .value { color: var(--accent); font-size: 17px; font-weight: 800; }

/* ── 안내 박스 ──────────────────────────────────────────── */
.info-box {
  background: #fff8e1;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 13px;
  color: #78350f;
  max-width: 640px;
  line-height: 1.6;
}
.info-box strong { font-weight: 700; }

/* ── 계산기 패널 ────────────────────────────────────────── */
.calc-panel { display: none; }
.calc-panel.active { display: block; }

/* ── 웰컴 화면 ──────────────────────────────────────────── */
.welcome { text-align: center; padding: 60px 20px; }
.welcome-icon { font-size: 48px; margin-bottom: 16px; }
.welcome h2 { font-size: 22px; font-weight: 700; color: #222; margin-bottom: 8px; }
.welcome p { font-size: 15px; color: #888; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 32px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.quick-card {
  background: #fff;
  border: 1.5px solid #e8edf5;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}
.quick-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.quick-card .icon { font-size: 22px; margin-bottom: 8px; }
.quick-card .name { font-size: 14px; font-weight: 600; color: #333; }
.quick-card .desc { font-size: 12px; color: #999; margin-top: 3px; }

/* ── 모바일 ─────────────────────────────────────────────── */
.mobile-menu-btn { display: none; }

@media (max-width: 700px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e0e0e0; }
  .sidebar-nav { display: none; }
  .sidebar-nav.open { display: block; }
  .sidebar-footer { display: none; }
  .mobile-menu-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  .main { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .calc-form { padding: 18px; }
}

/* ── 푸터 ───────────────────────────────────────────────── */
.site-footer {
  margin-top: 56px;
  padding: 28px 0 20px;
  border-top: 1px solid #e8edf5;
  text-align: center;
  max-width: 640px;
}
.footer-coffee-msg {
  font-size: 14px;
  color: #666;
  margin-bottom: 14px;
}
.coffee-btn {
  display: inline-block;
  padding: 11px 24px;
  background: #FFDD00;
  color: #333;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.12s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}
.coffee-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.footer-contact {
  margin-top: 16px;
  font-size: 13px;
  color: #888;
}
.footer-contact a {
  color: #888;
  text-decoration: none;
}
.footer-contact a:hover { text-decoration: underline; color: #555; }
.footer-policy {
  margin-top: 8px;
  font-size: 12px;
  color: #bbb;
}
.footer-policy a { color: #bbb; text-decoration: none; }
.footer-policy a:hover { color: #888; }
.footer-divider { margin: 0 6px; }

/* index.html 전용 — 전체 폭 footer */
.index-footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  text-align: center;
  border-top: 1px solid #e8edf5;
}
