:root {
  --gradient: linear-gradient(135deg, #0D1B4B 0%, #1A3A6B 40%, #0E4D6B 70%, #0A6E82 100%);
  --accent: #00B4D8;
  --green: #26D07C;
  --red: #E84855;
  --gold: #F7B731;
  --purple: #7C3AED;
  --teal: #14B8A6;
  --white-80: rgba(255, 255, 255, 0.8);
  --white-50: rgba(255, 255, 255, 0.5);
  --white-10: rgba(255, 255, 255, 0.1);
  --font: 'Outfit', sans-serif;
}

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

html, body {
  min-height: 100%;
  font-family: var(--font);
  color: #fff;
  background: var(--gradient);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════
   BOKEH (identique au module réinscription)
════════════════════════════════════════════════════════ */
.bokeh-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bokeh-sphere { position: absolute; border-radius: 50%; filter: blur(2px); opacity: 0.55; will-change: transform; transition: transform 0.6s ease-out; }
.bokeh-sphere.cyan { background: radial-gradient(circle at 35% 35%, var(--accent), transparent 70%); }
.bokeh-sphere.green { background: radial-gradient(circle at 35% 35%, var(--green), transparent 70%); }
.bokeh-sphere.white { background: radial-gradient(circle at 35% 35%, #fff, transparent 70%); }

/* ═══════════════════════════════════════════════════════
   GLASS CARD (base réutilisée)
════════════════════════════════════════════════════════ */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
}

/* ═══════════════════════════════════════════════════════
   TOPBAR
════════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  background: rgba(13, 27, 75, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--white-10);
}

.topbar-logo { height: 36px; width: auto; }

.topbar-titles { display: flex; flex-direction: column; }
.topbar-title { font-size: 16px; font-weight: 800; }
.topbar-subtitle { font-size: 11px; color: var(--white-50); }

.topbar-spacer { flex: 1; }

.topbar-year-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(38, 208, 124, 0.15);
  border: 1px solid rgba(38, 208, 124, 0.4);
  color: var(--green);
  animation: badgePulse 2.6s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(38, 208, 124, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(38, 208, 124, 0); }
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--red), #C0392B);
  font-size: 13px;
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════
   HUB MAIN
════════════════════════════════════════════════════════ */
.hub-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ═══════════════════════════════════════════════════════
   HERO
════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
.hero-greeting { font-size: 26px; font-weight: 800; }
.hero-date { font-size: 13px; color: var(--white-80); text-transform: capitalize; }

.alert-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.chip-orange { background: rgba(247, 183, 49, 0.15); border: 1px solid rgba(247, 183, 49, 0.4); color: var(--gold); }
.chip-green { background: rgba(38, 208, 124, 0.15); border: 1px solid rgba(38, 208, 124, 0.4); color: var(--green); }
.chip-red { background: rgba(232, 72, 85, 0.15); border: 1px solid rgba(232, 72, 85, 0.4); color: var(--red); }
.chip-cyan { background: rgba(0, 180, 216, 0.15); border: 1px solid rgba(0, 180, 216, 0.4); color: var(--accent); }

/* ═══════════════════════════════════════════════════════
   ROBOT
════════════════════════════════════════════════════════ */
.robot-wrap { position: relative; z-index: 1; flex-shrink: 0; width: 120px; height: 130px; }

.robot {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  animation: robotFloat 3s ease-in-out infinite;
  transition: filter 0.3s ease;
}

@keyframes robotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.robot-antenna {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
}
.robot-antenna::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.robot-head {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(160deg, #E8EEF7, #C7D4E6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.robot-eye {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: robotBlink 4s ease-in-out infinite;
}

@keyframes robotBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.15); }
}

.robot-body {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(160deg, #D6E0EE, #AEBED6);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.robot-arm {
  position: absolute;
  top: 70px;
  right: 6px;
  width: 8px;
  height: 26px;
  border-radius: 4px;
  background: #C7D4E6;
  transform-origin: top center;
  animation: robotWave 2.5s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes robotWave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-24deg); }
  50% { transform: rotate(12deg); }
  75% { transform: rotate(-12deg); }
}

.robot.bounce { animation: robotBounce 0.5s ease; }
@keyframes robotBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-22px) scale(1.05); }
  50% { transform: translateY(0) scale(0.96); }
  70% { transform: translateY(-8px) scale(1.02); }
}

.robot.shake { animation: robotShake 0.5s ease; }
@keyframes robotShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-4deg); }
  40% { transform: translateX(8px) rotate(4deg); }
  60% { transform: translateX(-6px) rotate(-3deg); }
  80% { transform: translateX(6px) rotate(3deg); }
}

.robot.rainbow .robot-head,
.robot.rainbow .robot-body {
  animation: robotRainbow 1s linear infinite;
}
@keyframes robotRainbow {
  0% { filter: hue-rotate(0deg) saturate(1.8); }
  100% { filter: hue-rotate(360deg) saturate(1.8); }
}

.robot-speech-bubble {
  position: absolute;
  top: -8px;
  left: 100%;
  margin-left: 12px;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  color: #0D1B4B;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.robot-speech-bubble::before {
  content: '';
  position: absolute;
  top: 16px;
  left: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
}

/* ═══════════════════════════════════════════════════════
   BLOC iEnroll
════════════════════════════════════════════════════════ */
.ienroll-block { padding: 28px; display: flex; flex-direction: column; gap: 22px; }

.ienroll-header { display: flex; align-items: center; gap: 16px; }

.ienroll-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), #C0392B);
  flex-shrink: 0;
}

.ienroll-title { font-size: 19px; font-weight: 800; }
.ienroll-subtitle { font-size: 12px; color: var(--white-80); }

.ienroll-total { margin-left: auto; text-align: right; }
.ienroll-total-value { display: block; font-size: 22px; font-weight: 800; color: var(--accent); }
.ienroll-total-label { font-size: 11px; color: var(--white-50); text-transform: uppercase; letter-spacing: 0.05em; }

.subblocks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.subblock {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.subblock:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.1); }

.subblock-title-shadow {
  align-self: flex-start;
  font-size: 14px;
  font-weight: 700;
  color: #0D1B4B;
  background: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.subblock-donut-row { display: flex; align-items: center; gap: 18px; }
.subblock-donut svg { display: block; }

.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.donut-legend-item { display: flex; align-items: center; gap: 6px; }
.donut-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.progress-block { display: flex; flex-direction: column; gap: 8px; }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--white-80); }
.progress-bar-outer { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.progress-bar-inner { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--green)); }

.niveau-chips { display: flex; gap: 8px; }

.subblock-footer { display: flex; gap: 16px; font-size: 11px; color: var(--white-80); }
.subblock-footer strong { display: block; font-size: 15px; font-weight: 800; color: #fff; }

.subblock-cta {
  align-self: flex-end;
  margin-top: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   APPS GRID
════════════════════════════════════════════════════════ */
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.app-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  color: inherit;
  text-decoration: none;
  opacity: 1;
}
.app-card.clickable { cursor: pointer; }
.app-card.clickable:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}
.app-card.disabled { opacity: 0.5; cursor: not-allowed; }

.app-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.app-card-name { font-size: 15px; font-weight: 700; }
.app-card-subtitle { font-size: 12px; color: var(--white-50); margin-top: -8px; }
.app-card-stats { font-size: 12px; color: var(--white-50); }

.app-card-progress { display: flex; flex-direction: column; gap: 6px; }
.app-card-progress-label { font-size: 11px; color: var(--white-80); }

.app-card-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white-80);
}

/* ═══════════════════════════════════════════════════════
   TOPBAR — utilisateur connecté + déconnexion (dashboard)
════════════════════════════════════════════════════════ */
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-user-name { font-size: 13px; font-weight: 600; }
.topbar-user-role { font-size: 11px; color: var(--white-50); text-transform: capitalize; }

.logout-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  transition: background 0.2s ease;
}
.logout-btn:hover { background: rgba(232, 72, 85, 0.25); }

/* ═══════════════════════════════════════════════════════
   LOGIN SCREEN (dashboard)
════════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo img { height: 40px; }
.login-logo-title { font-size: 15px; font-weight: 800; }

.login-title { font-size: 20px; font-weight: 800; margin-top: 4px; }
.login-subtitle { font-size: 12px; color: var(--white-50); margin-top: -12px; }

.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 12px; color: var(--white-80); }
.login-field input {
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
}
.login-field input::placeholder { color: var(--white-50); }
.login-field input:focus { outline: none; border-color: var(--accent); }

.login-error {
  display: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(232, 72, 85, 0.15);
  border: 1px solid rgba(232, 72, 85, 0.4);
  color: #ffb3b8;
  font-size: 13px;
}

.login-btn {
  height: 46px;
  border-radius: 10px;
  background: var(--accent);
  color: #0D1B4B;
  font-weight: 700;
  font-size: 14px;
}
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .subblocks-grid { grid-template-columns: 1fr; }
  .apps-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; }
  .robot-speech-bubble { left: 50%; transform: translateX(-50%); top: -60px; }
  .robot-speech-bubble::before { display: none; }
  .apps-grid { grid-template-columns: 1fr; }
}
