/* ===================================================================
   ESSI LMS — Feuille de style partagée
   École Supérieure de Statistique et Informatique — Niamey, Niger
   Identité : Navy #1A3A8A · Orange #E8460A · Cyan #4DC8E8
   Mobile-first · Optimisé connexion limitée (aucune dépendance externe)
   =================================================================== */

:root {
  --navy: #1A3A8A;
  --navy-dark: #112870;
  --navy-light: #2348A8;
  --orange: #E8460A;
  --orange-light: #FF5A1F;
  --cyan: #4DC8E8;
  --cyan-light: #7DD8F0;
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-400: #94A3B8;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(26,58,138,0.10);
  --shadow-md: 0 8px 32px rgba(26,58,138,0.15);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

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

/* ── HEADER ── */
.header {
  background: var(--navy);
  padding: 0 1.25rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--cyan), var(--orange));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px; color: white; line-height: 1;
  letter-spacing: -1px; text-align: center;
}
.logo-text { color: white; font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.logo-text span { color: var(--cyan); }
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.header-link { color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 600; }
.header-link:hover { color: var(--cyan); }

.btn-login {
  background: var(--orange);
  color: white; border: none; border-radius: var(--radius-sm);
  padding: 8px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-login:hover { background: var(--orange-light); }
.btn-ghost {
  background: rgba(255,255,255,0.12); color: white; border: none;
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.22); }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #1A5A8A 100%);
  padding: 72px 1.25rem 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(77,200,232,0.18) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: ''; position: absolute; bottom: -80px; left: -40px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(232,70,10,0.13) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-badge {
  display: inline-block;
  background: rgba(77,200,232,0.15);
  border: 1px solid rgba(77,200,232,0.4);
  color: var(--cyan);
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; border-radius: 99px;
  padding: 5px 16px; margin-bottom: 20px; position: relative;
}
.hero h1 {
  color: white; font-size: clamp(26px, 4vw, 46px);
  font-weight: 800; line-height: 1.2; margin-bottom: 16px; position: relative;
}
.hero h1 span { color: var(--cyan); }
.hero p {
  color: rgba(255,255,255,0.78);
  font-size: 16px; max-width: 560px; margin: 0 auto 32px;
  line-height: 1.6; position: relative;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; }
.btn-hero {
  padding: 13px 26px; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 700; cursor: pointer; border: none; transition: all .2s;
}
.btn-hero-primary { background: var(--orange); color: white; }
.btn-hero-primary:hover { background: var(--orange-light); }
.btn-hero-outline { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.4); }
.btn-hero-outline:hover { border-color: var(--cyan); color: var(--cyan); }
.hero-stats {
  display: flex; justify-content: center; gap: 40px; margin-top: 44px;
  flex-wrap: wrap; position: relative;
}
.stat { text-align: center; }
.stat-num { color: var(--cyan); font-size: 30px; font-weight: 800; }
.stat-label { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 4px; }

/* ── BLOC TABS ── */
.bloc-bar { background: white; border-bottom: 1px solid var(--gray-200); }
.bloc-selector {
  display: flex; justify-content: center; gap: 0;
  padding: 36px 1.25rem 0; max-width: 700px; margin: 0 auto;
}
.bloc-tab {
  flex: 1; padding: 16px 18px;
  border: 2px solid var(--gray-200); background: white; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--gray-600);
  transition: all 0.25s; display: flex; align-items: center; gap: 8px; justify-content: center;
}
.bloc-tab:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.bloc-tab:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.bloc-tab.active { background: var(--navy); color: white; border-color: var(--navy); }
.bloc-tab .tab-icon { font-size: 18px; }
.bloc-tab .tab-badge { background: var(--orange); color: white; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; }
.bloc-tab.active .tab-badge { background: var(--cyan); color: var(--navy); }

/* ── SECTIONS / LAYOUT ── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 36px 1.25rem 80px; }
.section { display: none; }
.section.active { display: block; }
.section-title {
  font-size: 21px; font-weight: 700; color: var(--navy);
  margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.section-title .accent { color: var(--orange); }
.section-sub { color: var(--gray-600); font-size: 14px; margin-bottom: 28px; line-height: 1.5; }

/* ── GRIDS ── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; }

/* ── FEATURE CARD ── */
.feature-card {
  background: white; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-100);
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-icon {
  width: 50px; height: 50px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 14px;
}
.icon-navy { background: rgba(26,58,138,0.08); }
.icon-orange { background: rgba(232,70,10,0.08); }
.icon-cyan { background: rgba(77,200,232,0.12); }
.icon-green { background: rgba(16,185,129,0.10); }
.card-title { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.card-desc { font-size: 13px; color: var(--gray-600); line-height: 1.6; margin-bottom: 14px; }

/* ── RESOURCE ITEMS ── */
.resource-list { display: flex; flex-direction: column; gap: 8px; }
.resource-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--gray-50); border-radius: var(--radius-sm);
  padding: 10px 14px; border: 1px solid var(--gray-100);
}
.resource-icon { font-size: 19px; flex-shrink: 0; }
.resource-name { font-size: 13px; font-weight: 600; color: var(--gray-800); flex: 1; }
.resource-meta { font-size: 11px; color: var(--gray-400); }
.resource-action {
  font-size: 11px; font-weight: 700; color: var(--navy);
  background: rgba(26,58,138,0.08); padding: 5px 11px;
  border-radius: 6px; cursor: pointer; border: none; transition: background 0.2s; white-space: nowrap;
}
.resource-action:hover { background: var(--navy); color: white; }

/* ── CERTIFICATION CATALOGUE ── */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.cert-card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-100);
  overflow: hidden; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;
}
.cert-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.cert-banner { height: 8px; background: linear-gradient(90deg, var(--navy), var(--cyan)); }
.cert-body { padding: 20px; }
.cert-category { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--cyan); margin-bottom: 8px; }
.cert-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 10px; line-height: 1.3; }
.cert-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cert-tag { background: var(--gray-100); color: var(--gray-600); font-size: 11px; font-weight: 600; border-radius: 6px; padding: 3px 10px; }
.cert-price { font-size: 20px; font-weight: 800; color: var(--orange); margin-bottom: 14px; }
.cert-price span { font-size: 13px; font-weight: 500; color: var(--gray-400); }
.cert-footer { display: flex; gap: 8px; }

/* ── BUTTONS ── */
.btn-sm { flex: 1; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; cursor: pointer; border: none; text-align: center; transition: all 0.2s; }
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-light); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: white; }
.btn-full {
  display: block; width: 100%; background: var(--orange); color: white;
  border: none; padding: 13px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer; text-align: center;
  transition: background 0.2s;
}
.btn-full:hover { background: var(--orange-light); }
.btn-navy { background: var(--navy); }
.btn-navy:hover { background: var(--navy-light); }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 200;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--radius); max-width: 620px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.modal-sm { max-width: 440px; }
.modal-header {
  background: var(--navy); padding: 22px 26px;
  display: flex; align-items: flex-start; justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 0;
}
.modal-title { color: white; font-size: 18px; font-weight: 700; }
.modal-subtitle { color: rgba(255,255,255,0.65); font-size: 13px; margin-top: 4px; }
.modal-close {
  background: rgba(255,255,255,0.15); border: none; color: white;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-body { padding: 24px 26px; }
.modal-section { margin-bottom: 22px; }
.modal-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--orange); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-100);
}

/* ── ZOOM / SESSION ── */
.zoom-session {
  display: flex; align-items: center; gap: 12px;
  background: rgba(77,200,232,0.08); border: 1px solid rgba(77,200,232,0.3);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 8px;
}
.zoom-icon { font-size: 22px; }
.zoom-info { flex: 1; }
.zoom-label { font-size: 12px; color: var(--gray-600); }
.zoom-date { font-size: 14px; font-weight: 700; color: var(--navy); }
.btn-zoom { background: var(--cyan); color: var(--navy); border: none; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--gray-200); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; background: var(--gray-50);
  cursor: pointer; transition: border-color 0.2s;
}
.upload-zone:hover { border-color: var(--cyan); background: rgba(77,200,232,0.04); }
.upload-zone p { font-size: 13px; color: var(--gray-600); margin-top: 8px; }

/* ── QR ── */
.qr-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(232,70,10,0.08); border: 1px solid rgba(232,70,10,0.25);
  color: var(--orange); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px;
}
.qr-box {
  width: 150px; height: 150px; background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  padding: 8px; margin: 0 auto;
}
.qr-box img, .qr-box canvas { width: 100%; height: 100%; object-fit: contain; }
.qr-placeholder {
  width: 134px; height: 134px; background:
    repeating-linear-gradient(45deg, var(--gray-100), var(--gray-100) 6px, var(--gray-200) 6px, var(--gray-200) 12px);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--gray-400); text-align: center; padding: 8px; font-weight: 600;
}

/* ── FORMS ── */
.form-field { margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; display: block; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; transition: border-color 0.2s; font-family: inherit; background: white;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--navy); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--gray-400); margin-top: 5px; }

.login-type-row { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.login-type-btn {
  flex: 1; min-width: 110px; padding: 11px 8px; border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200); background: white;
  font-size: 12px; font-weight: 600; cursor: pointer; text-align: center;
  color: var(--gray-600); transition: all 0.2s;
}
.login-type-btn.active { border-color: var(--navy); background: var(--navy); color: white; }

/* ── DASHBOARD BAR ── */
.dash-bar {
  background: white; border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 28px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.dash-id { flex: 1; min-width: 200px; }
.dash-name { font-size: 14px; font-weight: 700; color: var(--navy); }
.dash-role { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.progress-bar-wrap { background: var(--gray-100); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--navy), var(--cyan)); }
.progress-label { font-size: 12px; color: var(--gray-600); white-space: nowrap; }
.chip { padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-green { background: rgba(16,185,129,0.1); color: var(--success); }
.chip-cyan { background: rgba(77,200,232,0.15); color: var(--navy); }

/* ── INNER TABS ── */
.inner-tabs { display: flex; gap: 4px; margin-bottom: 26px; flex-wrap: wrap; }
.inner-tab {
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200); background: white;
  font-size: 13px; font-weight: 600; color: var(--gray-600); cursor: pointer; transition: all 0.2s;
}
.inner-tab.active { background: var(--navy); color: white; border-color: var(--navy); }
.inner-section { display: none; }
.inner-section.active { display: block; }

/* ── TABLES ── */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--navy); color: white; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 16px; text-align: left; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.data-table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }
.grade { font-weight: 700; }
.grade.good { color: var(--success); }
.grade.avg { color: var(--warning); }
.grade.bad { color: var(--orange); }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.pill-done { background: rgba(16,185,129,0.1); color: var(--success); }
.pill-pending { background: rgba(245,158,11,0.1); color: var(--warning); }
.pill-todo { background: rgba(232,70,10,0.1); color: var(--orange); }
.pill-info { background: rgba(26,58,138,0.08); color: var(--navy); }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; align-items: center; }
.filter-bar .form-select { width: auto; min-width: 160px; flex: 0 1 auto; }

/* ── NOTICE / ALERT ── */
.notice { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13px; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; }
.notice-info { background: rgba(77,200,232,0.08); border: 1px solid rgba(77,200,232,0.3); color: var(--gray-700); }
.notice-warn { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3); color: var(--gray-700); }
.notice-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: var(--gray-700); }

/* ── FOOTER ── */
.footer {
  background: var(--navy-dark); color: rgba(255,255,255,0.5);
  text-align: center; padding: 26px 1.25rem; font-size: 13px; line-height: 1.7;
  border-top: 3px solid var(--orange);
}
.footer strong { color: white; }
.footer a { color: var(--cyan); }

/* ── AUTH PAGE (login standalone) ── */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 1.25rem;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
}
.auth-card { background: white; border-radius: var(--radius); width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.auth-head { background: var(--navy); padding: 26px; text-align: center; }
.auth-head h2 { color: white; font-size: 20px; font-weight: 700; }
.auth-head p { color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 6px; }
.auth-body { padding: 26px; }

/* ── UTILITIES ── */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.video-thumb {
  border-radius: var(--radius-sm); height: 140px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; color: rgba(255,255,255,0.35); background: var(--gray-800);
}
.video-thumb.yt { background: #FF0000; color: white; font-size: 30px; font-weight: 700; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .header { padding: 0 1rem; }
  .hero { padding: 56px 1rem 48px; }
  .hero-stats { gap: 24px; }
  .bloc-selector { max-width: 100%; padding: 28px 1rem 0; }
  .bloc-tab { font-size: 13px; padding: 14px 10px; flex-direction: column; gap: 4px; }
  .inner-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .inner-tab { white-space: nowrap; }
  .wrap { padding: 28px 1rem 64px; }
  .grid-2 { grid-template-columns: 1fr; }
  .header-link { display: none; }
}
