/* -------------------------------
   DEPUTYDATA — STYLE GLOBAL
   Version raffinée (micro-améliorations)
   Template conservé, cohérence préservée
------------------------------- */

:root {
  --bg-light: #F3F5F9;  /* 1️⃣ Fond légèrement gris clair */
  --card-light: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --border-light: #E2E8F0;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-hover: 0 8px 20px rgba(0,0,0,0.05);
  --badge-bg-light: #EEF2FF;
  --badge-text-light: #1D3D8F;
  --accent: #1e3a8a;
  --slider-track: #E2E8F0;
  --slider-thumb: #1e3a8a;
}

body.dark-mode {
  --bg-light: #0a0c10;
  --card-light: #141824;
  --text-primary: #E5E7EB;
  --text-secondary: #94A3B8;
  --border-light: #1E293B;
  --slider-track: #334155;
  --slider-thumb: #60A5FA;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  transition: background 0.2s, color 0.2s;
}

/* STICKY NAVBAR (inchangé) */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-light);
  padding: 0 1.5rem;
  transition: background 0.2s;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  max-width: 1400px;
  margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 44px; width: auto; }
.logo span {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0f172a, var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
body.dark-mode .logo span {
  background: linear-gradient(135deg, #E5E7EB, #94A3B8);
  background-clip: text;
  color: transparent;
}
.dark-toggle {
  background: none;
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.9rem;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: 0.2s;
}
.dark-toggle:hover { background: rgba(0,0,0,0.05); transform: scale(0.98); }

/* MENU PRINCIPAL (inchangé) */
.nav-menu {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 1rem;
  padding: 0.6rem 0;
  max-width: 1400px;
  margin: 0 auto;
}
.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.nav-menu a:hover { background: rgba(66, 99, 235, 0.08); color: var(--accent); transform: translateY(-1px); }
.nav-menu a.active { background: var(--accent); color: white; }

/* CONTAINER */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* 2️⃣ TITRES H1 - réduction de 10-15% */
h1, .hero h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
@media (max-width: 768px) {
  h1, .hero h1 { font-size: 1.5rem; }
}

/* 3️⃣ CARTES - ombre légère, profondeur subtile */
.tool-card, .card, .insight-card, .section-card {
  background: var(--card-light);
  border-radius: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}
.tool-card:hover, .card:hover, .insight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* 4️⃣ SLIDERS - thumb plus petit, track discret */
input[type="range"] {
  width: 100%;
  height: 3px;
  -webkit-appearance: none;
  background: var(--slider-track);
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--slider-thumb);
  cursor: pointer;
  transition: 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* 5️⃣ CHARTS - réduire gridlines et saturation */
.chart-container canvas {
  filter: saturate(0.95);
}
.chart-container {
  background: var(--card-light);
  border-radius: 1rem;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid var(--border-light);
}

/* 6️⃣ EXPORT BUTTONS - uniformisés */
.btn-primary, .btn-outline, button, .btn-group button {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.7rem;
  font-weight: 500;
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: 0.2s;
}
.btn-primary {
  background: #1e2f3e;
  color: white;
  border: none;
}
.btn-primary:hover { background: #2a4d7c; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.btn-outline:hover { background: rgba(0,0,0,0.03); transform: translateY(-1px); }

/* 7️⃣ SPACING - plus d’espace dans scorecards, sections */
.results-panel, .metric, .insight-box {
  margin-bottom: 0.8rem;
}
.metric {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.75rem;
}
.section-spacing {
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.tools-grid {
  gap: 1.8rem;
  margin: 2rem 0;
}

/* 8️⃣ MODE SOMBRE - amélioration lisibilité */
body.dark-mode .tool-card p,
body.dark-mode .metric span,
body.dark-mode p {
  color: #CBD5E1;
}
body.dark-mode .tool-card h3,
body.dark-mode h2 {
  color: #F1F5F9;
}
body.dark-mode .insight-box {
  background: #1E293B;
  border-left-color: #3B82F6;
}

/* 9️⃣ EMOJIS - remplacement progressif (préférer icônes) */
/* Aucun emoji dans le CSS ; les icônes sont gérées par Font Awesome */
/* Dans le HTML, privilégier <i class="fas fa-xxx"></i> */

/* BADGES (inchangés, déjà institutionnels) */
.tool-badge, .badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.6rem;
  font-weight: 600;
  background: var(--badge-bg-light);
  color: var(--badge-text-light);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 0.6rem;
}
body.dark-mode .tool-badge, body.dark-mode .badge {
  background: #1E293B;
  color: #CBD5E1;
  border-color: #2D3A4A;
}

/* GRILLES & RESPONSIVE (inchangés) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
footer {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-secondary);
  padding: 1.2rem 0;
  border-top: 1px solid var(--border-light);
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }

@media (max-width: 768px) {
  .sticky-nav { padding: 0 1rem; }
  .top-bar { padding: 0.6rem 0; }
  .logo img { height: 32px; }
  .logo span { font-size: 1.2rem; }
  .nav-menu a { font-size: 0.7rem; padding: 0.3rem 0.7rem; }
  .container { padding: 1rem; }
  .tools-grid { gap: 1rem; }
  footer { flex-direction: column; }
}
/* ==========================================
   INSTITUTIONAL REFINEMENTS (global)
   ========================================== */

/* 1. Charts - gridlines discrètes, labels plus petits */
.chart-container canvas {
  filter: saturate(0.95);
}
.chart-container {
  background: var(--card-light);
  border-radius: 1rem;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid var(--border-light);
}
canvas {
  max-height: 250px;
  width: 100%;
}
/* Gridlines plus subtiles */
.chart-container canvas + .chartjs-render-monitor {
  filter: brightness(0.98);
}

/* 2. Footer plus institutionnel */
footer {
  text-align: center;
  font-size: 0.6rem;
  color: var(--text-secondary);
  padding: 1.2rem 0;
  border-top: 1px solid var(--border-light);
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
footer .footer-brand {
  font-weight: 600;
  margin-bottom: 0.2rem;
}
footer .footer-tagline {
  font-size: 0.55rem;
  color: var(--text-secondary);
  opacity: 0.7;
}
.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.55rem;
  transition: 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}

/* 3. Boutons export uniformisés (plus sobres) */
.btn-group .btn-primary,
.btn-group .btn-outline {
  padding: 0.4rem 0.9rem;
  font-size: 0.65rem;
  height: auto;
  border-radius: 2rem;
}
.btn-group .btn-primary i,
.btn-group .btn-outline i {
  font-size: 0.7rem;
}

/* 4. Hero block uniformisé */
.tool-card .tool-badge {
  margin-bottom: 0.5rem;
}
.tool-card h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}
.tool-card > p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* 5. Input cards - uniformisation */
.input-group label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
}
input, select {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.75rem;
  transition: 0.2s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30,58,138,0.1);
}

/* 6. Result cards - structure uniforme */
.results-panel {
  background: var(--bg-light);
  border-radius: 0.8rem;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
}
.metric {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.7rem;
}
.metric:last-child {
  border-bottom: none;
}

/* 7. Interpretation box - standard */
.interpretation-box {
  background: #0f172a;
  color: white;
  padding: 1rem;
  border-radius: 0.8rem;
  margin: 1rem 0;
}
body.dark-mode .interpretation-box {
  background: #141824;
}
.interpretation-box strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}
.interpretation-box p {
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0;
}

/* 8. Score card standard (pour tous les outils) */
.score-card {
  background: #0f172a;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}
body.dark-mode .score-card {
  background: #141824;
}
.score-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.score-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.3rem;
  opacity: 0.8;
}
.score-card .gauge {
  margin-top: 0.5rem;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}
.score-card .gauge-fill {
  height: 6px;
  border-radius: 3px;
}

/* 9. Responsive */
@media (max-width: 768px) {
  .tool-card h1 {
    font-size: 1.3rem;
  }
  .score-value {
    font-size: 1.6rem;
  }
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}