/* ============================================================
   MASSAR SIM — Design System Premium v2
   ============================================================ */

:root {
  --primary: #C1272D;
  --primary-dark: #8B0000;
  --primary-light: #FF4952;
  --accent: #006233;
  --accent-light: #00A854;
  --gold: #D4AF37;
  --gold-light: #F5D070;

  --bg-base: #0A0A0F;
  --bg-surface: #12121A;
  --bg-card: #1A1A26;
  --bg-card-hover: #222233;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(193,39,45,0.5);

  --text-primary: #F0F0F5;
  --text-secondary: #9090A8;
  --text-muted: #5A5A70;

  --gradient-hero: linear-gradient(135deg, #0A0A0F 0%, #1A0A10 50%, #0A0F1A 100%);
  --gradient-card: linear-gradient(145deg, #1A1A26, #12121A);
  --gradient-cta: linear-gradient(135deg, #C1272D, #8B0000);
  --gradient-success: linear-gradient(135deg, #006233, #00A854);
  --gradient-gold: linear-gradient(135deg, #D4AF37, #F5D070);
  --glow-red: 0 0 40px rgba(193,39,45,0.3);
  --glow-green: 0 0 40px rgba(0,98,51,0.3);
  --glow-gold: 0 0 40px rgba(212,175,55,0.4);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-elevated: 0 8px 48px rgba(0,0,0,0.6);
  --transition-fast: 0.2s ease;
  --transition-med: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

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

body {
  font-family: 'Inter', 'Cairo', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body.rtl {
  direction: rtl;
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
}

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

@media (min-width: 768px) { .container { padding: 0 var(--space-md); } }
@media (min-width: 1200px) { .container { padding: 0 var(--space-lg); } }

.gradient-text {
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: var(--space-sm) 0;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-med);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient-cta);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--glow-red);
}
.nav-logo .logo-text-ar,
.nav-logo-text-ar {
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.lang-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}
.lang-btn {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  letter-spacing: 0.04em;
}
.lang-btn.active {
  background: var(--gradient-cta);
  color: white;
  box-shadow: 0 2px 10px rgba(193,39,45,0.4);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  overflow: hidden;
  background: var(--gradient-hero);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(193,39,45,0.6), transparent 70%);
  top: -100px; left: -100px;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,98,51,0.5), transparent 70%);
  bottom: -50px; right: -50px;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}
.particles-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: floatParticle linear infinite;
}
@keyframes floatParticle {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.5; }
  92%  { opacity: 0.4; }
  100% { transform: translateY(-120px) rotate(720deg); opacity: 0; }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-xl) 0;
}
@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr 420px;
    padding: var(--space-2xl) 0;
  }
}

.hero-content { display: flex; flex-direction: column; gap: var(--space-md); }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(193,39,45,0.12);
  border: 1px solid rgba(193,39,45,0.3);
  border-radius: var(--radius-full);
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-light);
  width: fit-content;
}
.badge-dot {
  width: 8px; height: 8px;
  background: var(--primary-light);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}
.hero-title span { display: block; }

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.stat-item {
  display: flex;
  flex-direction: column;
}
.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  background: var(--gradient-cta);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform var(--transition-fast), box-shadow var(--transition-med);
  box-shadow: 0 4px 20px rgba(193,39,45,0.4);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  transform: translateX(-110%) skewX(-20deg);
  transition: transform 0.5s ease;
}
.btn-primary:hover::before { transform: translateX(110%) skewX(-20deg); }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(193,39,45,0.5);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary.btn-large { padding: 1rem 2.2rem; font-size: 1rem; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.6rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}
.btn-sm.btn-primary { box-shadow: 0 2px 12px rgba(193,39,45,0.35); }
.btn-sm.btn-ghost { border: 1px solid var(--border); color: var(--text-secondary); }
.btn-sm.btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: var(--text-primary); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.btn-icon:hover { border-color: rgba(255,255,255,0.2); color: var(--text-primary); background: rgba(255,255,255,0.04); }

/* ============================================================
   HERO MOCKUP
   ============================================================ */
.hero-mockup {
  display: none;
  transform-style: preserve-3d;
}
@media (min-width: 1024px) { .hero-mockup { display: block; } }

.mockup-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-elevated), var(--glow-red);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
  overflow: hidden;
}
.mockup-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-cta);
}
.mockup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.mockup-score {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
}
.mockup-score span {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 400;
}
.mockup-mention {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: rgba(0,168,84,0.15);
  border: 1px solid rgba(0,168,84,0.3);
  border-radius: var(--radius-full);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 700;
}
.mockup-bar-container {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}
.mockup-bar-fill {
  height: 100%;
  width: 74%;
  background: var(--gradient-success);
  border-radius: var(--radius-full);
}
.mockup-ecoles {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
.mockup-ecoles span {
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.mockup-ecoles .eligible {
  background: rgba(0,98,51,0.15);
  border: 1px solid rgba(0,168,84,0.3);
  color: var(--accent-light);
}
.mockup-ecoles .proche-ecole {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: #F59E0B;
}

/* ============================================================
   AD CONTAINERS
   ============================================================ */
.ad-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-sm) 0;
  min-height: 90px;
}
.ad-placeholder {
  background: var(--bg-surface);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 100%;
  max-width: 728px;
  height: 90px;
  letter-spacing: 0.05em;
}
.ad-container.ad-mid .ad-placeholder { max-width: 300px; height: 250px; }

/* ============================================================
   SECTIONS COMMUNES
   ============================================================ */
.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(193,39,45,0.1);
  border: 1px solid rgba(193,39,45,0.25);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.section-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section-header p { color: var(--text-secondary); font-size: 1rem; }

/* ============================================================
   MODULES SECTION — TABS
   ============================================================ */
.modules-section {
  padding: var(--space-xl) 0;
}
.module-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  gap: 4px;
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  scrollbar-width: none;
}
.module-tabs::-webkit-scrollbar { display: none; }
.module-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border-radius: calc(var(--radius-lg) - 4px);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex: 1;
  justify-content: center;
  min-width: fit-content;
}
.module-tab.active {
  background: var(--gradient-cta);
  color: white;
  box-shadow: 0 2px 16px rgba(193,39,45,0.4);
}
.module-tab:hover:not(.active) {
  background: var(--bg-card);
  color: var(--text-primary);
}
.tab-icon { font-size: 1rem; }
.tab-label-short { display: none; }

.module-panel { display: none; }
.module-panel.active { display: block; animation: fadeInUp 0.35s ease forwards; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FORM COMPONENTS
   ============================================================ */
.form-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}
.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-label span { color: var(--text-muted); font-weight: 400; font-size: 0.78rem; }

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}
.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(193,39,45,0.15);
  background: rgba(193,39,45,0.03);
}
.input-field::placeholder { color: var(--text-muted); }

select.input-field {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239090A8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.rtl select.input-field {
  background-position: left 1rem center;
  padding-right: 1rem;
  padding-left: 2.5rem;
}
/* Dark-theme fix pour les options — Firefox + Chromium */
select.input-field option,
select option {
  background-color: #1A1A26;
  color: #F0F0F5;
}

.matieres-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}
@media (min-width: 600px) { .matieres-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .matieres-grid { grid-template-columns: repeat(3, 1fr); } }

.matiere-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color var(--transition-fast);
}
.matiere-item:focus-within { border-color: rgba(193,39,45,0.3); }
.matiere-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.matiere-coef {
  display: inline-block;
  background: rgba(193,39,45,0.12);
  border: 1px solid rgba(193,39,45,0.2);
  color: var(--primary-light);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}
.matiere-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.matiere-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(193,39,45,0.12);
}

.bac-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}
@media (min-width: 600px) { .bac-grid { grid-template-columns: repeat(3, 1fr); } }

.bac-input-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  text-align: center;
  transition: border-color var(--transition-fast);
}
.bac-input-card:focus-within { border-color: rgba(193,39,45,0.3); }
.bac-input-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.bac-weight {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}
.bac-input {
  width: 100%;
  padding: 0.65rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.bac-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(193,39,45,0.12);
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}
.form-actions .btn-primary { flex: 1; justify-content: center; }

/* ============================================================
   RESULT CARDS
   ============================================================ */
.result-container {
  margin-top: var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}
.result-container.visible {
  opacity: 1;
  pointer-events: auto;
}
.result-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-elevated);
  animation: resultReveal 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes resultReveal {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.result-score {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text-primary);
}
.result-score sup {
  font-size: 1.4rem;
  color: var(--text-secondary);
  font-weight: 400;
  vertical-align: top;
  margin-top: 0.6rem;
}
.mention-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.mention-excellent { background: rgba(212,175,55,0.15); border: 1px solid rgba(212,175,55,0.4); color: var(--gold-light); box-shadow: var(--glow-gold); }
.mention-tb        { background: rgba(0,168,84,0.15);  border: 1px solid rgba(0,168,84,0.4);  color: var(--accent-light); box-shadow: var(--glow-green); }
.mention-bien      { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.4); color: #60A5FA; }
.mention-ab        { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: var(--text-secondary); }
.mention-passable  { background: rgba(90,90,112,0.2); border: 1px solid rgba(90,90,112,0.3); color: var(--text-muted); }
.mention-echec     { background: rgba(193,39,45,0.12); border: 1px solid rgba(193,39,45,0.3); color: var(--primary-light); }

.score-bar-container {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin: var(--space-sm) 0;
}
.score-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.score-bar-excellent { background: var(--gradient-gold); }
.score-bar-tb        { background: var(--gradient-success); }
.score-bar-bien      { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
.score-bar-ab        { background: linear-gradient(135deg, #6B7280, #9CA3AF); }
.score-bar-passable  { background: linear-gradient(135deg, #5A5A70, #8080A0); }
.score-bar-echec     { background: var(--gradient-cta); }

.result-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.detail-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.detail-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.detail-value { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }

.loading-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  text-align: center;
}
.loading-overlay.visible { display: flex; }
.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { color: var(--text-secondary); font-weight: 600; animation: fadeCycle 1.5s ease infinite; }
@keyframes fadeCycle {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ============================================================
   HISTORY MODULE
   ============================================================ */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.history-item {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.history-item:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateX(4px);
}
.rtl .history-item:hover { transform: translateX(-4px); }
.history-info { flex: 1; min-width: 0; }
.history-type { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.history-filiere { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.history-date { font-size: 0.72rem; color: var(--text-muted); }
.history-score { font-size: 1.8rem; font-weight: 900; letter-spacing: -0.04em; color: var(--text-primary); }
.history-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.history-empty .empty-icon { font-size: 3rem; margin-bottom: var(--space-sm); }
.history-actions { display: flex; gap: var(--space-xs); justify-content: flex-end; margin-top: var(--space-sm); }

/* ============================================================
   MODULE 5 — GRANDES ÉCOLES
   ============================================================ */
.presélection-section {
  padding: var(--space-xl) 0 var(--space-2xl);
  display: none;
}
.presélection-section.visible { display: block; }

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  justify-content: center;
}
.filter-btn {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}
.filter-btn.active {
  background: var(--bg-card);
  border-color: rgba(193,39,45,0.4);
  color: var(--primary-light);
}
.filter-btn:hover:not(.active) {
  background: var(--bg-card);
  color: var(--text-primary);
}

.ecoles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}
@media (min-width: 640px) { .ecoles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ecoles-grid { grid-template-columns: repeat(3, 1fr); } }

.ecole-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med);
  position: relative;
  overflow: hidden;
}
.ecole-card.eligible {
  border-color: rgba(0,168,84,0.25);
}
.ecole-card.eligible:hover {
  transform: translateY(-6px);
  box-shadow: var(--glow-green);
  border-color: rgba(0,168,84,0.5);
}
.ecole-card.proche {
  border-color: rgba(245,158,11,0.25);
}
.ecole-card.proche:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 40px rgba(245,158,11,0.25);
  border-color: rgba(245,158,11,0.5);
}
.ecole-card.ineligible {
  opacity: 0.55;
  border-color: var(--border);
}
.ecole-card.ineligible:hover {
  opacity: 0.75;
  transform: translateY(-3px);
}

.ecole-card-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.eligible .ecole-card-top-bar  { background: var(--gradient-success); }
.proche .ecole-card-top-bar    { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.ineligible .ecole-card-top-bar { background: var(--border); }

.ecole-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}
.ecole-emoji { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.ecole-header-info { flex: 1; min-width: 0; }
.ecole-nom {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.ecole-type-badge {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-public     { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.25); color: #60A5FA; }
.badge-semipublic { background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.25); color: #A78BFA; }
.badge-universite { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); color: #34D399; }
.badge-prive      { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); color: #FBBF24; }

.eligibilite-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.badge-eligible   { background: rgba(0,168,84,0.15); border: 1px solid rgba(0,168,84,0.3); color: var(--accent-light); }
.badge-proche     { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #FBBF24; }
.badge-ineligible { background: rgba(90,90,112,0.15); border: 1px solid rgba(90,90,112,0.3); color: var(--text-muted); }

.chance-container { display: flex; flex-direction: column; gap: 0.4rem; }
.chance-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.chance-pct { font-weight: 800; color: var(--text-primary); font-size: 0.85rem; }
.chance-bar {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}
.chance-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}
.eligible .chance-fill  { background: var(--gradient-success); }
.proche .chance-fill    { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.ineligible .chance-fill { background: linear-gradient(90deg, #5A5A70, #6B7280); }

.manque-note {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #FBBF24;
  font-weight: 600;
}
.manque-note strong { color: #F59E0B; }

.ecole-meta {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ecole-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ecole-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.ecole-seuil {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.ecole-seuil strong { color: var(--text-secondary); }

.ecole-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border);
}

.concours-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(193,39,45,0.08);
  border: 1px solid rgba(193,39,45,0.15);
  color: var(--primary-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.motivation-banner {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
  display: none;
}
.motivation-banner.visible { display: block; animation: resultReveal 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.motivation-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.6;
}
.motivation-sub { font-size: 0.88rem; color: var(--text-secondary); margin-top: 0.25rem; }

.share-btn-container { display: flex; justify-content: center; margin-top: var(--space-md); }
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(37,211,102,0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-med);
}
.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(37,211,102,0.45);
}
.btn-whatsapp.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  box-shadow: 0 2px 10px rgba(37,211,102,0.25);
}

/* ============================================================
   NOTE REQUISE MODULE
   ============================================================ */
.target-result {
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  text-align: center;
  display: none;
}
.target-result.visible { display: block; animation: resultReveal 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.target-note {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.target-label { font-size: 0.88rem; color: var(--text-secondary); margin-top: 0.5rem; }
.target-impossible {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0 var(--space-sm);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}
.footer-logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.footer-desc { color: var(--text-muted); font-size: 0.82rem; max-width: 400px; }
.footer-links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a { color: var(--text-muted); font-size: 0.82rem; transition: color var(--transition-fast); }
.footer-links a:hover { color: var(--text-secondary); }
.footer-bottom {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.scroll-top {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 44px; height: 44px;
  background: var(--gradient-cta);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(193,39,45,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 50;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-3px); }

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-elevated);
  z-index: 200;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
}
.toast.visible { transform: translateX(-50%) translateY(0); }

/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.w-full { width: 100%; }

.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glow-red);
  border-color: var(--border-hover);
}

/* ============================================================
   RTL OVERRIDES
   ============================================================ */
.rtl .hero-stats { flex-direction: row-reverse; }
.rtl .hero-cta   { flex-direction: row-reverse; }
.rtl .form-section-title::after { display: none; }
.rtl .form-section-title::before {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.rtl .ecole-header { flex-direction: row-reverse; }
.rtl .ecole-actions { flex-direction: row-reverse; }
.rtl .history-item { flex-direction: row-reverse; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .module-tabs {
    gap: 2px;
    padding: 4px;
  }
  .module-tab {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.15rem;
    gap: 0.22rem;
    min-width: 0;
  }
  .tab-icon {
    font-size: 1.25rem;
    line-height: 1;
  }
  .module-tab .tab-label { display: none; }
  .module-tab .tab-label-short {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0;
    line-height: 1;
  }
  .result-score { font-size: 3rem; }
  .hero-title { font-size: 1.9rem; }
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
  .rtl .footer-inner { text-align: right; }
}

/* ============================================================
   MODAL — ÉCOLE DETAIL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}
.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
#modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-elevated), 0 0 80px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#modal-content::-webkit-scrollbar { width: 4px; }
#modal-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.modal-close-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.modal-close-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}

#modal-body { padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); }

.modal-ecole-header {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}
.modal-emoji { font-size: 2.8rem; line-height: 1; flex-shrink: 0; }
.modal-ecole-nom {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
}
.modal-ecole-ar {
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}
.modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  border-top: 1px solid var(--border);
  padding-top: var(--space-sm);
}
.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}
.modal-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: center;
}
.modal-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.modal-stat-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-villes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ville-tag {
  padding: 0.3rem 0.8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.modal-actions {
  display: flex;
  gap: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border);
}
.modal-actions a { flex: 1; justify-content: center; text-align: center; }

/* ============================================================
   ARTICLES & GUIDES SECTION
   ============================================================ */
.articles-section {
  padding: var(--space-2xl) 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

/* Category tabs */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-lg);
}
.cat-tab {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.cat-tab:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(193,39,45,0.08);
}
.cat-tab.active {
  background: var(--gradient-cta);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--glow-red);
}

/* Articles grid */
.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 640px) { .articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .articles-grid { grid-template-columns: repeat(3, 1fr); } }

/* Article card */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--transition-med);
  cursor: pointer;
  position: relative;
}
.article-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-cta);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.article-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--glow-red), var(--shadow-elevated);
}
.article-card:hover::before { opacity: 1; }

.article-card-header {
  padding: var(--space-md) var(--space-md) var(--space-xs);
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}
.article-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.article-meta-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.article-cat-badge {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(193,39,45,0.15);
  color: var(--primary-light);
  border: 1px solid rgba(193,39,45,0.25);
}
.article-niveau {
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.article-time {
  font-size: 0.67rem;
  color: var(--text-muted);
  margin-left: auto;
}

.article-titre {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0;
}

.article-body {
  padding: 0 var(--space-md) var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.article-resume {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-xs);
  flex: 1;
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: var(--space-xs);
}
.article-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.5rem;
}
.article-footer {
  padding: var(--space-xs) var(--space-md) var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-lire {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap var(--transition-fast);
}
.article-card:hover .article-lire { gap: 0.55rem; }

/* Article modal */
#article-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-elevated), 0 0 80px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#article-modal-content::-webkit-scrollbar { width: 4px; }
#article-modal-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.article-modal-hero {
  padding: var(--space-md) var(--space-md) var(--space-sm);
  border-bottom: 1px solid var(--border);
}
.article-modal-emoji { font-size: 2.5rem; margin-bottom: 0.75rem; }
.article-modal-titre {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.article-modal-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.article-modal-body {
  padding: var(--space-md);
}
.article-modal-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
}
.article-modal-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.25rem 0 0.5rem;
}
.article-modal-body ul {
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}
.rtl .article-modal-body ul {
  padding-left: 0;
  padding-right: 1.2rem;
}
.article-modal-body li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.3rem;
}
.article-modal-cta {
  margin: var(--space-sm) var(--space-md) var(--space-md);
  padding: var(--space-sm);
  background: rgba(193,39,45,0.08);
  border: 1px solid rgba(193,39,45,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.article-modal-cta-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.article-modal-cta .btn-primary { flex-shrink: 0; }
.article-modal-share {
  padding: var(--space-xs) var(--space-md) var(--space-md);
  display: flex;
  gap: var(--space-xs);
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.article-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 var(--space-md) var(--space-sm);
  font-style: italic;
}

/* AdSense between articles */
.articles-ad-slot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: var(--space-sm) 0;
}

/* RTL adjustments */
.rtl .article-time { margin-left: 0; margin-right: auto; }
.rtl .article-card-header { flex-direction: row; }
.rtl .article-modal-share { justify-content: flex-start; }
