/* ============================================================================
   DRENAET Bouaké 2 — Charte visuelle
   Palette ancrée dans l'identité ivoirienne (bleu institutionnel + tricolore
   orange/blanc/vert du drapeau, utilisé avec retenue) ; typographie mixte
   serif (titres, gravité administrative) / système (texte courant, lisibilité).
   ============================================================================ */

:root {
  --bleu-nuit:     #0a3d66;
  --bleu:          #14649e;
  --bleu-clair:    #eaf3fb;
  --orange:        #e07b39;
  --orange-fonce:  #b85f27;
  --vert-ci:       #128a4b;
  --gris-fond:     #f6f8fa;
  --gris-carte:    #f4f6f8;
  --gris-bordure:  #e4e9ee;
  --gris-texte:    #333b43;
  --gris-discret:  #6c757d;

  /* Alias conservés pour compatibilité avec les vues existantes */
  --drenaet-bleu: var(--bleu);
  --drenaet-bleu-fonce: var(--bleu-nuit);
  --drenaet-orange: var(--orange);
  --drenaet-gris: var(--gris-carte);

  --police-titres: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', serif;
  --police-texte: 'Segoe UI', system-ui, -apple-system, sans-serif;

  --ombre-legere: 0 2px 10px rgba(10, 61, 102, .06);
  --ombre-moyenne: 0 10px 28px rgba(10, 61, 102, .12);
  --rayon: 12px;
}

* { scroll-behavior: smooth; }

body {
  font-family: var(--police-texte);
  background: var(--gris-fond);
  color: var(--gris-texte);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .section-titre { font-family: var(--police-titres); }

a { transition: color .15s ease; }

/* ===== Liseré tricolore — signature discrète de la plateforme ===== */
.liseré-national, .lisere-national {
  height: 4px;
  background: linear-gradient(90deg, var(--orange) 0 33.33%, #ffffff 33.33% 66.66%, var(--vert-ci) 66.66% 100%);
}

/* ===== Bandeau institutionnel (armoirie + République) ===== */
.bandeau-institutionnel {
  background: #fff; border-bottom: 1px solid var(--gris-bordure); color: #1a1a1a;
  letter-spacing: .2px;
}
.bandeau-institutionnel .armoirie-site { height: 40px; }
.bandeau-institutionnel strong { color: var(--bleu-nuit); font-family: var(--police-titres); letter-spacing: .4px; }

/* ===== Navigation ===== */

/* Menu "Demande d'actes" : ouverture au survol de la souris (desktop).
   Sur écran tactile (pas de :hover fiable), le clic reste géré par Bootstrap
   (data-bs-toggle="dropdown" déjà présent sur le bouton). */
@media (hover: hover) and (pointer: fine) {
  .dropdown-survol:hover > .dropdown-menu {
    display: block;
    margin-top: 0;
  }
}
.navbar-institutionnelle {
  background: linear-gradient(90deg, var(--bleu-nuit), var(--bleu));
  box-shadow: var(--ombre-legere);
}
.navbar-institutionnelle .navbar-brand,
.navbar-institutionnelle .nav-link { color: #fff !important; font-weight: 500; }
.navbar-institutionnelle .navbar-brand { font-family: var(--police-titres); letter-spacing: .3px; }
.navbar-institutionnelle .nav-link { position: relative; }
.navbar-institutionnelle .nav-link:hover { color: var(--orange) !important; }
.navbar-institutionnelle .nav-link:not(.btn)::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: -2px; height: 2px;
  background: var(--orange); transition: left .18s ease, right .18s ease;
}
.navbar-institutionnelle .nav-link:not(.btn):hover::after { left: 6px; right: 6px; }

/* ===== Boutons ===== */
.btn { border-radius: 8px; font-weight: 500; transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease; }
.btn-primary {
  background: var(--bleu); border-color: var(--bleu);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--bleu-nuit); border-color: var(--bleu-nuit); transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(10, 61, 102, .22);
}
.btn-warning { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-warning:hover { background: var(--orange-fonce); border-color: var(--orange-fonce); color: #fff; transform: translateY(-1px); }
.btn-outline-primary { color: var(--bleu); border-color: var(--bleu); }
.btn-outline-primary:hover { background: var(--bleu); border-color: var(--bleu); }
.btn-success { background: var(--vert-ci); border-color: var(--vert-ci); }
.btn-success:hover { filter: brightness(.92); }

/* ===== Formulaires ===== */
.form-control:focus, .form-select:focus {
  border-color: var(--bleu); box-shadow: 0 0 0 .2rem rgba(20, 100, 158, .15);
}
.form-label { font-weight: 500; color: var(--gris-texte); font-size: .92rem; }

/* ===== Visuels de remplacement (image absente du serveur, sans dépendance internet) ===== */
.image-remplacement {
  background: linear-gradient(135deg, var(--bleu-nuit), var(--bleu));
  color: #fff; display: flex; align-items: center; justify-content: center;
  text-align: center; font-weight: 600; font-family: var(--police-titres);
}
.image-remplacement-carrousel { width: 100%; height: 460px; font-size: 1.5rem; letter-spacing: .5px; }
.image-remplacement-actualite { width: 100%; height: 140px; font-size: 1rem; }
.photo-directeur.image-remplacement { background: var(--gris-carte); color: #9aa4ad; border: 4px solid #fff; }

/* ===== Carrousel ===== */
.carousel-hero { box-shadow: var(--ombre-moyenne); }
.carousel-hero .carousel-item img {
  height: 460px; object-fit: cover;
}
.carousel-hero .carousel-item::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(10,29,48,.78) 0%, rgba(10,29,48,.15) 45%, rgba(10,29,48,0) 70%);
  pointer-events: none;
}
.carousel-hero .carousel-caption { bottom: 6%; text-align: left; left: 8%; right: 8%; z-index: 2; }
.carousel-hero .carousel-caption h2 { font-family: var(--police-titres); font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.carousel-hero .carousel-indicators [data-bs-target] { background-color: var(--orange); }

/* ===== Sections vitrine ===== */
.section-titre {
  font-weight: 700; color: var(--bleu-nuit); position: relative;
  padding-bottom: 12px; margin-bottom: 22px;
}
.section-titre::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--vert-ci));
  border-radius: 2px;
}

.carte-activite {
  background: #fff; border: 1px solid var(--gris-bordure); border-radius: var(--rayon); padding: 22px;
  height: 100%; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.carte-activite:hover { transform: translateY(-4px); box-shadow: var(--ombre-moyenne); border-color: transparent; }
.carte-activite i { font-size: 1.9rem; color: var(--orange); margin-bottom: 10px; display: block; }
.carte-activite h5 { font-family: var(--police-titres); }

.carte-actualite {
  background: #fff; border: 1px solid var(--gris-bordure); border-radius: var(--rayon); overflow: hidden;
  height: 100%; transition: box-shadow .18s ease, transform .18s ease;
}
.carte-actualite:hover { box-shadow: var(--ombre-moyenne); transform: translateY(-3px); }
.carte-actualite img { width: 100%; height: 140px; object-fit: cover; }

/* ===== Volet droit : mot du directeur ===== */
.carte-directeur {
  background: #fff; border: 1px solid var(--gris-bordure); border-radius: var(--rayon); padding: 26px; text-align: center;
  box-shadow: var(--ombre-legere);
}
.photo-directeur {
  width: 132px; height: 132px; object-fit: cover; border-radius: 50%;
  border: 4px solid var(--bleu-clair); box-shadow: var(--ombre-moyenne);
}
.mot-directeur {
  text-align: left; font-style: italic; color: #444; margin-top: 16px; font-size: .93rem;
  border-left: 3px solid var(--orange); padding-left: 14px; font-family: var(--police-titres);
}
.mot-directeur i { color: var(--orange); }

/* ===== Volet droit : liens utiles ===== */
.carte-liens-utiles {
  background: #fff; border: 1px solid var(--gris-bordure); border-radius: var(--rayon); padding: 22px;
  box-shadow: var(--ombre-legere);
}
.carte-liens-utiles h5 { color: var(--bleu-nuit); margin-bottom: 16px; font-family: var(--police-titres); }
.carte-liens-utiles li { margin-bottom: 11px; }
.carte-liens-utiles a { color: var(--gris-texte); text-decoration: none; transition: color .15s ease, padding-left .15s ease; }
.carte-liens-utiles a:hover { color: var(--orange); padding-left: 3px; }
.carte-liens-utiles i { color: var(--bleu); margin-right: 8px; }

/* ===== Login / portail agent ===== */
.carte-login {
  background: #fff; border: 1px solid var(--gris-bordure); border-radius: var(--rayon); padding: 34px;
  box-shadow: var(--ombre-moyenne);
}

/* ===== Dashboard & statistiques ===== */
.carte-stat {
  background: #fff; border: 1px solid var(--gris-bordure); border-radius: var(--rayon); padding: 20px; text-align: center;
  transition: box-shadow .18s ease, transform .18s ease;
}
.carte-stat:hover { box-shadow: var(--ombre-legere); transform: translateY(-2px); }
.carte-stat .chiffre { font-size: 2.1rem; font-weight: 700; color: var(--bleu); font-family: var(--police-titres); }
.carte-stat .libelle { color: var(--gris-discret); font-size: .85rem; }

/* ===== Fiche agent (modale absence) ===== */
.carte-fiche-agent { background: var(--gris-carte); border-radius: 10px; padding: 16px 18px; border: 1px solid var(--gris-bordure); }

/* ===== Cartes et tableaux (écrans de gestion) ===== */
.card { border: 1px solid var(--gris-bordure); border-radius: var(--rayon); box-shadow: var(--ombre-legere); }
.card-header {
  background: var(--bleu-clair); border-bottom: 1px solid var(--gris-bordure);
  font-weight: 600; color: var(--bleu-nuit);
}
.table { --bs-table-hover-bg: var(--bleu-clair); }
.table thead th { color: var(--bleu-nuit); border-bottom-width: 2px; font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; }

/* ===== Badges ===== */
.badge.bg-success { background-color: var(--vert-ci) !important; }
.badge.bg-secondary { background-color: #7c8894 !important; }

/* ===== Footer ===== */
.footer-institutionnel {
  background: linear-gradient(180deg, var(--bleu-nuit), #06263f);
  color: #cfe0ef;
}
.footer-institutionnel h6 { color: #fff; font-family: var(--police-titres); letter-spacing: .3px; }

/* ===== Responsive ===== */
@media (max-width: 767px) {
  .carousel-hero .carousel-item img { height: 300px; }
  .carousel-hero .carousel-caption h2 { font-size: 1.1rem; }
  .carte-login { padding: 22px; }
}

/* ===== Accessibilité : focus clavier visible partout ===== */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--orange); outline-offset: 2px;
}

/* ===== Respect de la préférence "réduire les animations" ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
