:root{
  --navbar-pad-x: clamp(12px, 2.5vw, 32px);
  --navbar-pad-y: clamp(10px, 1.8vw, 20px);
  --navbar-h: calc(var(--navbar-pad-y) * 2 + 60px);

  /* Tokens visuels */
  --ink: #111;
  --ink-weak: rgba(0,0,0,.8);
  --card-bg: #ffffff;
  --card-hover: #f1feff;
  --glass-bg: rgba(255,255,255,.05);
  --glass-bd: rgba(255,255,255,.6);
  --shadow-soft: 0 2px 6px rgba(0,0,0,.19);
  --shadow-med: 0 4px 10px rgba(0,0,0,.23);
  --shadow-strong: 0 6px 16px rgba(0,0,0,.32);
}

html { -webkit-text-size-adjust: 100%; }

/* ============ BASE ============ */
.navbar,
.navbar-container,
.navbar-left,
#nav-list,
.nav-link,
.dropdown-menu a,
.m-menu a{
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}
.navbar *{ box-sizing: border-box; }

/* ============ NAVBAR (fond dégradé) ============ */
.navbar{
  position: sticky; top: 0; width: 100%;
  padding-block: 0;
  background: linear-gradient(90deg,#003077 0%,#002a80 5%,#0070c0 30%,#00b5e2 60%,#8be8f7 90%,#a8edea 100%);
  box-shadow: var(--shadow-strong);
  z-index: 9999;
}
.navbar-container{
  max-width: 1400px;
  min-height: var(--navbar-h);
  padding-block: var(--navbar-pad-y);
  margin-inline: auto;
  padding-inline: var(--navbar-pad-x);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: clamp(2rem, 5vw, 4rem);
  position: relative;
}

/* ============ BLOC GAUCHE ============ */
.navbar-left{
  display: flex; align-items: center; gap: .75rem;
  min-width: 0; flex-shrink: 0; padding-left: .5rem;
}
.navbar-left img{ height: 48px; width: auto; }
.navbar-left h1{ margin: 0; white-space: nowrap; color: #fff; font-size: 1.8rem; }

/* ============ LISTE TOP-LEVEL (desktop) ============ */
#nav-list{
  justify-self: end;
  display: flex; align-items: center; gap: .8rem;
  list-style: none; margin: 0; padding-right: 0;
  white-space: nowrap; flex-wrap: nowrap;

}

/* ============ LIENS COMMUNS (desktop) ============ */
.nav-link{
  display: inline-flex; align-items: center;
  min-height: 36px; padding: .5rem .8rem; line-height: 1.2;
  font-size: 1.1rem; font-weight: 600; text-decoration: none;
  color: var(--ink);
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);  /* ✅ bordure restaurée */
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  transition: background .3s ease, color .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.nav-link:hover{
  background: rgba(0,0,0,.40);
  color: #fff;
  border-color: #fff;
  box-shadow: var(--shadow-med);
}
.nav-link:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }
.nav-link.active{
  background: rgba(0,0,0,.50);
  color: #fff;
  border-color: #fff;
  box-shadow: var(--shadow-strong);
}

/* ============ DROPDOWN (desktop) ============ */
.dropdown{ position: relative; }
.dropdown::after{ content:""; position:absolute; left:0; right:0; top:100%; height:10px; }
.dropdown-menu{
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: max(220px, 100%);
  display: flex; flex-direction: column;
  padding: .5rem 0; border-radius: 12px; z-index: 50;
  background: var(--card-bg); box-shadow: var(--shadow-strong);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.dropdown-menu a{
  display: block; padding: .6rem 1rem; font-size: 1rem;
  text-decoration: none; color: var(--ink); border-radius: 8px;
}
.dropdown-menu a:hover{ background-color: var(--card-hover); font-weight: 700; }

@media (min-width:1301px){
  .dropdown:hover > .dropdown-menu,
  .dropdown:focus-within > .dropdown-menu{
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
    transition: opacity .15s ease, transform .15s ease, visibility 0s;
  }
}
.navbar .dropdown.open > .dropdown-menu{
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
  transition: opacity .15s ease, transform .15s ease, visibility 0s;
}

/* ============ BURGER ============ */
.burger{
  background: rgba(0, 26, 141, 0.15);
  border: 1px solid rgba(255, 255, 255, .65);  /* ✅ bordure restaurée */
  color: #fff;
  align-self: center; justify-self: end; display: none; 
  padding: 0.5rem;
  font-size: 2rem; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow-med);
  border-radius: 12px;
  transition: background .25s ease, box-shadow .25s ease;
}
.burger:hover { background: rgba(0,0,0,.30); box-shadow: var(--shadow-strong); }

/* ============ MOBILE / BURGER (≤1300px) ============ */
@media (max-width:1300px){
  .burger{ display: block; }
  .navbar-container{ position: static; }

  #nav-list{
    position: fixed; top: var(--navbar-h); left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: .5rem;
    padding: 1rem var(--navbar-pad-x) 1.25rem;
    max-height: calc(100dvh - var(--navbar-h)); overflow: auto;
    background: linear-gradient(90deg,#00a9dd 0%,#00b5e2 10%,#5cd9f5 40%,#8be8f7 70%,#a8edea 100%);
    border-top: 1px solid rgba(255,255,255,.35);
    backdrop-filter: saturate(120%) blur(2px);
    z-index: 9998;
  }
  .navbar.is-open #nav-list{ display: flex; }

  .dropdown-menu{ display: none !important; }
  #nav-list > li:not(.m-dropdown):not(.m-item){ display: none !important; }

  #nav-list > li > a.nav-link,
  .m-toggle {
    width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .75rem;
    color: #fff; font-weight: 700; font-size: 1.1rem; line-height: 1.2;
    border-radius: 12px; padding: .65rem .9rem;
    background: rgba(0, 26, 141, 0.18);
    border: 1px solid rgba(255,255,255,.65);  /* ✅ bordure restaurée */
    box-shadow: var(--shadow-med);
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
  }
  #nav-list > li > a.nav-link:hover,
  .m-toggle:hover {
    background: rgba(0,0,0,.30);
    color: #fff;
    border-color: #fff;
    box-shadow: var(--shadow-strong);
    transform: scale(1.02);
    transition: all .25s ease;
  }

  .m-toggle:focus-visible{ outline:2px solid #fff; outline-offset:2px; }
  .m-toggle::after{ content:"▾"; font-size: 1rem; opacity: .9; transform: translateY(1px) rotate(0deg); transition: transform .2s ease; }
  .m-dropdown.open .m-toggle::after{ transform: translateY(1px) rotate(180deg); }

  .m-menu{ display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
  .m-dropdown.open .m-menu{ grid-template-rows: 1fr; }

  .m-menu-inner {
    overflow: hidden; margin-top: .3rem; padding: .1rem 0;
    background: rgba(255, 255, 255, 0.50);
    border-radius: 8px; border: 1px solid rgba(0,0,0,.06);
    box-shadow: var(--shadow-med);
    transition: box-shadow .2s ease, transform .2s ease;
  }
  .m-menu-inner:hover { box-shadow: var(--shadow-strong); transform: translateY(-1px); }

  .m-menu a{
    position: relative; display: block; padding: .65rem 1rem;
    font-size: 1rem; line-height: 1.3; font-weight: 400;
    color: var(--ink); text-decoration: none; border-radius: 8px; white-space: nowrap;
    transition: background .2s ease, color .2s ease;
  }
  .m-menu a::after{ content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: 800; white-space: nowrap; pointer-events: none; }
  .m-menu a:hover{ background: rgba(214,253,255,.80); color: #111111e5; font-weight: 600; }

  .m-menu .submenu-home > a{ font-weight: 800; }
  #nav-list > li + li{ margin-top: .15rem; }
}

/* ============ DESKTOP (≥1301px) ============ */
@media (min-width:1301px){
  #nav-list > li.m-dropdown,
  #nav-list > li.m-item{ display: none !important; }
}

/* ============ ACCESSIBILITÉ / MOTION ============ */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}

/* ============ UTILITAIRES ============ */
.hidden{ display: none !important; }
