/* 페이노트 (PayNote) 공통 디자인 시스템 - 2026 */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-sub: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --accent: #10b981;
  --accent-soft: #ecfdf5;
  --warn: #ef4444;
  --warn-soft: #fef2f2;
  --orange: #f59e0b;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-width: 320px; color: var(--ink-sub); background: var(--bg);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px; line-height: 1.6; padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.mono { font-family: "IBM Plex Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }

/* 모바일 퍼스트 최적 너비: max-width 680px */
.wrap { max-width: 680px; width: 100%; margin: 0 auto; padding: 0 16px; }

/* 브랜드 상단 네비게이션 */
.nav-bar {
  position: sticky; top: 0; z-index: 50; height: 58px;
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand-link { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; color: var(--ink); }
.brand-badge { width: 28px; height: 28px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.brand-sub { font-size: 10px; color: var(--brand); font-weight: 800; letter-spacing: 0.06em; margin-left: 2px; }
.nav-back-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 700; color: var(--muted);
  transition: all 0.15s ease;
}
.nav-back-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 헤더 타이틀 */
header.page-head { text-align: center; padding: 22px 0 14px; margin-bottom: 14px; }
.page-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 800; margin-bottom: 6px; }
h1.page-title { font-size: clamp(21px, 5.5vw, 27px); font-weight: 900; color: var(--ink); margin: 2px 0 6px; letter-spacing: -0.03em; word-break: keep-all; }
.page-desc { font-size: 13.5px; color: var(--muted); margin: 0; word-break: keep-all; }

/* 패널 카드 */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 18px; margin-bottom: 16px;
}
.panel-title { font-size: 16px; font-weight: 800; color: var(--ink); margin: 0 0 14px; display: flex; align-items: center; gap: 6px; }

/* 입력 폼 */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.field-hint { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.input-box { position: relative; display: flex; align-items: center; }
.input-box input, .input-box select, input[type=date] {
  width: 100%; height: 48px; padding: 0 44px 0 14px; font-size: 16px; font-weight: 700;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-box input:focus, .input-box select:focus, input[type=date]:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.input-box .unit { position: absolute; right: 14px; font-size: 13.5px; font-weight: 700; color: var(--muted); pointer-events: none; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) {
  .row-2 { grid-template-columns: 1fr; }
}

/* 퀵 버튼 태그 */
.quick-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.q-btn {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); background: #f8fafc;
  color: var(--muted); font-size: 11.5px; font-weight: 700; transition: all 0.15s ease;
}
.q-btn:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* 세그먼트 라디오 탭 */
.seg-group { display: flex; gap: 6px; width: 100%; }
.seg-btn {
  flex: 1; padding: 11px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; transition: all 0.15s ease;
}
.seg-btn.active {
  background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* 맥동(Pulse) 메인 실행 버튼 */
@keyframes mainBtnPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35); }
  50% { transform: scale(1.025); box-shadow: 0 8px 26px rgba(37, 99, 235, 0.6); }
}
.btn-calc-main {
  width: 100%; padding: 16px; border-radius: 10px; border: 0;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff;
  font-size: 16.5px; font-weight: 900; letter-spacing: -0.02em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  animation: mainBtnPulse 1.8s infinite ease-in-out;
  transition: transform 0.15s ease;
}
.btn-calc-main:hover { animation-play-state: paused; transform: scale(1.03) translateY(-2px); }
.btn-calc-main small { font-size: 11.5px; font-weight: 500; opacity: 0.9; }

/* 2단계 결과 리포트 히어로 카드 */
.result-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #fff; border-radius: var(--radius); padding: 22px 18px; margin-bottom: 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero-lbl { font-size: 12px; font-weight: 800; color: #93c5fd; letter-spacing: 0.08em; margin-bottom: 2px; }
.hero-amt { font-family: "IBM Plex Mono", monospace; font-size: clamp(28px, 7vw, 40px); font-weight: 900; color: #fff; line-height: 1.15; margin-bottom: 6px; }
.hero-amt small { font-size: 17px; font-weight: 700; color: #bfdbfe; margin-left: 2px; }
.hero-sub { font-size: 13px; color: #dbeafe; line-height: 1.55; }

/* 백분위 상위 게이지 카드 */
.percentile-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.percentile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 4px; }
.percentile-title { font-size: 14px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.percentile-pill { font: 900 12.5px "IBM Plex Mono", monospace; padding: 3px 9px; border-radius: 999px; background: rgba(37, 99, 235, 0.1); color: var(--brand); border: 1px solid var(--brand); }
.percentile-track { width: 100%; height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.percentile-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #10b981); transition: width 0.8s ease; }
.percentile-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 모바일 친화형 키-밸류 내역 리스트 (테이블 가로 스크롤 퇴치) */
.audit-item {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px;
}
.audit-item:last-child { margin-bottom: 0; }
.audit-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.audit-row:last-child { margin-bottom: 0; }
.audit-row strong { color: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 14px; }
.audit-row.highlight { font-weight: 800; color: var(--brand-dark); border-top: 1px dashed #cbd5e1; padding-top: 6px; margin-top: 6px; }
.audit-row.highlight strong { color: var(--brand-dark); font-size: 15px; }

/* 공유 및 복사 액션 버튼군 */
.action-grid { display: grid; gap: 8px; margin: 20px 0; }
.btn-act {
  width: 100%; padding: 14px; border-radius: 8px; font-size: 14.5px; font-weight: 800;
  border: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s ease;
}
.btn-copy { background: #0f172a; color: #f8fafc; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2); }
.btn-copy:hover { background: #1e293b; }
.btn-recalc { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-recalc:hover { border-color: var(--ink); }

/* 카머니랩/페이노트 허브 이동 CTA 버튼 (결과 화면 맥동) */
@keyframes hubCtaPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25); border-color: #2563eb; }
  50% { transform: scale(1.025); box-shadow: 0 8px 24px rgba(37, 99, 235, 0.55); border-color: #3b82f6; }
}
.btn-paynote-hub {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 18px; margin-top: 12px; border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #38bdf8 !important; border: 1.5px solid #38bdf8;
  font-size: 14.5px; font-weight: 900; text-align: center;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.15);
  transition: all 0.2s ease;
}
.btn-paynote-hub:hover { transform: translateY(-2px); color: #fff !important; }
.btn-paynote-hub.pulse { animation: hubCtaPulse 2s infinite ease-in-out; }

/* 노동법 실무 FAQ 아코디언 */
.faq-wrap { margin-top: 24px; }
.faq-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 16px; }
.faq-head { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-q { padding: 12px 0; font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.faq-q:hover { color: var(--brand); }
.faq-arrow { font-size: 10px; color: var(--muted); transition: transform 0.2s ease; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.faq-a-in { padding-bottom: 10px; }
.faq-item.active .faq-arrow { transform: rotate(180deg); color: var(--brand); }
.faq-item.active .faq-a { max-height: 300px; }

/* 1.5초 AI 계산 로딩 모달 */
#aiLoadingModal {
  position: fixed; inset: 0; z-index: 9999; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.loading-box {
  background: #fff; border-radius: 14px; padding: 24px 20px; width: 100%; max-width: 320px; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.loading-spinner {
  width: 44px; height: 44px; border: 4px solid #e2e8f0; border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 16px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.loading-desc { font-size: 12px; color: var(--muted); margin: 0; }

/* 토스트 */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; z-index: 10000; opacity: 0; pointer-events: none;
  transition: all 0.25s ease; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* 푸터 */
footer.paynote-foot {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.7;
}

/* 호환성 클래스 */
.pass { color: var(--accent); font-weight: 700; }
.fail { color: var(--warn); font-weight: 700; }
.note { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.7; }
.note b { color: var(--ink); }
