/* Reset léger */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Thème général */
:root {
  --bg: #0f172a;          /* fond global sombre */
  --bg-card: #ffffff;     /* cartes claires */
  --border-subtle: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-hover: #1d4ed8;
}

/* Corps de page */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e293b 0, #020617 50%, #020617 100%);
  color: var(--text-main);
  line-height: 1.6;
}

/* Conteneur global */
.page-shell {
  max-width: 1100px;
  margin: 24px auto 40px auto;
  padding: 0 16px;
}

/* En-tête */
header {
  margin-bottom: 16px;
}

.site-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #e5e7eb;
}

.site-title h1 {
  font-size: 1.7rem;
  font-weight: 650;
}

.site-title p {
  font-size: 0.95rem;
  color: #9ca3af;
}

/* Navigation */
nav {
  margin-top: 16px;
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  backdrop-filter: blur(12px);
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

nav a {
  text-decoration: none;
  font-size: 0.9rem;
  color: #e5e7eb;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

nav a:hover {
  background: rgba(148, 163, 184, 0.25);
  transform: translateY(-1px);
}

nav a.active {
  background: var(--accent);
  color: #f9fafb;
}

/* Carte principale */
main {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px 22px 26px 22px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.30);
}

/* Typo générale */
h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

h3 {
  font-size: 1.12rem;
  margin-top: 20px;
  margin-bottom: 6px;
}

h4 {
  font-size: 1rem;
  margin-top: 16px;
  margin-bottom: 4px;
}

p {
  margin-top: 4px;
  margin-bottom: 10px;
  color: var(--text-main);
}

p.muted,
.text-muted {
  color: var(--text-muted);
}

/* Listes */
ul,
ol {
  margin-left: 18px;
  margin-top: 4px;
  margin-bottom: 10px;
}

li + li {
  margin-top: 2px;
}

/* Liens dans le contenu */
main a {
  color: var(--accent);
  text-decoration: none;
}

main a:hover {
  text-decoration: underline;
}

/* Blocs CTA */
.cta-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  margin-top: 8px;
  padding: 7px 14px;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.cta-links a:hover {
  background: var(--accent);
  color: #f9fafb;
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.9rem;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

thead th {
  background: #f9fafb;
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Code / pre */
code {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: #f3f4f6;
  padding: 2px 4px;
  border-radius: 4px;
}

pre {
  background: #0b1120;
  color: #e5e7eb;
  padding: 10px 12px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin-top: 8px;
  margin-bottom: 10px;
}

pre.code-block {
  background: #0f172a; /* bleu nuit */
  color: #e2e8f0; /* gris clair lisible */
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.95rem;
}

/* Footer */
footer {
  max-width: 1100px;
  margin: 16px auto 20px auto;
  padding: 0 16px;
  font-size: 0.82rem;
  color: #9ca3af;
}

footer p {
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 640px) {
  nav ul {
    justify-content: flex-start;
  }

  main {
    padding: 18px 14px 20px 14px;
  }

  .site-title h1 {
    font-size: 1.4rem;
  }
}
/* Correction visibilité header */
header {
  color: #f1f5f9 !important;
}

header .site-title h1 {
  color: #f8fafc !important;
}

/* Correction visibilité sous-titre header */
header .site-title p {
  color: #f9fafb !important;                 /* blanc bien visible */
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.7);  /* petit halo pour le contraste */
  font-weight: 400;
}

.ghi-indicator {
  max-width: 960px;
  margin: 2rem auto;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.ghi-indicator-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.ghi-indicator-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}

.ghi-indicator-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

.ghi-gauge-wrapper {
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
}

.ghi-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.ghi-gauge-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #e5e7eb 0%,
    #c4d4ff 35%,
    #c4f2d2 50%,
    #fde68a 65%,
    #fecaca 100%
  );
  overflow: hidden;
}

.ghi-gauge-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 0 0 2px #ffffff;
  transition: left 0.4s ease, background-color 0.4s ease;
}

.ghi-gauge-marker.zone-below_cost {
  background: #2563eb;
}

.ghi-gauge-marker.zone-near_cost {
  background: #16a34a;
}

.ghi-gauge-marker.zone-above_cost {
  background: #ea580c;
}

.ghi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ghi-metric-card {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 0.7rem 0.8rem;
  background: #f9fafb;
}

.ghi-metric-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.15rem;
}

.ghi-metric-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.ghi-metric-help {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 0.15rem;
}

.ghi-disclaimer {
  font-size: 0.7rem;
  color: #6b7280;
  line-height: 1.4;
  margin-top: 0.5rem;
}

.ghi-email-section {
  margin-top: 1.75rem;
  padding-top: 1.2rem;
  border-top: 1px solid #e5e7eb;
}

.ghi-email-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.8rem;
}

.ghi-email-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.ghi-email-text {
  font-size: 0.8rem;
  color: #6b7280;
}

.ghi-email-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.ghi-email-input {
  flex: 1 1 220px;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.6rem 0.9rem;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ghi-email-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb33;
}

.ghi-email-button {
  border-radius: 999px;
  border: none;
  padding: 0.65rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: #0f172a;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.ghi-email-button:hover {
  background: #111827;
}

.ghi-email-button:active {
  transform: translateY(1px);
}

.ghi-email-privacy {
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 900px) {
  .ghi-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .ghi-indicator {
    margin: 1.5rem 1rem;
    padding: 1.25rem 1.1rem;
  }
  .ghi-metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* Carte principale pour la page API */
.api-section {
  max-width: 1100px;
  margin: 24px auto 40px auto;
  padding: 24px 22px 26px 22px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.30);
  color: var(--text-main);
}

/* Texte normal + texte atténué dans la carte API */
.api-section p {
  color: var(--text-main);
}

.api-section p.muted,
.api-section .text-muted {
  color: var(--text-muted);
}

/* ------------------------------
   STYLE PRO – BLOCS API / CODE
   ------------------------------ */

.api-section pre,
.api-section code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Bloc <pre> (fond clair haut contraste) */
.api-section pre {
  background: #f4f4f5;       /* gris clair */
  color: #1f2937;            /* gris très foncé (lisible) */
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  overflow-x: auto;
  white-space: pre;
  margin: 12px 0;
}

/* Bloc inline <code> dans le texte */
.api-section code {
  background: #e4e4e7;
  color: #1f2937;
  padding: 2px 6px;
  border-radius: 5px;
}

/* Titres de sections API */
.api-section h2 {
  margin-top: 32px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
}

.api-section h3 {
  margin-top: 20px;
  font-size: 1.2rem;
  font-weight: 500;
  color: #374151;
}

/* Encadrés "Exemple de requête", "Exemple de réponse" */
.api-box-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  margin-top: 12px;
  margin-bottom: 4px;
}
/* ------------------------------
   Indicateur GHI – jauge prix/coût
   ------------------------------ */

.ghi-indicator {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: #0f172a;            /* fond proche du header */
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.55);
  color: #e5e7eb;
}

.ghi-indicator-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.ghi-indicator-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f9fafb;
}

.ghi-indicator-subtitle {
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* Jauge */

.ghi-gauge-wrapper {
  margin-top: 0.75rem;
}

.ghi-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #9ca3af;
  margin-bottom: 0.4rem;
}

.ghi-gauge-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(248, 113, 113, 0.25),
    rgba(234, 179, 8, 0.25),
    rgba(52, 211, 153, 0.25)
  );
  overflow: visible;
}

/* Le marqueur (curseur) */
.ghi-gauge-marker {
  position: absolute;
  top: 50%;
  left: 50%;                         /* position neutre par défaut */
  transform: translate(-50%, -50%);
  width: 14px;
  height: 26px;
  border-radius: 999px;
  background: #e5e7eb;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.4),
    0 10px 20px rgba(15, 23, 42, 0.6);
  transition: left 0.3s ease-out, background-color 0.25s ease-out;
  z-index: 2;
}

/* Teinte du curseur selon la zone */
.ghi-zone-below .ghi-gauge-marker {
  background: #f97373;               /* rouge doux */
}

.ghi-zone-near .ghi-gauge-marker {
  background: #fbbf24;               /* jaune doux */
}

.ghi-zone-above .ghi-gauge-marker {
  background: #4ade80;               /* vert doux */
}

/* Cartes de métriques */

.ghi-metrics-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.ghi-metric-card {
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.ghi-metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.ghi-metric-value {
  margin-top: 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f9fafb;
}

.ghi-metric-help {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 900px) {
  .ghi-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ghi-metrics-grid {
    grid-template-columns: 1fr;
  }
}
/* ------------------------------
   Dashboard – styles spécifiques
   ------------------------------ */

main.dashboard-main {
  max-width: 1200px;
  margin: 32px auto 64px;
}

.dashboard-card {
  background: #f9fafb;
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  margin-bottom: 24px;
}

.dashboard-card h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
  color: #020617;
}

.dashboard-card h2 {
  font-size: 1.1rem;
  margin-top: 20px;
  margin-bottom: 6px;
  color: #020617;
}

.dashboard-card p {
  margin: 4px 0 10px;
  color: #1e293b;
}

.table-wrapper {
  overflow-x: auto;
}

table.snapshot-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.9rem;
}

table.snapshot-table th,
table.snapshot-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

table.snapshot-table thead th {
  font-weight: 600;
  color: #0f172a;
  background: #e5e7eb;
}

table.snapshot-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Bloc relation prix / coût + jauge --- */

.ghi-indicator-card {
  margin-top: 16px;
  background: radial-gradient(circle at top left, #0f172a, #020617);
  border-radius: 24px;
  padding: 24px 28px 20px;
  color: #f9fafb;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.7);
}

.ghi-indicator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ghi-indicator-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.ghi-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
 }
  /* Header indicateur GHI – mise en forme plus compacte */

.ghi-indicator-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 16px;
}

.ghi-indicator-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f9fafb;
  margin: 0;
}

.ghi-indicator-meta {
  font-size: 0.78rem;
  color: #cbd5e1;
  margin: 0;
}

.ghi-indicator-meta .meta-label {
  font-weight: 400;
}

.ghi-indicator-meta .meta-value {
  font-weight: 600;
}

.ghi-indicator-meta .meta-sep {
  margin: 0 6px;
  opacity: 0.7;
}

/* ---------------------------------
   Corrections bloc "Relation prix / coût"
   sur la carte du dashboard
   --------------------------------- */

/* Forcer l'alignement à gauche dans la carte */
.ghi-indicator-card .ghi-indicator-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
  margin-bottom: 12px;
}

/* Titre bien visible sur fond blanc */
.ghi-indicator-card .ghi-indicator-title {
  color: #111827;       /* gris très foncé */
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

/* Ligne "mode / sources" plus lisible */
.ghi-indicator-card .ghi-indicator-meta {
  font-size: 0.8rem;
  color: #4b5563;       /* gris moyen lisible */
  margin: 0;
}

.ghi-indicator-card .ghi-indicator-meta .meta-label {
  font-weight: 400;
}

.ghi-indicator-card .ghi-indicator-meta .meta-value {
  font-weight: 600;
}

.ghi-indicator-card .ghi-indicator-meta .meta-sep {
  margin: 0 6px;
  opacity: 0.75;
}

/* Texte descriptif FR/EN sous le header */
.ghi-indicator-card > p {
  font-size: 0.82rem;
  color: #4b5563;
}

/* Bandeau "Vue rapide" dans la carte indicateur */

.ghi-quick-indicator {
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
  padding: 1rem 1.1rem;
  border-radius: 0.9rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.ghi-quick-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.ghi-quick-metric {
  min-width: 140px;
}

.ghi-quick-metric .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.ghi-quick-metric .value {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

/* Réutilisation de la jauge globale mais adaptée ici */

.ghi-quick-indicator .ghi-gauge-wrapper {
  margin-top: 0.2rem;
}

.ghi-quick-indicator .ghi-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.ghi-quick-indicator .ghi-gauge-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(52, 211, 153, 0.2),   /* sous le coût */
    rgba(250, 204, 21, 0.3),   /* proche du coût */
    rgba(248, 113, 113, 0.3)   /* largement au-dessus */
  );
  overflow: visible;
}

.ghi-quick-indicator .ghi-gauge-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 24px;
  border-radius: 999px;
  background: #111827;
  box-shadow:
    0 0 0 1px #ffffff,
    0 8px 18px rgba(15, 23, 42, 0.55);
  transition: left 0.3s ease-out;
}

/* Note sous la jauge */
.ghi-quick-note {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: #6b7280;
}

/* Responsive */
@media (max-width: 700px) {
  .ghi-quick-metrics {
    flex-direction: column;
  }
}

.footer-social {
  margin-top: 40px;
  padding: 25px 0;
  display: flex;
  justify-content: center;
  gap: 25px;
  background: #0f172a; /* le bleu nuit de ton site */
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-social .social-icon svg {
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0.85;
}

.footer-social .social-icon:hover svg {
  opacity: 1;
  transform: scale(1.06);
}

.page-card {
  background: #f9fafb;
  color: #0f172a;
  padding: 2rem 2.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.45);
  max-width: 960px;
  margin: 2rem auto 3rem;
}

.page-card h1,
.page-card h2,
.page-card h3 {
  color: #0f172a;
}

.page-card p,
.page-card li {
  line-height: 1.6;
}

.page-card .lang-switch {
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  color: #64748b;
}

.page-card .lang-switch a {
  color: #0f172a;
  text-decoration: none;
}

.page-card .lang-switch a:hover {
  text-decoration: underline;
}

/* Correction lisibilité blocs de code */
main pre {
  background: #f4f4f8 !important;   /* gris clair lisible */
  color: #111 !important;           /* texte noir */
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  border: 1px solid #ddd;
}

main code {
  background: transparent !important;
  color: #111 !important;
}