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

:root {
  --primary: #3b82f6;
  --primary-glow: #3b82f6;
  --primary-light: #dbeafe;
  --primary-dark: #2563eb;
  --primary-rgb: 59 130 246;
  --primary-dark-rgb: 37 99 235;
  --chart-accent: #06b6d4;
  --chart-accent-dark: #0891b2;
  --chart-accent-rgb: 6 182 212;
  --chart-accent-dark-rgb: 8 145 178;
  --bg-gradient-start: color-mix(in srgb, var(--primary-light) 72%, #ffffff);
  --bg-gradient-mid: color-mix(in srgb, var(--primary-light) 42%, #ffffff);
  --bg-gradient-end: color-mix(in srgb, var(--primary-light) 18%, #ffffff);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
  --blur-glass: 28px;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.35);
  --surface: rgba(255, 255, 255, 0.7);
  --sidebar-width: 260px;
  --radius: 16px;
  --radius-sm: 12px;
  --select-arrow-size: 16px;
  --select-arrow-offset: 12px;
  --select-padding-end: 2.5rem;
  --field-font-size: 13px;
  --field-padding-y: 9px;
  --field-padding-x: 12px;
  --field-height: 38px;
  --font-en: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-fa: 'IRANYekan', 'IranYekan', 'Yekan', Tahoma, sans-serif;
  /* Latin → Montserrat first; Arabic/Persian glyphs fall through to --font-fa */
  --font-ui: var(--font-en), var(--font-fa);
  --card-hover-lift: -4px;
  --card-hover-shadow: 0 16px 48px rgba(var(--primary-rgb) / 0.14);
  --card-hover-transition: transform 0.25s ease, box-shadow 0.25s ease;
}

html {
  min-height: 100%;
}

body,
#root {
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--text-primary);
  background-color: var(--bg-gradient-mid);
  background-image: linear-gradient(
    135deg,
    var(--bg-gradient-start) 0%,
    var(--bg-gradient-mid) 50%,
    var(--bg-gradient-end) 100%
  );
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: -30%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 520px 520px at 72% 18%,
      rgba(var(--primary-rgb) / 0.3),
      transparent 72%
    ),
    radial-gradient(
      ellipse 420px 420px at 22% 82%,
      rgba(var(--primary-rgb) / 0.2),
      transparent 72%
    ),
    radial-gradient(
      ellipse 360px 360px at 8% 42%,
      rgba(var(--chart-accent-rgb, var(--primary-rgb)) / 0.14),
      transparent 72%
    );
  animation: pageAuraDrift 22s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes pageAuraDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(3.5%, -2.5%, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-3%, 3.5%, 0) scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

/* Interactive glass cards: lift + shadow on hover (no border change) */
[data-card-hover] {
  transition: var(--card-hover-transition);
}

[data-card-hover]:hover,
[data-card-hover][data-card-hover-active='true'] {
  transform: translateY(var(--card-hover-lift));
  box-shadow: var(--card-hover-shadow);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a {
  text-decoration: none;
  color: inherit;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: inherit;
  font-size: var(--field-font-size);
  line-height: 1.4;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: var(--field-height);
  padding: var(--field-padding-y) var(--select-padding-end) var(--field-padding-y) var(--field-padding-x);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--select-arrow-offset) center;
  background-size: var(--select-arrow-size);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
}

input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='hidden']),
textarea {
  font-family: var(--font-ui);
  font-size: var(--field-font-size);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

:where(input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='hidden'])) {
  min-height: var(--field-height);
  padding: var(--field-padding-y) var(--field-padding-x);
  line-height: 1.4;
  box-sizing: border-box;
}

input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='hidden']):focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
}

input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='hidden'])::placeholder,
textarea::placeholder {
  font-family: var(--font-ui);
}

[dir='rtl'],
:lang(fa),
.faText {
  font-family: var(--font-ui);
  font-weight: 400;
  text-align: start;
}

[dir='rtl']::placeholder,
:lang(fa)::placeholder,
.faText::placeholder {
  font-family: var(--font-ui);
  font-weight: 400;
}
