/* ── VARIABLES & RESET ── */
:root {
  --bg: #0b0e14;
  --surface: #13171f;
  --card: #181d27;
  --border: #232a38;
  --C: #f59e0b;
  --M: #3b82f6;
  --A: #10b981;
  --J: #e879f9;
  --text: #e2e8f0;
  --muted: #64748b;
  --ferie: #ef4444;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; }
body {
  background: var(--bg);
  font-family: 'Barlow', sans-serif;
  color: var(--text);
  min-height: 100vh;
}

/* ── ANIMATED BLOB BACKGROUND ── */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .12;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: strict;
}
.blob-1 {
  width: 400px; height: 400px;
  background: var(--C);
  top: -10%; left: -5%;
  animation: blobFloat1 25s ease-in-out infinite;
}
.blob-2 {
  width: 320px; height: 320px;
  background: var(--M);
  top: 50%; right: -8%;
  animation: blobFloat2 30s ease-in-out infinite;
}
.blob-3 {
  width: 280px; height: 280px;
  background: var(--J);
  bottom: -10%; left: 30%;
  animation: blobFloat3 28s ease-in-out infinite;
}
/* Désactiver les blobs si le GPU galère */
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}
@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(120px, 80px) scale(1.1); }
  66%      { transform: translate(-60px, 140px) scale(0.95); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-100px, -60px) scale(1.15); }
  66%      { transform: translate(50px, -120px) scale(0.9); }
}
@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(80px, -70px) scale(1.05); }
  66%      { transform: translate(-100px, 40px) scale(1.1); }
}

/* ── ANIMATIONS GLOBALES ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(245,158,11,.15); }
  50%      { box-shadow: 0 0 20px rgba(245,158,11,.3); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes popIn {
  0%   { transform: scale(0.95); opacity: 0; }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── FORM ELEMENTS (partagés) ── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--C); box-shadow: 0 0 0 3px rgba(245,158,11,.07), 0 0 16px rgba(245,158,11,.08); }
.form-input::placeholder { color: var(--muted); }
select.form-input { appearance: none; cursor: pointer; }

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(11,14,20,.75);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(35,42,56,.6);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-icon {
  width: 34px; height: 34px;
  background: var(--C);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 16px; color: #000;
}
.brand-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 19px; font-weight: 800;
  color: #fff; text-transform: uppercase; letter-spacing: 1px;
}
.brand-name span { color: var(--C); }
.brand-sub {
  font-size: 9px; color: var(--muted);
  letter-spacing: 2px; text-transform: uppercase;
  display: block; margin-top: 1px;
}
.nav-tabs { display: flex; align-items: stretch; gap: 0; margin-left: 28px; height: 100%; }
.nav-tab {
  padding: 0 18px; height: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; background: none;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s, transform .1s;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { color: var(--C); border-bottom-color: var(--C); text-shadow: 0 0 12px rgba(245,158,11,.4); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
#nav-clock {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--muted); letter-spacing: 2px;
}
.nav-sep {
  width: 1px; height: 28px;
  background: var(--border);
  flex-shrink: 0;
}
.user-chip { display: flex; align-items: center; gap: 14px; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-nom-text {
  font-family: 'Barlow', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.user-grade {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 5px;
  line-height: 1.5;
  white-space: nowrap;
}
.grade-admin      { background: rgba(245,158,11,.15); color: var(--C);  border: 1px solid rgba(245,158,11,.3); }
.grade-exploitant { background: rgba(59,130,246,.15);  color: var(--M);  border: 1px solid rgba(59,130,246,.3); }
.grade-conducteur { background: rgba(16,185,129,.15);  color: var(--A);  border: 1px solid rgba(16,185,129,.3); }
.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700;
  padding: 7px 16px; border-radius: 7px;
  cursor: pointer; letter-spacing: 1px; text-transform: uppercase;
  transition: color .18s, border-color .18s, background .18s;
  white-space: nowrap;
}
.btn-logout:hover {
  color: #fff;
  border-color: var(--ferie);
  background: rgba(239,68,68,.1);
}
.btn-logout:active, .btn-settings:active, .nav-tab:active {
  transform: scale(0.93);
}
.btn-settings {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 7px; cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: color .18s, border-color .18s;
  flex-shrink: 0;
}
.btn-settings:hover { color: var(--text); border-color: var(--muted); }
.pwd-error   { font-size: 12px; color: var(--ferie); min-height: 16px; margin-top: -6px; }
.pwd-success { font-size: 12px; color: var(--A);     min-height: 16px; margin-top: -6px; }

/* ── PAGES ── */
.page { display: none; padding: 24px 18px; max-width: 1020px; margin: 0 auto; }
.page.active { display: block; animation: fadeSlideUp .4s ease-out; }

/* ── ANIMATIONS ── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
  .topbar { padding: 0 12px; }
  #nav-clock { display: none; }
  .nav-sep { display: none; }
  .page { padding: 16px 12px; }
}
@media (max-width: 600px) {
  /* Logo : juste le carré JP, pas de texte */
  .brand-name { display: none; }
  .brand-sub  { display: none; }
  /* Tabs plus serrés */
  .nav-tabs { margin-left: 10px; }
  .nav-tab  { padding: 0 11px; font-size: 12px; letter-spacing: 1px; }
  /* User chip compact */
  .user-nom-text { display: none; }
  .user-grade    { font-size: 9px; padding: 2px 7px; }
  .btn-logout    { padding: 5px 10px; font-size: 11px; letter-spacing: 0; }
  .btn-settings  { width: 28px; height: 28px; font-size: 13px; }
}
@media (max-width: 400px) {
  /* Très petits écrans : cacher le bouton déconnexion, garder la roue dentée */
  .btn-logout { display: none; }
  .nav-tab    { padding: 0 9px; font-size: 11px; }
}
