/* =========================================================
   🎨 STYLES GLOBAUX — LeTEF.fr
   Version 2.2
   ========================================================= */

/* === Couleurs et variables principales === */
:root {
  --brand-blue: #1e3a8a;
  --brand-blue-dark: #3e4470;
  --brand-tef: #0d6efd;
  --brand-tef-hover: #006902;
  --brand-dark: #182b45;
  --brand-light: #ffffff;
  --gray-bg: #f9fafc;

  --tef-primary: #0d359b;
  --tef-primary-hover: #43497c;
  --ltc-accent: #2094ef;
}

/* Couleurs de texte */
.text-tef-primary {
  color: var(--tef-primary) !important;
}

.bg-primary-ltc {
  background-color: var(--tef-primary) !important;
}

.text-ltc-accent {
  color: var(--ltc-accent) !important;
}

/* Arrière-plans */
.bg-tef-primary {
  background-color: var(--tef-primary) !important;
}

.bg-ltc-accent {
  background-color: var(--ltc-accent) !important;
}

.border-primary-ltc {
  border: 1px solid var(--tef-primary) !important;
}

.border-home-ltc {
  border: 1px solid #bec1d5 !important;
}

#local-dev-warning {
  background-color: #ffdbcd;
  border: 1px solid #ffdbcd;
  color: #171716;
  border-radius: 0.375rem;
}

/* .border-success {
  border-color: #b6e3b6 !important;
}
.border-warning {
  border-color: #f7dca1 !important;
}
.border-danger {
  border-color: #f0b7b7 !important;
} */

/* === ⚙️ Réglages globaux === */
html {
  scroll-padding-top: 80px;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--brand-dark);
  background-color: #fff;
  line-height: 1.6;
}

.ltc-link {
  color: var(--tef-primary); /* couleur principale par défaut */
  text-decoration: none;
  transition:
    color 0.2s ease,
    text-decoration 0.2s ease;
}

.ltc-link:hover,
.ltc-link:focus {
  color: var(--ltc-accent); /* couleur d’accent au survol */
  text-decoration: underline;
}

.ltc-link-underline {
  color: var(--tef-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.ltc-link-underline:hover,
.ltc-link-underline:focus {
  color: var(--ltc-accent);
}

/* === 🪶 Titres fluides === */

/* === Titres responsives et harmonisés === */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #1e3a8a !important; /* couleur principale */
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.9rem, 2.6vw, 2.3rem);
}

h2 {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  font-weight: 600;
}

h3 {
  font-size: clamp(1.4rem, 1.9vw, 1.8rem);
  font-weight: 600;
}

h4 {
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
}

h5 {
  font-size: 1rem;
  font-weight: 500;
}

h6 {
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* =========================================================
   🧭 NAVBAR PRINCIPALE — Toujours au-dessus
   ========================================================= */
.main-navbar {
  position: sticky;
  top: 0;
  background-color: var(--brand-blue);
  padding: 0.75rem 0;
  transition: all 0.3s ease;
  z-index: 2000; /* ✅ toujours au-dessus */
}

.main-navbar.scrolled {
  background-color: var(--brand-blue-dark);
  padding: 0.4rem 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.nav-link {
  color: var(--brand-light) !important;
  font-size: 1.1rem;
  transition: color 0.2s ease;
}
.nav-link:hover,
.nav-link:focus {
  color: var(--brand-tef) !important;
}

.logo_title {
  font-size: 30px;
  font-weight: 700;
  color: var(--brand-tef);
  display: flex;
  align-items: center;
}

@media (max-width: 575px) {
  .btn-cta-sim {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
}

/* === Responsive dropdowns === */
@media (max-width: 767.98px) {
  .navbar .dropdown-menu {
    width: 100%;
  }
  .navbar .dropdown-menu .dropdown-item {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

/* =========================================================
   📦 CONTAINERS / GRID
   ========================================================= */
.container,
.container-sm,
.container-md,
.container-lg,
.container-xl {
  width: 100%;
  padding: 0 15px;
  margin: 0 auto;
}

@media (min-width: 576px) {
  .container,
  .container-sm {
    max-width: 540px;
  }
}
@media (min-width: 768px) {
  .container,
  .container-md {
    max-width: 720px;
  }
}
@media (min-width: 992px) {
  .container,
  .container-lg {
    max-width: 960px;
  }
}
@media (min-width: 1200px) {
  .container,
  .container-xl {
    max-width: 1140px;
  }
}
@media (min-width: 1400px) {
  .container-xl {
    max-width: 1320px;
  }
}

/* =========================================================
   🧱 CARDS & LAYOUTS
   ========================================================= */
.card-custom {
  min-height: 160px;
}

.Xcard {
  cursor: pointer;
  transition:
    box-shadow 0.3s ease,
    transform 0.2s ease;
}
.Xcard:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* =========================================================
   🧡 BOUTONS
   ========================================================= */
.btn-sut {
  font-weight: 600;
  color: var(--brand-tef);
  border-color: var(--brand-tef);
}
.btn-sut:hover,
.btn-sut:active {
  color: #2a2730;
  background-color: var(--brand-tef);
  border-color: var(--brand-tef);
}
.btn-sut:focus {
  box-shadow: 0 0 0 3px rgba(255, 228, 132, 0.25);
}

.btn-expand {
  background: var(--brand-tef);
  color: var(--brand-light);
  border: none;
  transition: all 0.2s ease;
}
.btn-expand:hover {
  background: var(--brand-tef-hover);
  transform: translateY(-2px);
  color: var(--brand-light);
}

.btn-expand:disabled,
.btn-expand[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  background: var(--brand-tef) !important;
  color: var(--brand-light) !important;
}

/* CTA OUTLINE */
.btn-ltc-cta-outline {
  background: transparent;
  color: var(--brand-tef);
  border: 2px solid var(--brand-tef);
  transition: all 0.2s ease;
}

.btn-ltc-cta-outline:hover {
  background: var(--brand-tef);
  color: var(--brand-light);
  transform: translateY(-2px);
  border-color: var(--brand-tef-hover);
}

/* Disabled */
.btn-ltc-cta-outline:disabled,
.btn-ltc-cta-outline[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  background: transparent !important;
  color: var(--brand-tef) !important;
  border-color: var(--brand-tef) !important;
}

.btn-tef-primary {
  background: var(--tef-primary);
  color: var(--brand-light);
  border: none;
  transition: all 0.2s ease;
}
.btn-tef-primary:hover {
  background: var(--tef-primary);
  transform: translateY(-2px);
  color: var(--brand-light);
}

/* =========================================================
   🖱️ HOVER & DIVERS
   ========================================================= */
.hover-shadow {
  transition: all 0.3s ease;
}
.hover-shadow:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.country-flag {
  width: 30px;
  height: 20px;
  box-shadow: 0 0 0 1px black;
}

.my-link {
  text-decoration: none;
}
.my-link:hover {
  text-decoration: underline;
}

/* =========================================================
   💬 ALERTES / MESSAGES FLASH
   ========================================================= */
.flash-container {
  animation: fadeInDown 0.4s ease;
  z-index: 2100;
}
/* ... */
@media (max-width: 576px) {
  .flash-container {
    top: 70px;
    width: 95%;
  }
}

/* =========================================================
   📑 SECTIONS / PAGES SPÉCIFIQUES
   ========================================================= */
.page-layout {
  background-color: var(--gray-bg);
  min-height: 70vh;
  animation: fadeInPage 0.3s ease;
}
@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Titres page === */
.page-layout h1 {
  color: var(--brand-blue);
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
}
.page-layout .lead {
  color: var(--brand-tef);
  font-weight: 500;
}

/* === Breadcrumb stylisé === */
.breadcrumb-item + .breadcrumb-item::before {
  color: #6c757d;
}
.breadcrumb a {
  color: var(--brand-blue);
}
.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--brand-tef);
}

.hero-subtitle {
  color: var(--brand-tef) !important;
}

.h2-hero {
  font-size: clamp(1.3rem, 1.7vw, 2rem) !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

/* === Page "À propos" === */
.page-layout ul li {
  font-size: 1rem;
  line-height: 1.6;
}

/* === Page "Contact" === */
#contact-form .form-control:focus {
  border-color: var(--brand-tef);
  box-shadow: 0 0 0 0.15rem rgba(236, 114, 17, 0.25);
}
#contact-form .btn-expand {
  background-color: var(--brand-tef);
  border: none;
  transition: all 0.2s ease;
}
#contact-form .btn-expand:hover {
  background-color: var(--brand-tef-hover);
  transform: translateY(-2px);
}
#contact-feedback {
  font-weight: 600;
  text-align: center;
}

/* =========================================================
   📊 COMPOSANTS / BLOCS GÉNÉRIQUES
   ========================================================= */
.message-danger {
  color: var(--brand-dark);
  border-radius: 0.375rem;
  background-color: #f8d7da;
  border-color: #f8d7da;
}
.message-warning {
  color: var(--brand-dark);
  border-radius: 0.375rem;
  background-color: #fff3cd;
  border-color: #e6dbb9;
}

/* === Ad Bar === */
.ad-bar {
  background-color: var(--brand-dark);
  color: var(--brand-tef);
  font-weight: 700;
  text-align: center;
  padding: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 2050; /* ✅ au-dessus de la navbar */
}
.ad-bar a {
  color: inherit;
  text-decoration: underline;
}
.ad-bar a:hover {
  color: var(--brand-light);
}

/* === Code blocks === */
pre,
code {
  white-space: pre;
  border: 0 !important;
  border-radius: 0;
}

/* === Search bar === */
#search-input:focus,
#search-button:focus {
  outline: none;
  box-shadow: none;
}
#search-bar:focus-within {
  border-radius: 0.375rem;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* === Report block === */
.report {
  height: 600px;
  outline: #e5e5e5 solid 2px !important;
  outline-offset: -1px !important;
  padding: 10px;
}

/* === Séparateur horizontal === */
.horizontal-divider {
  height: 2px;
  background-color: #fff;
}

/* === Footer === */
.footer-link {
  color: #ffffffcc;
  text-decoration: none;
  transition:
    color 0.2s ease,
    text-decoration 0.2s ease;
  display: inline-block; /* rend le lien "tactile" sans l’agrandir visuellement */
  padding: 0.25rem 0.2rem; /* ~4×3px de zone cliquable supplémentaire */
}

.footer-link:hover,
.footer-link:focus {
  color: var(--brand-tef);
  text-decoration: underline;
}

/* petit espacement entre les liens horizontaux */
.footer-link + .footer-link {
  margin-left: 0.4rem;
}

.text-light-50 {
  color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   Couleur personnalisée
   =========================== */

/* === Bouton Retour Haut === */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--brand-tef);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s;
  z-index: 1500;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover {
  background-color: var(--brand-tef-hover);
  transform: translateY(-3px);
}

/* =========================================================
   🎯 DASHBOARD NAV — Sticky + Dropdown Mobile Fix
   ========================================================= */

.fixed-dashboard-nav {
  position: sticky;
  top: 70px; /* hauteur navbar principale */
  z-index: 1020;
  background-color: #f8f9fa;
  border-bottom: 2px solid rgba(79, 86, 141, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dashboard-nav {
  overflow: visible !important;
}

/* Liens */
.dashboard-link {
  color: var(--brand-blue);
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 0.375rem;
  background: transparent;
  display: inline-flex;
  align-items: center;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.dashboard-link:hover,
.dashboard-link:focus {
  background-color: rgba(79, 86, 141, 0.08);
  color: var(--brand-blue-dark);
}
.dashboard-link.active,
.dropdown-item.active {
  background-color: var(--brand-blue);
  color: #fff !important;
}

/* Sous-menus */
.dropdown-menu {
  min-width: 190px;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  z-index: 1500;
}
.dropdown-item {
  color: var(--brand-blue-dark);
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dropdown-item:hover {
  background-color: rgba(79, 86, 141, 0.08);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .dashboard-nav {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .dashboard-nav::-webkit-scrollbar {
    display: none;
  }
  .dashboard-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
  .dropdown-menu {
    position: absolute !important;
    transform: translateY(5px);
    left: 0;
    right: auto;
  }
}

/* =========================================================
   🇫🇷 FOOTER MODERNE — Institutionnel et responsive
   ========================================================= */

.footer-modern {
  font-size: 0.95rem;
  color: var(--brand-dark);
}

.footer-modern h6 {
  font-weight: 600;
}

.footer-modern .footer-link {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-modern .footer-link:hover {
  color: var(--brand-tef);
  text-decoration: underline;
}

.footer-modern img {
  border-radius: 2px;
}

/* Ligne et espacements */
.footer-modern hr {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .footer-modern {
    text-align: center;
  }
  .footer-modern .col-6,
  .footer-modern .col-12 {
    text-align: center;
  }
  .footer-modern ul {
    padding-left: 0;
  }
}

/* Bouton retour haut */
#back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: var(--brand-tef);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s;
  z-index: 1500;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover {
  background-color: var(--brand-tef-hover);
  transform: translateY(-3px);
}

/* Equal button heights follow the tallest label at the current screen width. */
#dashboard-preparation {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
}
@media (min-width: 768px) {
  #dashboard-preparation {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Separate summary indicators only when displayed side by side. */
@media (min-width: 768px) {
  .report-summary-metrics > div + div {
    border-inline-start: 1px solid var(--bs-border-color);
    padding-inline-start: 1rem;
  }
}
