/* ==========================================================================
   FireNet — ۰۲ پایه
   فونت، ریست، تایپوگرافی، اسکرول‌بار، فوکوس.
   ========================================================================== */

/* --- چهار وزن واقعی ---
   قبلاً فقط Vazirmatn-Regular لوکال بود و همهٔ fw-bold/fw-semibold با
   bold مصنوعی مرورگر رندر می‌شدند (باگ ۶). فرمت woff2 کافی است؛
   از ۲۰۱۶ فراگیر است. */
@font-face {
  font-family: "Vazirmatn";
  src: url("../../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../../fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background-color: hsl(var(--fn-background));
  color: hsl(var(--fn-foreground));
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* اعداد هم‌عرض تا ستون‌های جدول هنگام تغییر مقدار نلرزند */
.table td,
.table th {
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: hsl(var(--fn-foreground));
  letter-spacing: -0.01em;
}

a {
  text-decoration: none;
}

/* --- فوکوس‌رینگ واحد ---
   قبلاً .form-control:focus دوبار با مقادیر متفاوت تعریف شده بود
   (style.css خط ۱۷۳ آبی بوت‌استرپ، خط ۴۵۶ ایندیگو) — باگ ۱۲. */
:focus-visible {
  outline: 2px solid hsl(var(--fn-ring));
  outline-offset: 2px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: hsl(var(--fn-ring));
  box-shadow: 0 0 0 3px hsl(var(--fn-ring) / 0.18);
}

/* --- اسکرول‌بار باریک، مثل PasarGuard --- */
* {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--fn-border)) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: hsl(var(--fn-border));
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--fn-muted-foreground) / 0.5);
}

/* --- احترام به تنظیم کاهش حرکت سیستم‌عامل --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
