/* ============================================================
   E4Afrika MOOC Platform — style.css
   Design system personnalisé
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

/* ---- Variables ---- */
:root {
  --primary:     #1a73e8;
  --primary-dark:#1557b0;
  --secondary:   #f59e0b;
  --success:     #10b981;
  --danger:      #ef4444;
  --info:        #06b6d4;
  --dark:        #1a2332;
  --light:       #f5f5f5;
  --white:       #ffffff;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --shadow:      0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
  --radius:      16px;
  --radius-sm:   8px;
  --transition:  all .25s ease;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .95rem;
  color: #1a2332;
  background: #fff;
  line-height: 1.6;
}

/* ---- Utility ---- */
.fw-500  { font-weight: 500  !important; }
.fw-600  { font-weight: 600  !important; }
.fw-700  { font-weight: 700  !important; }
.fw-800  { font-weight: 800  !important; }
.text-white-75  { color: rgba(255,255,255,.75) !important; }
.text-white-80  { color: rgba(255,255,255,.80) !important; }
.text-white-50  { color: rgba(255,255,255,.50) !important; }
.min-vh-90      { min-height: 90vh; }
.py-6           { padding-top: 5rem; padding-bottom: 5rem; }
.px-6           { padding-left: 3rem; padding-right: 3rem; }
.x-small        { font-size: .72rem; }
.cursor-pointer { cursor: pointer; }
.lh-sm          { line-height: 1.3; }

/* ---- Navbar ---- */
#mainNav {
  background: linear-gradient(135deg, var(--dark) 0%, #243447 100%);
  padding: .75rem 0;
  box-shadow: 0 2px 20px rgba(0,0,0,.15);
  transition: var(--transition);
}
#mainNav .navbar-nav .nav-link {
  color: rgba(255,255,255,.8);
  font-size: .88rem;
  font-weight: 500;
  padding: .4rem .75rem;
  border-radius: 8px;
  transition: var(--transition);
}
#mainNav .navbar-nav .nav-link:hover,
#mainNav .navbar-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.brand-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}
.brand-logo span  { color: var(--secondary); }
.brand-sub        { color: rgba(255,255,255,.5); font-size: .75rem; font-weight: 400; letter-spacing: 2px; text-transform: uppercase; }
.avatar-sm {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; font-weight: 700; font-size: .9rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar-xs {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; font-weight: 700; font-size: .75rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ---- Hero ---- */
.hero-section {
  background: linear-gradient(135deg, #0f2147 0%, #1a3a6b 40%, #1a73e8 100%);
  position: relative;
  overflow: hidden;
}
.hero-bg-shapes .shape {
  position: absolute;
  border-radius: 50%;
  opacity: .06;
}
.shape-1 { width: 600px; height: 600px; background: var(--secondary); top: -200px; right: -100px; }
.shape-2 { width: 400px; height: 400px; background: #fff; bottom: -150px; left: -100px; }
.shape-3 { width: 200px; height: 200px; background: var(--info); top: 50%; left: 30%; }

.hero-stat-num   { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stat-label { font-size: .75rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: 1px; }

.hero-illustration {
  position: relative;
  width: 400px;
  height: 350px;
}
.hero-card {
  position: absolute;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  padding: 16px 24px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.hero-card:nth-child(1) { top: 20px;   left: 0; }
.hero-card:nth-child(2) { top: 100px;  right: 0; }
.hero-card:nth-child(3) { top: 190px;  left: 20px; }
.hero-card:nth-child(4) { top: 270px;  right: 20px; }
.hero-card i { font-size: 1.4rem; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.floating { animation: float 3s ease-in-out infinite; }

/* ---- Feature cards ---- */
.feature-card {
  transition: var(--transition);
  border: 1px solid transparent;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg) !important;
}
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.feature-icon.text-primary  { background: rgba(26,115,232,.1); }
.feature-icon.text-success  { background: rgba(16,185,129,.1); }
.feature-icon.text-warning  { background: rgba(245,158,11,.1); }
.feature-icon.text-danger   { background: rgba(239,68,68,.1);  }
.feature-icon.text-info     { background: rgba(6,182,212,.1);  }
.feature-icon.text-dark     { background: rgba(26,35,50,.08);  }

/* ---- Cours cards ---- */
.cours-card { transition: var(--transition); }
.cours-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg) !important;
}
.cours-card-img {
  height: 160px;
  background: linear-gradient(135deg, #1a73e8, #1557b0);
}
.cours-card-img-sm {
  height: 100px;
  background: linear-gradient(135deg, #1a73e8, #1557b0);
}
.cours-card-img-sm.rounded-top-4 { border-radius: var(--radius) var(--radius) 0 0 !important; }

/* ---- CTA Section ---- */
.cta-section {
  background: linear-gradient(135deg, #0f2147 0%, #1a73e8 100%);
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -200px; right: -100px;
}

/* ---- Auth Pages ---- */
.auth-page { background: linear-gradient(135deg, #f0f4f8 0%, #e8f0fe 100%); }
.auth-card  { border-radius: var(--radius) !important; overflow: hidden; }
.auth-card-header {
  background: linear-gradient(135deg, #0f2147 0%, #1a73e8 100%);
}
.auth-logo {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
}
.auth-logo span { color: var(--secondary); }

/* ---- Dashboard Welcome ---- */
.dashboard-welcome {
  background: linear-gradient(135deg, #1a3a6b 0%, #1a73e8 100%);
  min-height: 130px;
}
.welcome-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.welcome-shapes::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  top: -100px; right: -50px;
}

/* ---- KPI Cards ---- */
.kpi-card { transition: var(--transition); }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg) !important; }
.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.kpi-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.kpi-label { font-size: .78rem; margin-top: 4px; }

/* ---- Shortcut cards ---- */
.shortcut-card { transition: var(--transition); color: inherit; }
.shortcut-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--primary) !important;
}
.shortcut-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ---- Progress ---- */
.progress-animated { transition: width .8s ease; }
.cours-progress-card { background: #f8fafc; border: 1px solid var(--border) !important; transition: var(--transition); }
.cours-progress-card:hover { box-shadow: var(--shadow) !important; border-color: var(--primary) !important; }

/* ---- Module nav (progression) ---- */
.module-nav-item { transition: var(--transition); }
.module-nav-item:hover { background: #f0f4f8 !important; }
.module-complete  { background: rgba(16,185,129,.06); }
.module-pending   { background: transparent; }
.module-check-icon { width: 28px; text-align: center; flex-shrink: 0; }
.module-num-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: var(--border);
  border-radius: 50%;
  font-size: .75rem; font-weight: 700;
  color: var(--text-muted);
}

/* ---- Contenu items ---- */
.contenu-item { background: #f8fafc; transition: var(--transition); }
.contenu-item:hover { background: #eef2ff; }

/* ---- Quiz ---- */
.quiz-option-label {
  cursor: pointer;
  background: #fff;
  transition: var(--transition);
}
.quiz-option-label:hover { background: #eef2ff; border-color: var(--primary) !important; }
.quiz-radio:checked + .quiz-option-label,
.quiz-option-label:has(.quiz-radio:checked) {
  background: #eef2ff;
  border-color: var(--primary) !important;
}
.quiz-option-label input[type=radio]:checked ~ span { color: var(--primary); }

.quiz-result-header {
  background: linear-gradient(135deg, #1a3a6b, #1a73e8);
  min-height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.quiz-score-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  border: 3px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.quiz-option { border: 1px solid transparent; }

/* ---- Certificat card ---- */
.certificat-header {
  background: linear-gradient(135deg, #1a3a6b, var(--secondary));
  min-height: 130px;
}
.certificat-seal { font-size: 2.5rem; }

/* ---- Filter links (catalogue) ---- */
.filter-link {
  color: var(--text-muted);
  font-size: .85rem;
  padding: .4rem .75rem;
  border-radius: 8px;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}
.filter-link:hover { background: #eef2ff; color: var(--primary); }
.filter-link.active { background: #eef2ff; color: var(--primary); font-weight: 600; }

/* ---- Module accordion ---- */
.module-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.accordion-button:not(.collapsed) { background: #eef2ff; color: var(--primary); }
.accordion-button:focus { box-shadow: none; }

/* ---- Soft backgrounds ---- */
.bg-primary-soft  { background: rgba(26,115,232,.1)  !important; }
.bg-success-soft  { background: rgba(16,185,129,.1)  !important; }
.bg-warning-soft  { background: rgba(245,158,11,.1)  !important; }
.bg-danger-soft   { background: rgba(239,68,68,.1)   !important; }
.bg-info-soft     { background: rgba(6,182,212,.1)   !important; }
.bg-secondary-soft{ background: rgba(100,116,139,.1) !important; }

/* ---- Shadow hover ---- */
.shadow-hover { transition: var(--transition); }
.shadow-hover:hover { box-shadow: var(--shadow-lg) !important; }

/* ---- Tables ---- */
.table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  color: var(--text-muted);
}
.table td { vertical-align: middle; }

/* ---- Footer ---- */
.footer {
  background: #0f1c2e;
  color: rgba(255,255,255,.7);
}
.footer-links a {
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  text-decoration: none;
  transition: var(--transition);
  display: block;
  margin-bottom: .4rem;
}
.footer-links a:hover { color: #fff; padding-left: 4px; }
.footer h6 { color: #fff; }
.social-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.7);
  font-size: 1rem;
  transition: var(--transition);
  text-decoration: none;
}
.social-icon:hover { background: var(--primary); color: #fff; }

/* ---- Responsive ---- */
@media (max-width: 767px) {
  .hero-section .display-4 { font-size: 2rem; }
  .py-6 { padding-top: 3rem; padding-bottom: 3rem; }
  .kpi-value { font-size: 1.4rem; }
}

/* ---- Print (certificat) ---- */
@media print {
  #mainNav, footer, .btn { display: none !important; }
  body { background: #fff; }
}
