/* =====================================================================
   MedCare — En-tete et menu
   - Marque : symbole du logo + logotype texte (lisible a petite taille)
   - Menu bureau : "rail" segmente, page courante en relief
   - "Missions" : panneau de raccourcis (filtres pre-remplis)
   - Mobile : panneau lateral plein ecran, liens numerotes
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@1,9..144,500&display=swap');

.site-header {
  --hd-h: var(--header-height, 76px);
  --hd-navy: #0F2A3D;
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, .95);
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px -16px rgba(15, 42, 61, .35);
}
.hd {
  height: var(--hd-h);
  display: flex; align-items: center; gap: 20px;
  transition: height .25s ease;
}
.site-header.scrolled .hd { height: calc(var(--hd-h) - 12px); }

/* ---------- Marque ---------- */
.hd-brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; color: inherit; }
.hd-mark { width: 44px; height: auto; display: block; transition: transform .3s ease, width .25s ease; }
.hd-brand:hover .hd-mark { transform: rotate(-6deg) scale(1.04); }
.site-header.scrolled .hd-mark { width: 38px; }
.hd-word { display: flex; flex-direction: column; line-height: 1; }
.hd-word-main {
  font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; letter-spacing: .02em;
  color: var(--primary);
}
.hd-word-main b { font-weight: 800; color: var(--secondary); }
.hd-word-sub {
  font-size: .62rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-secondary); margin-top: 5px;
}

/* ---------- Rail de navigation ---------- */
.hd-nav { flex: 1; display: flex; justify-content: center; min-width: 0; }
.hd-rail {
  list-style: none; margin: 0; padding: 4px;
  display: flex; align-items: center; gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.hd-rail > li { position: relative; }
.hd-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; border: 0; background: transparent;
  font-weight: 600; font-size: .93rem; color: var(--text-primary); white-space: nowrap;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.hd-link:hover { color: var(--primary-dark); background: rgba(255, 255, 255, .7); }
.hd-link.active,
.hd-link[aria-expanded="true"] {
  background: #fff; color: var(--hd-navy);
  box-shadow: 0 1px 2px rgba(15, 42, 61, .08), 0 4px 12px -4px rgba(15, 42, 61, .15);
}
.hd-link.active::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}
.hd-link:focus-visible, .hd-user:focus-visible, .hd-burger:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hd-caret { font-size: .7rem; transition: transform .2s ease; }
[aria-expanded="true"] > .hd-caret { transform: rotate(180deg); }
.hd-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px;
  display: inline-grid; place-items: center;
  font-size: .72rem; font-weight: 800; line-height: 1;
  background: var(--primary); color: #fff;
}

/* ---------- Panneau "Missions" ---------- */
.hd-mega {
  width: 560px; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(15, 42, 61, .35);
  display: none; grid-template-columns: 1.35fr 1fr;
}
.hd-mega.show { display: grid; animation: hd-drop .18s ease-out; }
@keyframes hd-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.hd-mega-main { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.hd-mega-all {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; margin-bottom: 6px; border-radius: 12px;
  background: var(--hd-navy); color: #fff;
}
.hd-mega-all:hover { background: var(--primary-dark); color: #fff; }
.hd-mega-all strong { display: block; font-family: var(--font-display); }
.hd-mega-all small { color: rgba(255, 255, 255, .7); }
.hd-mega-all i { transition: transform .2s ease; }
.hd-mega-all:hover i { transform: translateX(4px); }
.hd-mega-link {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px; border-radius: 12px; color: var(--text-primary);
}
.hd-mega-link > i {
  flex: 0 0 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); color: var(--primary); font-size: 1rem;
  transition: background .2s ease, color .2s ease;
}
.hd-mega-link strong { display: block; font-size: .93rem; }
.hd-mega-link small { color: var(--text-secondary); font-size: .8rem; }
.hd-mega-link:hover { background: var(--surface); color: var(--text-primary); }
.hd-mega-link:hover > i { background: var(--primary); color: #fff; }
.hd-mega-aside {
  padding: 22px; display: flex; flex-direction: column; gap: 8px;
  background:
    radial-gradient(circle at 100% 0, rgba(95, 211, 196, .35), transparent 55%),
    #F7F6F1;
  border-left: 1px solid var(--border);
}
.hd-mega-kicker { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary-dark); }
.hd-mega-aside p { margin: 0 0 auto; color: var(--text-primary); font-size: .92rem; line-height: 1.5; }
.hd-mega-aside a { font-weight: 700; color: var(--hd-navy); display: inline-flex; gap: 6px; align-items: center; }
.hd-mega-aside a:hover { color: var(--primary); }

/* ---------- Actions ---------- */
.hd-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.hd-phone {
  display: inline-flex; align-items: center; gap: 0;
  height: 42px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border); color: var(--secondary); font-weight: 700; font-size: .9rem;
  transition: background .2s ease, border-color .2s ease, gap .25s ease;
}
.hd-phone i { font-size: 1rem; color: var(--primary); }
.hd-phone span { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s ease; }
.hd-phone:hover, .hd-phone:focus-visible { gap: 8px; border-color: var(--primary); background: var(--surface); color: var(--secondary); }
.hd-phone:hover span, .hd-phone:focus-visible span { max-width: 140px; }
.hd-login {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 14px; border-radius: 12px;
  font-weight: 700; font-size: .93rem; color: var(--hd-navy);
}
.hd-login:hover { color: var(--primary-dark); background: var(--surface); }
.hd-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px;
  font-weight: 700; font-size: .93rem; color: #fff; background: var(--hd-navy);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background .2s ease, transform .15s ease;
}
.hd-cta:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }

/* Utilisateur connecte */
.hd-user {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 10px 0 4px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; font-weight: 700; color: var(--hd-navy);
}
.hd-user:hover { border-color: var(--primary); }
.hd-avatar {
  width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center;
  background: var(--hd-navy); color: var(--accent); font-weight: 800; font-size: .95rem;
}
.hd-avatar-sm { width: 26px; height: 26px; font-size: .8rem; background: rgba(255,255,255,.15); }
.hd-user-menu { border: 1px solid var(--border); border-radius: 14px; padding: 6px; min-width: 220px; box-shadow: 0 24px 48px -16px rgba(15, 42, 61, .3); }
.hd-user-menu .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; font-weight: 600; font-size: .92rem; }
.hd-user-menu .dropdown-item i { color: var(--primary); }
.hd-user-menu .dropdown-item:hover { background: var(--surface); }
.hd-user-menu .hd-logout, .hd-user-menu .hd-logout i { color: var(--danger); }

/* Bouton menu (mobile) */
.hd-burger {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.hd-burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--hd-navy); transition: transform .25s ease, width .25s ease; }
.hd-burger span:last-child { width: 13px; margin-left: 7px; }
.hd-burger:hover span:last-child { width: 20px; margin-left: 0; }

/* ---------- Panneau mobile ---------- */
.hd-drawer { --bs-offcanvas-width: min(420px, 100vw); border-left: 0 !important; display: flex; flex-direction: column; }
.hd-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.hd-drawer-head .hd-mark { width: 38px; }
.hd-drawer-close {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; color: var(--hd-navy); font-size: 1rem;
}
.hd-drawer-close:hover { background: var(--hd-navy); color: #fff; }
.hd-drawer-body { flex: 1; overflow-y: auto; padding: 12px 20px 20px; }
.hd-drawer-nav { list-style: none; margin: 0; padding: 0; }
.hd-drawer-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 4px; border-bottom: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--hd-navy);
}
.hd-drawer-nav a > i { margin-left: auto; font-size: 1rem; color: var(--text-secondary); transition: transform .2s ease, color .2s ease; }
.hd-drawer-nav a:hover > i, .hd-drawer-nav a.active > i { color: var(--primary); transform: translate(2px, -2px); }
.hd-drawer-nav a.active { color: var(--primary); }
.hd-drawer-n { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 500; font-size: .95rem; color: var(--primary); min-width: 24px; }
.hd-drawer-quick { margin-top: 22px; }
.hd-drawer-quick > span { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-secondary); }
.hd-drawer-quick div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hd-drawer-quick a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; background: var(--surface); color: var(--hd-navy);
  font-weight: 600; font-size: .88rem;
}
.hd-drawer-quick a i { color: var(--primary); }
.hd-drawer-foot {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border); background: #F7F6F1;
  display: flex; flex-direction: column; gap: 8px;
}
.hd-drawer-foot .hd-cta, .hd-drawer-foot .hd-login { height: 48px; }
.hd-login-boxed { border: 1px solid var(--border); background: #fff; }
.hd-drawer-phone {
  display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 10px 4px; color: var(--hd-navy);
}
.hd-drawer-phone > i {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary); color: #fff;
}
.hd-drawer-phone small { display: block; color: var(--text-secondary); font-size: .78rem; }
.hd-drawer-phone strong { font-family: var(--font-display); font-size: 1.05rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .hd-link { padding: 9px 11px; font-size: .9rem; }
  .hd-word-sub { display: none; }
}
/* Petits ecrans d'ordinateur / tablettes paysage : on libere de la place pour le menu */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .hd { gap: 14px; }
  .hd-word, .hd-phone { display: none; }
  .hd-login { padding: 0 10px; }
  .hd-cta { padding: 0 14px; }
}
@media (max-width: 991.98px) {
  .hd-nav, .hd-phone, .hd-login, .hd-user-name, .hd-user .hd-caret { display: none; }
  .hd-burger { display: inline-flex; }
  .hd-user { padding: 0 4px; }
}
@media (max-width: 575.98px) {
  .hd-actions > .hd-cta { display: none; }
  .hd-word-main { font-size: 1.18rem; }
}
@media (min-width: 992px) {
  .hd-drawer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hd, .hd-mark, .hd-phone span, .hd-mega.show { transition: none; animation: none; }
}
