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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  color: var(--color-heading);
  font-weight: 700;
  letter-spacing: 0;
}

/* ── أيقونات SVG ── */
.ico {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
  color: inherit;
}
.ico-lg { width: 1.5em; height: 1.5em; }

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--blue-800);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

::selection {
  background: color-mix(in srgb, var(--orange-400) 35%, transparent);
  color: var(--blue-900);
}

:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── شريط التمرير ── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ── أدوات مساعدة ── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.fade-up { animation: fadeIn 0.5s ease both; }

.loader-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  background: var(--gradient-hero);
}

.loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  color: var(--blue-600);
}

.loader-icon {
  font-size: 2.5rem;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes revealUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── حركة دخول عند تحميل الصفحة (مع تتابع) ── */
.reveal,
.stat-card,
.feature-item,
.pillar-card,
.step-item,
.data-panel,
.form-panel,
.course-card,
.review-section {
  animation: revealUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stat-card:nth-child(2), .feature-item:nth-child(2), .pillar-card:nth-child(2),
.step-item:nth-child(2), .course-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3), .feature-item:nth-child(3), .pillar-card:nth-child(3),
.step-item:nth-child(3), .course-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4), .feature-item:nth-child(4), .pillar-card:nth-child(4),
.course-card:nth-child(4) { animation-delay: 0.18s; }
.feature-item:nth-child(5), .pillar-card:nth-child(5) { animation-delay: 0.24s; }
.feature-item:nth-child(6), .pillar-card:nth-child(6) { animation-delay: 0.30s; }
.pillar-card:nth-child(7) { animation-delay: 0.36s; }
.pillar-card:nth-child(8) { animation-delay: 0.42s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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