/* ===== Variables et base ===== */
:root {
  --bleu: #1b5fa8;
  --bleu-fonce: #0f3d6e;
  --vert: #3a9d4f;
  --vert-clair: #e8f5ec;
  --blanc: #ffffff;
  --gris: #f4f7fa;
  --texte: #1c2733;
  --rayon: 14px;
  --ombre: 0 6px 20px rgb(15 61 110 / 10%);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; color: var(--texte); background: var(--blanc); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bleu); }
.conteneur { width: min(1120px, 92%); margin-inline: auto; }
.lien-evitement { position: absolute; left: -999px; background: var(--vert); color: var(--blanc); padding: .5rem 1rem; z-index: 100; }
.lien-evitement:focus { left: 0; }

/* ===== En-tête (barre de navigation reprise de test3) ===== */
.header {
  /* variables propres à la barre : le reste du site n'est pas modifié */
  --bleu-nuit: #0b2a4a; --bleu-clair: #eaf2fb; --vert: #2f9e55; --vert-clair: #e8f6ed;
  --texte: #1a2a3a; --ligne: #e3eaf1; --ombre: 0 12px 32px rgb(11 42 74 / 12%);
  position: sticky; top: 0; z-index: 50;
  font: 400 1.05rem/1.65 "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  background: rgb(255 255 255 / 86%); backdrop-filter: blur(14px); border-bottom: 1px solid var(--ligne);
}
.header :focus-visible { outline: 3px solid var(--vert); outline-offset: 3px; border-radius: 6px; }
.header-interieur { width: min(1280px, 96%); display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.logo { display: flex; flex: none; align-items: center; white-space: nowrap; gap: .7rem; text-decoration: none; color: var(--bleu-nuit); font-weight: 800; font-size: 1.1rem; line-height: 1.1; }
.logo small { display: block; margin-top: .15rem; font-size: .7rem; font-weight: 600; color: var(--vert); }

/* ===== Menu ===== */
.menu-liste { display: flex; align-items: center; gap: .1rem; margin: 0; padding: 0; list-style: none; }
.menu-element { position: relative; padding-block: 1.1rem; }
.menu-element > a:not(.bouton-contact) { display: block; padding: .5rem .6rem; white-space: nowrap; border-radius: 99px; color: var(--texte); font-size: .93rem; font-weight: 600; text-decoration: none; }
.menu-element > a:not(.bouton-contact):hover, .menu-element:focus-within > a:not(.bouton-contact) { background: var(--bleu-clair); color: var(--bleu); }
.bouton-contact { display: inline-flex; align-items: center; justify-content: center; margin-left: .4rem; padding: .6rem 1.3rem; border: 2px solid transparent; border-radius: 99px; background: var(--vert); color: var(--blanc); font-size: .95rem; font-weight: 700; text-decoration: none; transition: transform .2s, background .2s; }
.bouton-contact:hover { background: #25834a; transform: translateY(-2px); }

.sous-menu { position: absolute; top: calc(100% - .4rem); left: 0; min-width: 240px; margin: 0; padding: .5rem; list-style: none; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; box-shadow: var(--ombre); opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s; }
.menu-element:nth-last-child(-n+3) .sous-menu { left: auto; right: 0; }
.menu-element:hover .sous-menu, .menu-element:focus-within .sous-menu { opacity: 1; visibility: visible; transform: none; }
.sous-menu a { display: block; padding: .5rem .8rem; border-radius: 10px; color: var(--texte); text-decoration: none; font-size: .95rem; }
.sous-menu a:hover { background: var(--vert-clair); color: #1f7a40; }

.case-menu { position: absolute; opacity: 0; pointer-events: none; }
.bouton-menu { display: none; position: relative; width: 46px; height: 46px; border-radius: 14px; background: var(--bleu-clair); cursor: pointer; }
.bouton-menu span, .bouton-menu span::before, .bouton-menu span::after { position: absolute; left: 12px; width: 22px; height: 2px; border-radius: 2px; background: var(--bleu); content: ""; }
.bouton-menu span { top: 22px; }
.bouton-menu span::before { top: -7px; left: 0; }
.bouton-menu span::after { top: 7px; left: 0; }
.case-menu:focus-visible ~ .bouton-menu { outline: 3px solid var(--vert); outline-offset: 3px; }

@media (max-width: 1320px) {
  .bouton-menu { display: block; }
  .menu { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - 76px); overflow-y: auto; padding: 1rem 4% 2rem; background: var(--blanc); border-bottom: 1px solid var(--ligne); box-shadow: var(--ombre); }
  .case-menu:checked ~ .menu { display: block; }
  .menu-liste { flex-direction: column; align-items: stretch; }
  .menu-element { padding-block: .3rem; }
  .menu-element > a:not(.bouton-contact) { font-size: 1.05rem; }
  .menu-element:nth-last-child(-n+3) .sous-menu { right: auto; }
  .sous-menu { position: static; min-width: 0; border: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; padding: 0 0 .4rem 1rem; }
  .bouton-contact { margin: .6rem 0 0; }
}

/* ===== Compte connecté : avatar, grade et menu déroulant ===== */
.menu { margin-left: auto; }
.avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: #eaf2fb; color: #1b5fa8; font-size: .95rem; font-weight: 800; box-shadow: 0 0 0 3px var(--couleur-grade, #1b5fa8); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-grand { width: 88px; height: 88px; font-size: 1.8rem; }
.grade { padding: .25rem .8rem; border-radius: 99px; background: var(--couleur-grade, #5a6b7d); color: #fff; font-size: .78rem; font-weight: 800; white-space: nowrap; }

.compte { position: relative; margin-left: 1.2rem; }
.compte-resume { display: flex; align-items: center; gap: .5rem; padding: .3rem .8rem .3rem .3rem; border: 1px solid var(--ligne); border-radius: 99px; background: var(--blanc); list-style: none; cursor: pointer; transition: box-shadow .2s; }
.compte-resume::-webkit-details-marker { display: none; }
.compte-resume::after { content: ""; width: 7px; height: 7px; margin: -3px 0 0 .1rem; border-right: 2px solid var(--texte); border-bottom: 2px solid var(--texte); transform: rotate(45deg); transition: transform .2s; }
.compte[open] .compte-resume::after { margin-top: 3px; transform: rotate(-135deg); }
.compte-resume:hover { box-shadow: var(--ombre); }
.compte-menu { max-height: calc(100vh - 110px); overflow-y: auto; position: absolute; top: calc(100% + .5rem); left: 0; z-index: 60; min-width: 280px; padding: .6rem; border: 1px solid var(--ligne); border-top: 4px solid var(--couleur-grade); border-radius: 16px; background: var(--blanc); box-shadow: var(--ombre); }
.compte-nom { margin: 0; padding: .5rem .8rem .7rem; border-bottom: 1px solid var(--ligne); color: var(--bleu-nuit); font-weight: 800; line-height: 1.3; }
.compte-nom small { display: block; color: var(--couleur-grade); font-size: .82rem; }
.compte-menu ul { margin: .4rem 0 0; padding: 0; list-style: none; }
.compte-menu a, .compte-menu button { display: block; width: 100%; padding: .55rem .8rem; border: 0; border-radius: 10px; background: none; color: var(--texte); font: inherit; font-size: .95rem; text-align: left; text-decoration: none; cursor: pointer; }
.compte-menu a:hover, .compte-menu button:hover { background: var(--bleu-clair); color: var(--bleu); }
.compte-menu li:first-child a { font-weight: 700; }
.compte-menu li:last-child { margin-top: .3rem; padding-top: .3rem; border-top: 1px solid var(--ligne); }
.compte-menu li:last-child button:hover { background: #fdecec; color: #c62828; }

@media (max-width: 1320px) {
  .compte { position: static; margin-left: auto; }
  .compte-menu { left: auto; right: 4%; width: min(300px, 92vw); }
  .compte ~ .bouton-menu { margin-left: .8rem; }
  .bouton-menu { margin-left: auto; }
}
@media (max-width: 560px) {
  .compte-resume .grade, .logo small { display: none; }
  .logo { font-size: 1rem; }
  .logo img { width: 40px; height: 40px; }
  .compte { margin-left: auto; }
}
@media (max-width: 400px) {
  .logo { font-size: .9rem; gap: .5rem; }
  .logo img { width: 36px; height: 36px; }
  .compte-resume { gap: .3rem; padding-right: .5rem; }
  .avatar { width: 38px; height: 38px; }
}
