@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'VazirmatnDigits';
  src: url('fonts/VazirmatnDigits-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039;
}

:root {
  --bg: #F7F8F7;
  --surface: #FFFFFF;
  --surface-subtle: #F2F4F2;
  --text: #111311;
  --text-secondary: #606760;
  --text-muted: #8A908B;
  --border: #E7EAE7;

  --success: #16A34A;
  --warning: #D97706;
  --error: #DC2626;
  --info: #2563EB;

  --shadow-float: 0 12px 32px -12px rgba(17,19,17,0.18);

  --radius-input: 8px;
  --radius-button: 8px;
  --radius-card: 12px;
  --radius-modal: 16px;
  --radius-badge: 6px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --control-height: 44px;
  --control-height-sm: 36px;

  --ease: cubic-bezier(0.4,0,0.2,1);
  --motion-micro: 150ms;
  --motion-macro: 220ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0D0C;
    --surface: #111412;
    --surface-subtle: #171B18;
    --text: #F2F4F2;
    --text-secondary: #A0A6A1;
    --text-muted: #747B75;
    --border: #252A26;

    --success: #22C55E;
    --warning: #F59E0B;
    --error: #F87171;
    --info: #60A5FA;

    --shadow-float: 0 12px 32px -12px rgba(0,0,0,0.55);
  }
}

:root[data-theme="dark"] {
  --bg: #0B0D0C;
  --surface: #111412;
  --surface-subtle: #171B18;
  --text: #F2F4F2;
  --text-secondary: #A0A6A1;
  --text-muted: #747B75;
  --border: #252A26;

  --success: #22C55E;
  --warning: #F59E0B;
  --error: #F87171;
  --info: #60A5FA;

  --shadow-float: 0 12px 32px -12px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }

*, *::before, *::after {
  transition: background-color var(--motion-macro) var(--ease), border-color var(--motion-macro) var(--ease),
    color var(--motion-macro) var(--ease), box-shadow var(--motion-macro) var(--ease);
}

:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'VazirmatnDigits', 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  direction: rtl;
}

body, input, button, select, textarea { font-variant-numeric: tabular-nums; }
input, button, select, textarea { font-family: inherit; }

:where(button) { color: inherit; }
:where(a) { color: var(--brand-text, var(--brand-strong)); }
:where(h1, h2, h3, h4, h5, h6, p, label, legend, th, td, li, dt, dd) { color: inherit; }

h1:focus, h2:focus, h3:focus, [tabindex="-1"]:focus { outline: none; }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack > * { margin-block: 0; }
.required { color: var(--error); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@keyframes maz-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
