:root {
  --bg-dark: #020b24;
  --bg-navy: #04123a;
  --bg-card: rgba(8, 26, 75, 0.7);
  --bg-card-hover: rgba(14, 40, 105, 0.85);
  --border-glass: rgba(45, 125, 255, 0.22);
  --border-glass-gold: rgba(245, 186, 49, 0.35);
  
  --electric-blue: #1e6fff;
  --cyan: #00d2ff;
  --gold: #f5ba31;
  --gold-glow: #e69500;
  --gold-gradient: linear-gradient(135deg, #fce074 0%, #f5ba31 50%, #d48b04 100%);
  --blue-gradient: linear-gradient(135deg, #1e6fff 0%, #0c41b8 100%);
  
  --coral-red: #ff4757;
  --emerald-green: #2ed573;
  --purple-glow: #8a2be2;
  
  --text-primary: #ffffff;
  --text-secondary: #a6c0fe;
  --text-muted: #748aa6;
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-blue: 0 8px 32px rgba(30, 111, 255, 0.25);
  --shadow-gold: 0 8px 25px rgba(245, 186, 49, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(30, 111, 255, 0.18) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(12, 65, 184, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #020b24 0%, #04123a 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Utilitaires */
.hidden {
  display: none !important;
}

/* ========================================================
   1. ÉCRAN SPLASH
======================================================== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 40%, #061e5c 0%, #020b24 75%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 40px 24px;
  text-align: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.splash-content {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: splashPulse 2s ease-in-out infinite alternate;
}

.splash-logo-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(30, 111, 255, 0.8));
  margin-bottom: 24px;
}

.splash-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.splash-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.splash-footer,
.footer-corp {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.footer-corp-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 6px;
}

@keyframes splashPulse {
  0% { transform: scale(0.98); opacity: 0.9; }
  100% { transform: scale(1.02); opacity: 1; filter: drop-shadow(0 0 15px rgba(245, 186, 49, 0.3)); }
}

/* ========================================================
   2. ÉCRAN BIENVENUE (MAQUETTE 2)
======================================================== */
.welcome-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 24px 20px;
  background: radial-gradient(circle at 50% 20%, #0a2777 0%, #020b24 80%);
  max-width: 520px;
  margin: 0 auto;
}

.welcome-header {
  text-align: center;
  margin-top: 10px;
}

.welcome-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.welcome-brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(245, 186, 49, 0.5));
}

.welcome-brand-title {
  font-size: 1.85rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-slogan {
  color: var(--text-secondary);
  font-size: 0.92rem;
  letter-spacing: 0.8px;
}

.welcome-hero-img-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 15px auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(30, 111, 255, 0.3);
  border: 1px solid var(--border-glass);
}

.welcome-hero-img {
  width: 100%;
  height: auto;
  display: block;
}

.welcome-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-blue);
  margin-bottom: 16px;
}

.welcome-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 20px;
  color: #ffffff;
}

.welcome-card-title span {
  color: var(--gold);
}

.welcome-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
  text-align: left;
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 38, 97, 0.6);
  border: 1px solid rgba(45, 125, 255, 0.3);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #e2edff;
}

.feature-pill .check-icon {
  width: 18px;
  height: 18px;
  background: var(--gold-gradient);
  color: #04123a;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}

.btn-gold-action {
  background: var(--gold-gradient);
  color: #04123a;
  font-weight: 800;
  font-size: 1.05rem;
  border: none;
  border-radius: var(--radius-full);
  padding: 14px 32px;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-gold);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-gold-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(245, 186, 49, 0.5);
}

.btn-gold-action:active {
  transform: translateY(0);
}

/* ========================================================
   3. ÉCRAN AUTH (CONNEXION & INSCRIPTION)
======================================================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  max-width: 460px;
  margin: 0 auto;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  width: 100%;
  box-shadow: var(--shadow-blue);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-group {
  position: relative;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  background: rgba(4, 18, 58, 0.7);
  border: 1px solid rgba(45, 125, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-muted);
}

.auth-toggle-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-toggle-link button {
  background: none;
  border: none;
  color: var(--gold);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 5px;
}

.auth-error-msg {
  color: var(--coral-red);
  font-size: 0.88rem;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

/* ========================================================
   4. DASHBOARD PRINCIPAL (MAQUETTE 1)
======================================================== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Desktop */
.sidebar {
  width: 250px;
  background: rgba(4, 15, 48, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.sidebar-brand-text h3 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}

.sidebar-brand-text p {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.nav-link .nav-icon {
  font-size: 1.25rem;
  width: 24px;
  display: inline-flex;
  justify-content: center;
}

.nav-link:hover {
  background: rgba(30, 111, 255, 0.15);
  color: #ffffff;
}

.nav-link.active {
  background: var(--blue-gradient);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(30, 111, 255, 0.4);
}

/* Main Dashboard Body */
.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: 75px; /* espace pour barre mobile */
}

@media (min-width: 901px) {
  .dashboard-main {
    padding-bottom: 24px;
  }
}

/* Header / Topbar */
.dashboard-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(45, 125, 255, 0.12);
  background: rgba(3, 12, 38, 0.6);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.header-brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.header-brand-text h1 span {
  color: var(--gold);
}

.header-brand-text p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.btn-header-premium {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 186, 49, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(245, 186, 49, 0.2);
  transition: all 0.2s ease;
}

.btn-header-premium:hover {
  background: var(--gold-gradient);
  color: #04123a;
  box-shadow: var(--shadow-gold);
}

/* Contenu des Vues */
.view-container {
  padding: 20px 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ========================================================
   ACCUEIL DU DASHBOARD
======================================================== */
/* 1. Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, rgba(14, 46, 128, 0.85) 0%, rgba(6, 23, 70, 0.95) 100%);
  border: 1px solid rgba(45, 125, 255, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow-blue);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-banner-robot {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .hero-banner {
    flex-direction: column;
    text-align: center;
  }
  .hero-banner-robot {
    width: 130px;
    height: 130px;
  }
}

.hero-banner-content h2 {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
}

.hero-banner-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 18px;
  max-width: 550px;
}

.btn-hero-learn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-gradient);
  color: #04123a;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: transform 0.2s;
}

.btn-hero-learn:hover {
  transform: translateY(-2px);
}

/* 2. Carte Mes Statistiques */
.stats-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
}

.stats-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stats-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.stats-more-link {
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 8px;
  background: rgba(14, 38, 97, 0.45);
  border: 1px solid rgba(45, 125, 255, 0.15);
  border-radius: var(--radius-md);
}

.stat-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Jauge circulaire SVG */
.circular-gauge {
  width: 90px;
  height: 90px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circular-gauge svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.circular-gauge circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}

.circular-gauge .bg-circle {
  stroke: rgba(255, 255, 255, 0.1);
}

.circular-gauge .progress-circle {
  stroke: var(--gold);
  stroke-dasharray: 251.2;
  stroke-dashoffset: 50.24; /* 80% */
  transition: stroke-dashoffset 1s ease;
}

.gauge-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-percent {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.gauge-sub {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* 3. Accès Rapide (4 tuiles) */
.quick-access-section {
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #ffffff;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .quick-access-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.quick-card {
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  border: none;
  color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-card:hover {
  transform: translateY(-4px);
}

.quick-card.blue {
  background: linear-gradient(135deg, #1877f2 0%, #0d47a1 100%);
  box-shadow: 0 8px 24px rgba(24, 119, 242, 0.35);
}

.quick-card.red {
  background: linear-gradient(135deg, #ff4757 0%, #b31217 100%);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.35);
}

.quick-card.amber {
  background: linear-gradient(135deg, #ff9f1a 0%, #cc6600 100%);
  box-shadow: 0 8px 24px rgba(255, 159, 26, 0.35);
}

.quick-card.cyan {
  background: linear-gradient(135deg, #00a8ff 0%, #006699 100%);
  box-shadow: 0 8px 24px rgba(0, 168, 255, 0.35);
}

.quick-card .quick-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.quick-card .quick-text {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}

/* 4. Carte Passez en Mode Premium */
.premium-callout {
  background: linear-gradient(135deg, rgba(82, 58, 6, 0.8) 0%, rgba(35, 23, 2, 0.9) 100%);
  border: 1px solid var(--border-glass-gold);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-gold);
}

@media (max-width: 650px) {
  .premium-callout {
    flex-direction: column;
    text-align: center;
  }
}

.premium-callout-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.premium-crown-icon {
  font-size: 2.4rem;
  color: var(--gold);
  flex-shrink: 0;
}

.premium-callout-text h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.premium-callout-text p {
  font-size: 0.88rem;
  color: #f7dfa5;
  max-width: 500px;
}

.btn-premium-discover {
  background: var(--gold-gradient);
  color: #04123a;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-gold);
  transition: transform 0.2s;
}

.btn-premium-discover:hover {
  transform: translateY(-2px);
}

/* ========================================================
   5. FOOTER OFFICIEL PLACIDE CORPORATION
======================================================== */
.official-footer {
  background: rgba(3, 10, 32, 0.85);
  border-top: 1px solid rgba(45, 125, 255, 0.15);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}

@media (max-width: 650px) {
  .official-footer {
    flex-direction: column;
    text-align: center;
  }
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.footer-corp-details h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.footer-corp-details p {
  font-size: 0.75rem;
  color: var(--gold);
  font-style: italic;
}

.footer-right {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================================
   6. BARRE DE NAVIGATION MOBILE
======================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(4, 15, 48, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  padding: 10px 20px;
  justify-content: space-around;
  z-index: 1000;
}

@media (max-width: 900px) {
  .mobile-bottom-nav {
    display: flex;
  }
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}

.mobile-nav-btn .icon {
  font-size: 1.3rem;
}

.mobile-nav-btn.active,
.mobile-nav-btn:hover {
  color: var(--cyan);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: 8px;
  background: var(--coral-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================================
   7. MODULES SPÉCIFIQUES (IA, COURS, EXAMENS, ETC.)
======================================================== */
/* Conteneurs de modules */
.module-section {
  animation: fadeIn 0.3s ease;
}

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

.module-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.module-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}

/* IA Chat Interface */
.chat-window {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
}

.chat-context-bar {
  padding: 12px 16px;
  background: rgba(14, 38, 97, 0.4);
  border-bottom: 1px solid rgba(45, 125, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-context-bar select {
  flex: 1;
  background: rgba(4, 18, 58, 0.8);
  border: 1px solid rgba(45, 125, 255, 0.3);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  line-height: 1.5;
  font-size: 0.95rem;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--blue-gradient);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: rgba(14, 38, 97, 0.7);
  border: 1px solid rgba(45, 125, 255, 0.2);
  color: #e6efff;
  border-bottom-left-radius: 4px;
}

.chat-input-bar {
  padding: 14px 16px;
  background: rgba(4, 18, 58, 0.7);
  border-top: 1px solid rgba(45, 125, 255, 0.15);
  display: flex;
  gap: 10px;
}

.chat-input-bar textarea {
  flex: 1;
  background: rgba(8, 26, 75, 0.8);
  border: 1px solid rgba(45, 125, 255, 0.3);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  resize: none;
  height: 48px;
  font-family: inherit;
}

.btn-send-ai {
  background: var(--gold-gradient);
  color: #04123a;
  border: none;
  font-weight: 800;
  border-radius: var(--radius-md);
  padding: 0 20px;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-send-ai:hover {
  transform: translateY(-2px);
}

/* Grille de documents / cours */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: rgba(30, 111, 255, 0.5);
}

.course-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.course-icon-badge {
  width: 44px;
  height: 44px;
  background: rgba(30, 111, 255, 0.15);
  border: 1px solid var(--electric-blue);
  color: var(--cyan);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.course-card-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.course-card-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.course-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.btn-action-small {
  background: rgba(14, 38, 97, 0.6);
  border: 1px solid rgba(45, 125, 255, 0.3);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-small:hover {
  background: var(--electric-blue);
  color: #fff;
  border-color: var(--electric-blue);
}

.btn-action-small.gold {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-action-small.gold:hover {
  background: var(--gold);
  color: #04123a;
}

.btn-action-small.danger {
  border-color: var(--coral-red);
  color: var(--coral-red);
}

.btn-action-small.danger:hover {
  background: var(--coral-red);
  color: #fff;
}

/* Flashcards 3D Interactive */
.flashcards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
}

.flashcard {
  width: 100%;
  max-width: 480px;
  height: 260px;
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 20px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-blue);
}

.flashcard-front {
  background: linear-gradient(135deg, #092368 0%, #04123a 100%);
  border: 1px solid var(--electric-blue);
}

.flashcard-back {
  background: linear-gradient(135deg, #184617 0%, #06220e 100%);
  border: 1px solid var(--emerald-green);
  transform: rotateY(180deg);
}

.flashcard-hint {
  font-size: 0.75rem;
  color: var(--gold);
  margin-top: 14px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 25, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-blue);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}


.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  line-height: 1.5;
  font-size: 0.95rem;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--blue-gradient);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: rgba(14, 38, 97, 0.7);
  border: 1px solid rgba(45, 125, 255, 0.2);
  color: #e6efff;
  border-bottom-left-radius: 4px;
}

.chat-input-bar {
  padding: 14px 16px;
  background: rgba(4, 18, 58, 0.7);
  border-top: 1px solid rgba(45, 125, 255, 0.15);
  display: flex;
  gap: 10px;
}

.chat-input-bar textarea {
  flex: 1;
  background: rgba(8, 26, 75, 0.8);
  border: 1px solid rgba(45, 125, 255, 0.3);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  resize: none;
  height: 48px;
  font-family: inherit;
}

.btn-send-ai {
  background: var(--gold-gradient);
  color: #04123a;
  border: none;
  font-weight: 800;
  border-radius: var(--radius-md);
  padding: 0 20px;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-send-ai:hover {
  transform: translateY(-2px);
}

/* Grille de documents / cours */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: rgba(30, 111, 255, 0.5);
}

.course-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.course-icon-badge {
  width: 44px;
  height: 44px;
  background: rgba(30, 111, 255, 0.15);
  border: 1px solid var(--electric-blue);
  color: var(--cyan);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.course-card-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.course-card-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.course-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.btn-action-small {
  background: rgba(14, 38, 97, 0.6);
  border: 1px solid rgba(45, 125, 255, 0.3);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-small:hover {
  background: var(--electric-blue);
  color: #fff;
  border-color: var(--electric-blue);
}

.btn-action-small.gold {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-action-small.gold:hover {
  background: var(--gold);
  color: #04123a;
}

.btn-action-small.danger {
  border-color: var(--coral-red);
  color: var(--coral-red);
}

.btn-action-small.danger:hover {
  background: var(--coral-red);
  color: #fff;
}

/* Flashcards 3D Interactive */
.flashcards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
}

.flashcard {
  width: 100%;
  max-width: 480px;
  height: 260px;
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 20px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-blue);
}

.flashcard-front {
  background: linear-gradient(135deg, #092368 0%, #04123a 100%);
  border: 1px solid var(--electric-blue);
}

.flashcard-back {
  background: linear-gradient(135deg, #184617 0%, #06220e 100%);
  border: 1px solid var(--emerald-green);
  transform: rotateY(180deg);
}

.flashcard-hint {
  font-size: 0.75rem;
  color: var(--gold);
  margin-top: 14px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 25, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-blue);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}


/* ========================================================
   BOUTONS INSTALLATION PWA (ANDROID & IOS)
======================================================== */
.btn-install-pwa {
  background: linear-gradient(135deg, #00d2ff 0%, #1e6fff 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
  margin-bottom: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-install-pwa:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 210, 255, 0.6);
}

.btn-header-install {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-install:hover {
  background: var(--cyan);
  color: #04123a;
}

/* ========================================================
   EN-TÊTE ET INSTRUCTIONS ORANGE MONEY
======================================================== */
.orange-transfer-box {
  background: rgba(255, 102, 0, 0.1);
  border: 1px solid rgba(255, 102, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.orange-transfer-box h4 {
  color: #ff7700;
  font-size: 1.05rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.orange-number-badge {
  display: inline-block;
  background: #ff6600;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  margin: 10px 0;
  box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
}

.orange-instructions {
  font-size: 0.85rem;
  color: #ffd6b3;
  line-height: 1.5;
}
