/* 다음칸 디자인 시스템
   방향: 실패가 아니라 이동 과정. 차분하고 실무적, 과장 없음.
   기본 뉴트럴 그레이 / 신뢰=딥네이비 / 성공·희망=민트 / 경고=앰버 / 실패=레드(관문초과에만) */

:root {
  --navy-900: #0f1b2d;
  --navy-700: #1e3a5f;
  --navy-500: #3b5f82;
  --gray-900: #1a1d21;
  --gray-700: #4b5158;
  --gray-500: #767c85;
  --gray-300: #d3d7dc;
  --gray-100: #f4f5f7;
  --gray-50: #fafbfc;
  --white: #ffffff;
  --mint-600: #0d9488;
  --mint-100: #d9f5f0;
  --amber-600: #b45309;
  --amber-100: #fef1da;
  --red-600: #c0362c;
  --red-100: #fbe4e1;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 27, 45, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 27, 45, 0.10);
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-900);
  background: var(--gray-50);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}
.logo {
  font-weight: 700;
  font-size: 20px;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}
.main-nav {
  display: flex;
  gap: 20px;
  flex: 1;
}
.main-nav a {
  padding: 10px 4px;
  color: var(--gray-700);
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.main-nav a.active, .main-nav a:hover { color: var(--navy-900); border-color: var(--navy-700); }
.nav-right { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-toggle { display: none; background: none; border: none; font-size: 22px; min-width: 44px; min-height: 44px; }

.btn-ghost, .btn-primary-sm {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.btn-ghost { color: var(--gray-700); }
.btn-primary-sm { background: var(--navy-900); color: var(--white); }

@media (max-width: 720px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 8px 20px 16px;
    border-bottom: 1px solid var(--gray-300);
    gap: 4px;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-right a:not(.btn-primary-sm):not(.btn-ghost) { display: none; }
}

/* ---------- Layout helpers ---------- */

.container { max-width: 1080px; margin: 0 auto; padding: 32px 20px 80px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }

h1, h2, h3 { color: var(--gray-900); letter-spacing: -0.02em; font-weight: 500; }
h1 { font-size: 26px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 32px 0 12px; }
.section-desc { color: var(--gray-500); font-size: 14px; margin-bottom: 20px; }

.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 15px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-900);
  cursor: pointer;
  min-height: 44px;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 16px; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-choice {
  flex: 1 1 30%;
  min-width: 120px;
  padding: 18px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  min-height: 56px;
}
.btn-choice:hover, .btn-choice.selected { border-color: var(--navy-700); background: var(--gray-100); }

/* ---------- Cards ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* PolicyCard */
.policy-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.policy-card:hover { box-shadow: var(--shadow-md); border-color: var(--navy-500); }
.policy-card.is-closed { opacity: 0.55; }
.policy-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.policy-card-title { font-size: 17px; font-weight: 500; color: var(--gray-900); margin: 0 0 4px; }
.policy-card-agency { font-size: 13px; color: var(--gray-500); }
.policy-card-amount { font-size: 15px; font-weight: 500; color: var(--navy-700); margin-top: 8px; }
.dday {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.dday-normal { background: var(--gray-100); color: var(--gray-700); }
.dday-soon { background: var(--amber-100); color: var(--amber-600); }
.dday-closed { background: var(--gray-100); color: var(--gray-500); text-decoration: line-through; }

/* StatusBadge / OutcomeBadge */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-open { background: var(--mint-100); color: var(--mint-600); }
.badge-always { background: var(--mint-100); color: var(--mint-600); }
.badge-closed { background: var(--gray-100); color: var(--gray-500); }
.badge-recheck { background: var(--amber-100); color: var(--amber-600); }
.badge-abolished { background: var(--red-100); color: var(--red-600); }
.badge-approved { background: var(--mint-100); color: var(--mint-600); }
.badge-rejected { background: var(--gray-100); color: var(--gray-700); }
.badge-pending { background: var(--amber-100); color: var(--amber-600); }

/* TrustMeta */
.trust-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-500);
}
.trust-meta.stale { color: var(--amber-600); }
.trust-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint-600); }
.trust-meta.stale .trust-dot { background: var(--amber-600); }

/* GateRow */
.gate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid transparent;
}
.gate-row.pass { background: var(--mint-100); }
.gate-row.fail { background: var(--red-100); }
.gate-row.skip { background: var(--gray-100); color: var(--gray-500); }
.gate-row-label { font-weight: 500; font-size: 14px; }
.gate-row-detail { font-size: 13px; text-align: right; }
.gate-row.pass .gate-row-detail { color: var(--mint-600); }
.gate-row.fail .gate-row-detail { color: var(--red-600); }

/* StatSummary */
.stat-summary { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--gray-700); }
.stat-summary strong { font-size: 18px; color: var(--gray-900); }

/* TagGrid */
.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-btn {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}
.tag-btn.selected { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }

/* ---------- Forms ---------- */

label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--gray-700); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-300);
  font-size: 15px;
  font-family: var(--font);
  background: var(--white);
  min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-700); outline-offset: 1px; }
.field { margin-bottom: 18px; }
.field-hint { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--gray-500); font-size: 14px; }

/* ---------- Diagnosis wizard ---------- */

.wizard-progress { height: 4px; background: var(--gray-300); border-radius: 2px; margin-bottom: 24px; overflow: hidden; }
.wizard-progress-bar { height: 100%; background: var(--navy-700); transition: width .3s ease; }
.wizard-step-label { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; }
.wizard-question { font-size: 20px; font-weight: 500; margin-bottom: 24px; }

/* ---------- Calculator headline ---------- */

.calc-headline {
  text-align: center;
  padding: 28px 20px;
  background: linear-gradient(180deg, var(--white), var(--gray-50));
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  margin-bottom: 24px;
}
.calc-headline-label { font-size: 14px; color: var(--gray-500); margin-bottom: 6px; }
.calc-headline-value { font-size: 32px; font-weight: 500; color: var(--navy-900); }
.calc-headline-sub { font-size: 13px; color: var(--gray-500); margin-top: 6px; }
.calc-verdict {
  text-align: center;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 500;
  margin-bottom: 20px;
}
.calc-verdict.pass { background: var(--mint-100); color: var(--mint-600); }
.calc-verdict.fail { background: var(--red-100); color: var(--red-600); }

/* ---------- Outcome share ---------- */

.choice-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .choice-3 { grid-template-columns: 1fr; } }

/* ---------- Community ---------- */

.post-row { display: flex; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--gray-300); gap: 12px; }
.post-title { font-weight: 500; }
.post-meta { font-size: 13px; color: var(--gray-500); }

/* ---------- Empty state ---------- */

.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-500); }

/* ---------- Alerts ---------- */

.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 16px; }
.alert-info { background: var(--gray-100); color: var(--gray-700); }
.alert-warn { background: var(--amber-100); color: var(--amber-600); }
.alert-error { background: var(--red-100); color: var(--red-600); }
.alert-success { background: var(--mint-100); color: var(--mint-600); }

/* ---------- Disclaimer ---------- */

.disclaimer { font-size: 12px; color: var(--gray-500); border-top: 1px solid var(--gray-300); padding-top: 12px; margin-top: 20px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-900); color: var(--gray-300); padding: 32px 0 40px; margin-top: 60px; }
.footer-line { color: var(--white); font-weight: 500; margin: 0 0 6px; }
.footer-disclaimer { font-size: 13px; color: var(--gray-300); max-width: 640px; }
.footer-nav { display: flex; gap: 16px; margin: 16px 0; }
.footer-nav a { font-size: 13px; color: var(--gray-300); }
.copyright { font-size: 12px; color: var(--gray-500); }

/* ---------- Accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

a:focus-visible, button:focus-visible, .btn:focus-visible, .btn-choice:focus-visible, .tag-btn:focus-visible {
  outline: 2px solid var(--navy-700);
  outline-offset: 2px;
}
