/* HEADER */
.header {
  background: white;
  border-bottom: 1px solid #ddd;
  padding: 10px 20px;
}
.header-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
}
/* Header left with status of backend and hamburger-btn to open or to hide the menu */
.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
}
.hamburger-btn span {
    display: block;
    width: 10px;
    height: 3px;
    background-color: #0f70d0;
    border-radius: 2px;
}

/* Header center */
.header-center h1 {
  margin: 0;
  color: #0f70d0;
  text-align: center;
  transition: font-size 0.2s ease;
}
#h1HeaderTitle.title-compact {
  font-size: 1em; /* relatif à la taille normale du h1 */
}

/* Header right */
.header-right {
  font-family: monospace;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.toggle-btn::before {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);  /* ▶ */
  vertical-align: middle;
  margin-right: 0.4em;
}
.toggle-btn.open::before {
  transform: rotate(45deg);   /* ▼ */
}

#loginToggle {
  color: #0f70d0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
}
#loginToggle::before {
  display: none;
}

#logoutBtn {
  color: red;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.auth-badge {
  margin-left: 8px;
  font-size: 1rem;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

/* LOGIN ROW */
.header-login {
    grid-column: 1 / 4;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}
.login-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 15px;
}
.login-left {
  justify-self: start;
  min-width: 180px;
  text-align: right;
  font-size: 0.9rem;
}

.login-center {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: center;
}
.login-right {
  justify-self: end;
  min-width: 180px;
  text-align: right;
  min-height: 24px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
#loginForm {
    display: flex;
    align-items: center;
    gap: 10px;
}

#loginMsg {
    font-family: monospace;
    white-space: nowrap;
}
#password {
    padding-right: 55px;
}
#togglePwd {
    position: absolute;
    right: 10px;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.8rem;
    color: #555;
    opacity: 0.8;
    user-select: none;
}

/* Cookies info */
/* ============ */

.cookie-link {
    background: none;
    border: none;
    padding: 0;
    /* color: #0f70d0; */
    font-size: 0.7rem;
    cursor: pointer;
    /* text-decoration: underline; */
    white-space: nowrap;
}

#cookieBanner {
    margin-top: 5px;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid #ddd;
    padding-top: 5px;
}

.cookieText {
    display: inline-block;
    padding-left: 100%;
    animation: cookieScroll 30s linear infinite;
    font-size: 0.85rem;
    color: #763602;
}

/* Menus */
/* ===== */
.header-menu {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: flex-start;

    width: 100%;
    margin-top: 10px;
}

#menuToggle {
    position: relative;
    width: 28px;
    height: 22px;
    border: none;
    background: none;
    cursor: pointer;
}

#menuToggle span {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 2px;
    background-color: #0f70d0;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
#menuToggle span:nth-child(1) {
    top: 5px;
}
#menuToggle span:nth-child(2) {
    top: 12px;
}
#menuToggle span:nth-child(3) {
    top: 19px;
}
#menuToggle.open span:nth-child(1) {
    top: 10px;
    transform: translateX(-50%) rotate(45deg);
}
#menuToggle.open span:nth-child(2) {
    opacity: 0;
}
#menuToggle.open span:nth-child(3) {
    top: 10px;
    transform: translateX(-50%) rotate(-45deg);
}

#menuNav {
    grid-column: 2;
    justify-self: center;
    width: 100%;
    display: flex;
    justify-content: center;
}

#menuNav ul {
    display: flex;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
}

#menuNav a {
    text-decoration: none;
    color: #0f70d0;
}
#menuNav a:hover {
    text-decoration: underline;
}

.header-menu::after {
    content: "";
    grid-column: 3;
}

/* FOOTER */
.footer {
  background: white;
  border-top: 1px solid #ddd;
  padding: 10px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lang-picker {
  position: relative;
}
.lang-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #555;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
}
.lang-btn:hover {
  background: #f5f5f5;
}
.lang-dropdown {
  position: absolute;
  bottom: 130%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  min-width: 120px;
  z-index: 100;
}
.lang-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #555;
}
.lang-option:hover {
  background: #f5f5f5;
  border-radius: 6px;
}

/* Responsive smartphone */
/* ===================== */
@media (max-width: 768px) {

  .login-row {
      display: flex;
      flex-direction: column;
      align-items: stretch;
  }

  .login-left,
  .login-center,
  .login-right {
      width: 100%;
  }

  .login-left {
      text-align: center;
      min-width: unset;
  }

  .login-center {
      display: block;
  }

  .login-right {
      margin-top: 10px;
      text-align: center;
      min-width: unset;
      min-height: 24px;
  }

  #loginForm {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
  }

  #loginForm input,
  .password-wrapper,
  #loginForm button[type="submit"] {
      width: 100%;
      box-sizing: border-box;
  }

  .password-wrapper {
      width: 100%;
  }

  #loginMsg {
      margin-top: 8px;
      text-align: center;
  }

  .cookie-link {
      margin-left: 0;
  }

  #menuNav ul {
      flex-direction: column;
      align-items: center;
  }
}
