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

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

body {
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-gradient);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
}

body.lang-fr {
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

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

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

a:hover { color: var(--primary-mid); }

ul, ol { list-style: none; }

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

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

/* === SKIP LINK === */
.skip-link {
  position: absolute;
  top: -40px;
  right: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: var(--z-toast);
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  transition: top var(--transition-fast);
}
.skip-link:focus { top: 0; }

/* === PAGE BACKGROUND === */
.page-bg {
  min-height: 100vh;
  background: var(--bg-gradient);
  position: relative;
  overflow-x: hidden;
}

.page-content {
  position: relative;
  z-index: var(--z-base);
}

/* Orbes flottants */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: orb-float 8s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: var(--orb-blue);
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: var(--orb-purple);
  bottom: 10%; right: -80px;
  animation-delay: 3s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: var(--orb-gold);
  top: 40%; right: 40%;
  animation-delay: 6s;
}

/* === TYPOGRAPHIE === */
[lang="ar"], .font-ar {
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  direction: rtl;
  text-align: right;
}
[lang="fr"], .font-fr {
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  direction: ltr;
  text-align: left;
}

.text-hero    { font-size: clamp(32px, 5vw, 56px); font-weight: 800; line-height: 1.15; }
.text-h1      { font-size: clamp(28px, 4vw, 44px); font-weight: 700; line-height: 1.2; }
.text-h2      { font-size: clamp(22px, 3vw, 34px); font-weight: 700; line-height: 1.3; }
.text-h3      { font-size: clamp(18px, 2.5vw, 26px); font-weight: 600; line-height: 1.4; }
.text-body-lg { font-size: 18px; font-weight: 400; line-height: 1.75; }
.text-body    { font-size: 16px; font-weight: 400; line-height: 1.7; }
.text-sm      { font-size: 14px; font-weight: 400; line-height: 1.6; }
.text-xs      { font-size: 12px; font-weight: 500; line-height: 1.5; }

/* === UTILITAIRES === */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-sm {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

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

.text-center { text-align: center; }
.text-primary-color { color: var(--primary); }
.text-gold { color: var(--gold); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-emerald { color: var(--emerald); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.w-full { width: 100%; }
.hidden { display: none !important; }

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.section-header-icon {
  width: 32px;
  height: 32px;
  color: var(--gold);
  flex-shrink: 0;
}
.section-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: var(--text-primary);
}
.section-decorator {
  flex: 1;
  height: 2px;
  background: linear-gradient(to left, transparent, var(--gold));
  border-radius: 2px;
}

/* Focus visible */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border-soft); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* Responsive */
@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .container { padding-inline: var(--space-4); }
}
