:root {
  --bi-hover-bg: rgba(64,86,255,.055);
  --bi-bg: #f7f9fd;
  --bi-text: #111b33;
  --bi-border: #e4e9f2;
  --bi-primary: #4056ff;
  --bi-primary-hover: #3046ed;
  --bi-logo-url: url("../icons/logo_app/light_logo.ico");
}
.bi-header {position: sticky; top: 0; z-index: 100; width: 100%; background: var(--bi-bg); border-bottom: 1px solid var(--bi-border); }
.bi-header-inner { max-width: 1280px; min-height: 94px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; box-sizing: border-box; }
.bi-header .bi-logo { display: inline-flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
/* HelloJob wordmark: keep the complete wide logo visible */
.bi-header .bi-logo-image {
  display: block;
  width: clamp(142px, 13vw, 196px);
  height: 62px;
  flex: 0 0 auto;
  background-image: var(--bi-logo-url);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  border-radius: 12px;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.bi-header .bi-logo:hover .bi-logo-image { transform: translateY(-1px) scale(1.025); }

.bi-nav { display: flex; align-items: center; gap: 12px; }
.bi-header .bi-theme-toggle { appearance: none; width: 46px !important; min-width: 46px !important; max-width: 46px !important; height: 46px !important; min-height: 46px !important; max-height: 46px !important; padding: 0 !important; margin: 0 !important; flex: 0 0 46px; border: 1px solid var(--bi-border); border-radius: 50% !important; background: transparent; color: var(--bi-text); display: grid !important; place-items: center; cursor: pointer; font: 26px/1 system-ui, sans-serif; }
.bi-theme-moon { display: inline; }
.bi-theme-sun { display: none; }
.bi-header .bi-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border-radius: 10px; text-decoration: none; font: 600 14px/1.2 system-ui, sans-serif; white-space: nowrap; box-sizing: border-box; }
.bi-btn-outline { border: 1px solid var(--bi-border); color: var(--bi-text); background: transparent; }
.bi-btn-primary { border: 1px solid var(--bi-primary); color: #fff; background: var(--bi-primary); }
.bi-btn-primary:hover { background: var(--bi-primary-hover); }
.app-toast { position: fixed; z-index: 99999; top: 22px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(92vw, 560px); padding: 14px 20px; border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.2); color: #fff; font: 600 14px/1.5 system-ui, sans-serif; overflow-wrap: anywhere; pointer-events: none; animation: bi-toast-enter .18s ease-out; }
.app-toast[hidden] { display: none !important; }
.app-toast-icon { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border: 1.5px solid rgba(255,255,255,.8); border-radius: 50%; font-weight: 900; }
.app-toast-success { background: #16834b; }
.app-toast-echec { background: #d93636; }
@keyframes bi-toast-enter { from { opacity: 0; transform: translate(-50%,-10px); } to { opacity: 1; transform: translate(-50%,0); } }
@media (max-width: 600px) { .bi-header-inner { padding: 12px 16px; } .bi-nav { gap: 7px; } .bi-header .bi-btn { padding: 0 10px; font-size: 12px; } .bi-header .bi-logo-image { width: clamp(108px, 29vw, 154px); height: 52px; } .app-toast { top: 12px; padding: 12px 14px; } }

/* Subtle polish around the HelloJob brand image */
.bi-header .bi-logo { border-radius: 14px; outline-offset: 4px; }
.bi-header .bi-logo:focus-visible { outline: 2px solid var(--bi-primary); }
@media (max-width: 380px) {
  .bi-header-inner { gap: 8px; padding-inline: 10px; }
  .bi-header .bi-logo-image { width: 96px; height: 44px; }
  .bi-nav { gap: 5px; }
  .bi-header .bi-btn { padding-inline: 7px; font-size: 11px; }
  .bi-header .bi-theme-toggle { width: 40px !important; min-width: 40px !important; max-width: 40px !important; height: 40px !important; min-height: 40px !important; max-height: 40px !important; flex-basis: 40px; }
}
.bi-header .bi-logo-image { filter: drop-shadow(0 5px 12px rgba(43,90,255,.13)); box-shadow: 0 3px 15px rgba(43,90,255,.06); }
.bi-header .bi-logo:hover .bi-logo-image { filter: drop-shadow(0 7px 15px rgba(43,90,255,.23)); }

.bi-header .bi-logo-image { box-shadow: none; background-color: transparent; }

/* HELLOJOB | Navigation centrale raffinée */
.bi-header-inner { position: relative; gap: 28px; }
.bi-info-nav {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 1.6vw, 26px);
  padding: 6px 10px;
  border: 1px solid rgba(39,69,119,.12); border-radius: 18px;
  background: rgba(255,255,255,.7);
  white-space: nowrap;
}
.bi-info-link {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 10px 18px;
  color: #263451; text-decoration: none;
  font: 650 13px/1.35 system-ui, sans-serif;
  letter-spacing: .005em; border-radius: 12px;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}
.bi-info-link::after {
  content: ''; position: absolute; bottom: 5px; left: 24%; right: 24%; height: 2px;
  border-radius: 3px; background: #3159d9; transform: scaleX(0);
  transition: transform .2s ease;
}
.bi-info-link:hover, .bi-info-link:focus-visible {
  color: #3159d9; background: rgba(66,96,235,.09); transform: translateY(-1px);
}
.bi-info-link:hover::after, .bi-info-link:focus-visible::after { transform: scaleX(1); }
.bi-info-link:focus-visible { outline: 2px solid #3159d9; outline-offset: 2px; }
.bi-nav { margin-left: auto; gap: 15px; }
.bi-header .bi-btn { padding-inline: 20px; }
@media (max-width: 1270px) {
  .bi-header-inner { flex-wrap: wrap; row-gap: 8px; }
  .bi-info-nav { position: static; transform: none; order: 3; width: fit-content;
    max-width: 100%; margin: 0 auto 7px; }
}
@media (max-width: 600px) {
  .bi-header-inner { gap: 8px; }
  .bi-info-nav { width: 100%; gap: 3px; padding: 5px; }
  .bi-info-link { flex: 1; min-width: 0; padding: 9px 5px; font-size: 11px;
    text-align: center; white-space: normal; }
  .bi-nav { gap: 7px; }
  .bi-header .bi-btn { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bi-info-link, .bi-info-link::after { transition: none; }
}

/* Élargir le header : logo vers la gauche, actions vers la droite.
   Navigation centrale inchangée. */
@media (min-width: 1271px) {
  .bi-header-inner {
    max-width: 1800px;
    padding-left: clamp(28px, 3vw, 56px);
    padding-right: clamp(28px, 3vw, 56px);
  }
}


/* Compact two-language toggle; current choice is rendered from the cookie. */
.bi-header .bi-language-toggle {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 9px; min-height: 44px; padding: 8px 13px; margin: 0;
  border: 1px solid var(--bi-border); border-radius: 13px;
  background: var(--bi-bg); color: var(--bi-text); cursor: pointer;
  font: 650 13px/1.25 system-ui, sans-serif; white-space: nowrap;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.bi-header .bi-language-toggle:hover { border-color: var(--bi-primary); transform: translateY(-1px); }
.bi-header .bi-language-toggle:focus-visible { outline: 2px solid var(--bi-primary); outline-offset: 2px; }
.bi-header .bi-language-toggle:disabled { opacity: .6; cursor: wait; }
.bi-header .bi-language-toggle img { display: block; width: 23px; height: 17px; object-fit: cover; border-radius: 3px; flex: 0 0 auto; }
.bi-header-inner { column-gap: clamp(9px, 1.3vw, 22px); }
.bi-nav { gap: clamp(6px, .8vw, 13px); }
@media (max-width: 1270px) {
  .bi-header-inner { flex-wrap: wrap; }
  .bi-info-nav { order: 3; }
}
@media (max-width: 680px) {
  .bi-header-inner { padding: 10px 12px; row-gap: 10px; }
  .bi-nav { flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
  .bi-header .bi-language-toggle { min-height: 39px; padding: 7px 9px; gap: 6px; font-size: 12px; }
  .bi-header .bi-language-toggle img { width: 20px; height: 15px; }
  .bi-header .bi-btn { min-height: 38px; padding-inline: 10px; }
  .bi-info-nav { width: 100%; }
}
@media (max-width: 410px) {
  .bi-header .bi-logo-image { width: 96px; height: 44px; }
  .bi-header .bi-language-toggle { padding: 6px 7px; font-size: 11px; }
  .bi-nav { gap: 5px; }
  .bi-header .bi-btn { padding-inline: 7px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .bi-header .bi-language-toggle { transition: none; }
}

/* Final HelloJob header: airy text navigation, no enclosing rectangle. */
.bi-header .bi-header-inner { max-width: 1800px; column-gap: 22px; }
.bi-header .bi-info-nav {
  left: 46%; gap: clamp(10px,1.4vw,24px); padding: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.bi-header .bi-info-link {
  padding: 10px 5px; background: transparent; border: 0; border-radius: 0;
  font-size: 13px; font-weight: 600; transform: none;
}
.bi-header .bi-info-link:hover, .bi-header .bi-info-link:focus-visible {
  background: transparent; transform: none;
}
.bi-header .bi-info-link::after { left: 5px; right: 5px; bottom: 4px; }
.bi-header .bi-language-toggle {
  border-radius: 999px; background: transparent; padding: 0 15px;
  height: 46px; min-height: 46px; gap: 10px; box-shadow: none;
  font-size: 13px; font-weight: 650; border: 1px solid var(--bi-border);
}
.bi-header .bi-language-toggle:hover { background: var(--bi-hover-bg); transform: translateY(-1px); }
.bi-header .bi-language-toggle img { width: 24px; height: 18px; border-radius: 3px; object-fit: cover; }
.bi-header .bi-theme-toggle { transition: background .2s, border-color .2s, transform .2s; }
.bi-header .bi-theme-toggle:hover { background: var(--bi-hover-bg); border-color: var(--bi-primary); transform: translateY(-1px); }
.bi-header .bi-btn { border-radius: 12px; }
@media (max-width: 1350px) {
  .bi-header .bi-header-inner { flex-wrap: wrap; row-gap: 10px; }
  .bi-header .bi-info-nav { position: static; transform: none; order: 3; width: 100%; margin: 0;
    justify-content: center; gap: clamp(12px,2vw,30px); }
}
@media (max-width: 700px) {
  .bi-header .bi-header-inner { padding: 12px 14px; gap: 10px; }
  .bi-header .bi-logo-image { width: clamp(108px,27vw,155px); height: 48px; }
  .bi-header .bi-nav { gap: 7px; }
  .bi-header .bi-language-toggle { min-height: 40px; height: 40px; padding: 0 10px; font-size: 12px; gap: 6px; }
  .bi-header .bi-theme-toggle { width: 40px !important; min-width: 40px !important; max-width: 40px !important;
    height: 40px !important; min-height: 40px !important; max-height: 40px !important; flex-basis: 40px; }
  .bi-header .bi-btn { min-height: 38px; padding: 0 10px; font-size: 12px; }
  .bi-header .bi-info-nav { gap: 12px; padding: 0; }
  .bi-header .bi-info-link { padding: 8px 2px; font-size: 11px; }
}
@media (max-width: 470px) {
  .bi-header .bi-header-inner { justify-content: center; }
  .bi-header .bi-logo { margin-right: auto; }
  .bi-header .bi-nav { width: 100%; justify-content: center; flex-wrap: wrap; }
  .bi-header .bi-info-nav { justify-content: center; gap: 8px; }
  .bi-header .bi-info-link { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bi-header .bi-theme-toggle, .bi-header .bi-language-toggle { transition: none; }
}


/* ===== Arabic header: RTL layout, original page behavior untouched ===== */
.bi-header.bi-header-ar { direction: rtl; }
.bi-header-ar .bi-header-inner {
  direction: rtl;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
/* Logo anchors the far right; account actions anchor the far left. */
.bi-header-ar .bi-logo { order: 0; margin: 0; flex-shrink: 0; }
.bi-header-ar .bi-nav {
  order: 2;
  direction: ltr;
  margin-left: 0;
  margin-right: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
}
/* Actions read right-to-left while their physical order stays predictable. */
.bi-header-ar .bi-nav .bi-btn { direction: rtl; }
.bi-header-ar .bi-info-nav {
  direction: rtl;
  order: 1;
  position: absolute;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.4vw, 24px);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
}
.bi-header-ar .bi-info-link { direction: rtl; }
.bi-header-ar .bi-language-toggle { direction: ltr; }
.bi-header-ar .bi-language-toggle span { direction: ltr; unicode-bidi: isolate; }
/* At intermediate widths, give the middle links a dedicated centered row. */
@media (max-width: 1350px) {
  .bi-header-ar .bi-header-inner { flex-wrap: wrap; row-gap: 8px; }
  .bi-header-ar .bi-info-nav {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    margin: 0;
    justify-content: center;
  }
}
@media (max-width: 700px) {
  .bi-header-ar .bi-header-inner { justify-content: space-between; }
  .bi-header-ar .bi-logo { margin: 0; }
  .bi-header-ar .bi-nav { margin-right: auto; justify-content: flex-start; flex-wrap: wrap; }
  .bi-header-ar .bi-info-nav { order: 3; width: 100%; justify-content: center; }
}
@media (max-width: 470px) {
  .bi-header-ar .bi-header-inner { justify-content: space-between; }
  .bi-header-ar .bi-logo { margin: 0; }
  .bi-header-ar .bi-nav {
    order: 2;
    margin: 0;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .bi-header-ar .bi-info-nav { order: 3; }
}
