/* ============================================================
   BACFUTURES CRM V2.0 — base.css
   Reset, body, typography base, scrollbar
   Digi-system mục 1.3 typography, mục 6 font
   ============================================================ */

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--bac-font-sans);
  font-size: var(--bac-text-base);
  font-weight: var(--bac-fw-normal);
  line-height: var(--bac-lh-normal);
  color: var(--bac-text-primary);
  background: var(--bac-surface-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Typography base ── */
h1 {
  font-size: var(--bac-text-xl);
  font-weight: var(--bac-fw-semibold);
  line-height: var(--bac-lh-tight);
  letter-spacing: var(--bac-ls-tight);
  color: var(--bac-text-primary);
}

h2 {
  font-size: var(--bac-text-lg);
  font-weight: var(--bac-fw-semibold);
  line-height: var(--bac-lh-tight);
  letter-spacing: var(--bac-ls-tight);
  color: var(--bac-text-primary);
}

h3 {
  font-size: var(--bac-text-md);
  font-weight: var(--bac-fw-semibold);
  line-height: var(--bac-lh-snug);
  color: var(--bac-text-primary);
}

p {
  font-size: var(--bac-text-base);
  line-height: var(--bac-lh-normal);
  color: var(--bac-text-primary);
}

small {
  font-size: var(--bac-text-xs);
}

code,
pre {
  font-family: var(--bac-font-mono);
  font-size: var(--bac-text-sm);
}

a {
  color: var(--bac-brand);
  text-decoration: none;
  transition: color var(--bac-duration-instant) var(--bac-ease-standard);
}

a:hover {
  color: var(--bac-brand-hover);
}

/* ── Form element reset ── */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bac-outline-variant);
  border-radius: var(--bac-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bac-text-disabled);
}

/* ── Selection ── */
::selection {
  background: var(--bac-brand-light);
  color: var(--bac-brand);
}

/* ── Focus-visible global (WCAG 2.2 — 2.4.7) ── */
:focus-visible {
  outline: none;
  box-shadow: var(--bac-glow-focus);
  border-radius: var(--bac-radius-sm);
}