/* Hệ thống biến màu Sáng/Tối, font chữ và nhịp khoảng trắng chuẩn HuyForum */
/* Hỗ trợ tương phản WCAG >= 4.5:1 và bề mặt 3 tầng học thuật */

:root {
  --bg: #F7F9F8;
  --surface: #FFFFFF;
  --surface-2: #EEF3F0;
  --surface-warm: #FAF7F0;
  --border: #D9E4DE;
  --border-strong: #B8C9C0;
  --text: #111827;
  --text-soft: #4B5563;
  --primary: #0F5132;
  --primary-hover: #0B3E26;
  --primary-soft: #E6F2EC;
  --primary-border: #9CC7B1;
  --primary-ink: #FFFFFF;
  --success: #15803D;
  --success-soft: #E8F7EE;
  --success-border: #86EFAC;
  --danger: #B91C1C;
  --danger-soft: #FEECEC;
  --danger-border: #FCA5A5;
  --warning: #B45309;
  --warning-soft: #FEF3C7;
  --warning-border: #FCD34D;
  --accent: #0E7490;
  --accent-soft: #ECFEFF;
  --accent-border: #A5F3FC;
  --shadow-sm: 0 2px 10px rgba(15, 81, 50, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 81, 50, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --font-sans: 'Be Vietnam Pro', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0C1412;
  --surface: #13201C;
  --surface-2: #182924;
  --surface-warm: #1B2B26;
  --border: #253D35;
  --border-strong: #37574C;
  --text: #ECF3F0;
  --text-soft: #9FB3AB;
  --primary: #2DD4A3;
  --primary-hover: #22B98D;
  --primary-soft: rgba(45, 212, 163, 0.14);
  --primary-border: rgba(45, 212, 163, 0.42);
  --primary-ink: #06241B;
  --success: #4ADE80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --success-border: rgba(74, 222, 128, 0.4);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.16);
  --danger-border: rgba(248, 113, 113, 0.45);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.15);
  --warning-border: rgba(251, 191, 36, 0.45);
  --accent: #38BDF8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-border: rgba(56, 189, 248, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
}

h1 {
  font-size: clamp(1.45rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h2 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

p {
  margin: 0;
}

button, input, select, textarea {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.text-soft {
  color: var(--text-soft);
}

.text-sm {
  font-size: 0.85rem;
}

.font-bold {
  font-weight: 700;
}
