/* ============================================================
   MAGISTERAI — SÉLECTEUR DE LANGUE (i18n.css)
   Pastille sobre + menu « papier »
   ============================================================ */
#mag-lang-switch {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10001;
  direction: ltr;
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- bouton principal ---------- */
#mag-lang-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(187, 168, 255, .32);
  background: rgba(21, 18, 57, .86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), border-color .25s ease, background-color .25s ease;
}
#mag-lang-btn:hover { transform: translateY(-2px); border-color: rgba(187, 168, 255, .7); }
#mag-lang-btn:active { transform: scale(.94); }
#mag-lang-btn:focus-visible { outline: 2px solid #BBA8FF; outline-offset: 3px; }
#mag-lang-btn .mag-flag {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #BBA8FF;
}

/* ---------- menu (papier) ---------- */
#mag-lang-menu {
  position: absolute;
  bottom: 58px;
  left: 0;
  min-width: 168px;
  padding: 6px;
  border-radius: 6px;
  background: #F8F6FC;
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(8px) rotate(-1.5deg) scale(.96);
  transform-origin: bottom left;
  pointer-events: none;
  transition: opacity .22s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
#mag-lang-menu.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
#mag-lang-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #55506E;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 550;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
#mag-lang-menu button + button { border-top: 1px solid rgba(110, 90, 220, .12); }
#mag-lang-menu button:hover { background: rgba(138, 77, 255, .08); color: #1F1C33; }
#mag-lang-menu button.active { color: #5427D8; font-weight: 700; }
.mag-item-name { flex: 1; text-align: left; }
.mag-item-check {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
  color: #5427D8;
  opacity: 0;
  transform: scale(.5) rotate(-10deg);
  transition: opacity .2s ease, transform .25s cubic-bezier(.22, 1, .36, 1);
}
#mag-lang-menu button.active .mag-item-check { opacity: 1; transform: none; }

/* ---------- mobile : la pastille rejoint la barre du haut ---------- */
@media (max-width: 900px) {
  #mag-lang-switch { bottom: 14px; left: 14px; }
  #mag-lang-btn { width: 44px; height: 44px; }
  .has-nav #mag-lang-switch { top: 10px; bottom: auto; left: auto; right: calc(clamp(20px, 5vw, 64px) + 50px); }
  .has-nav #mag-lang-btn { width: 44px; height: 44px; border-radius: 12px; background: transparent; border-color: rgba(187, 168, 255, .22); box-shadow: none; }
  .has-nav #mag-lang-menu { top: 52px; bottom: auto; left: auto; right: 0; transform-origin: top right; transform: translateY(-8px) rotate(1deg) scale(.96); }
  .has-nav #mag-lang-menu.open { transform: none; }
}
