/*
 * Language switching (all visitors; the globe itself only renders with UI 2).
 * - .crs-lang: mobile globe dropdown in the top bar (crs/crs-lang-switch.tpl).
 * - .crs-lang-toast: "saved on your account" confirmation (crs/crs-lang.blNNN.js),
 *   callout shape from design tokens (component.callout).
 * - Sidebar language list: stock paints .nav-subnav dark, which left the inactive
 *   language dark-on-dark (classic theme).
 * Cloudflare ignores ?v=: bump blNNN in the filename and the <link> when this changes.
 */

/* ---- Mobile globe -------------------------------------------------------- */

.crs-lang__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.crs-lang__menu {
  min-width: 168px;
  margin-top: 6px;
  padding: 6px 0;
  border: 0;
  border-radius: var(--crs-radius-control, 10px);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.18);
}

.crs-lang__menu .crs-lang__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
}

/* Theme Custom CSS paints .dropdown-menu * grey with !important. */
.crs-lang__menu .crs-lang__item,
.crs-lang__menu .crs-lang__item * {
  color: var(--crs-text-strong, #101828) !important;
}

.crs-lang__menu .crs-lang__item.is-current,
.crs-lang__menu .crs-lang__item.is-current * {
  color: var(--crs-action-interface-fill, #006EBF) !important;
  font-weight: 500;
}

.crs-lang__menu .crs-lang__item .material-icons {
  font-size: 20px;
}

/* UI 2 sign-in pages hide the sidebar, so the burger only opened an empty overlay.
   The globe covers language there; hide the burger. */
html.crs-ui-2 body:has(.crs-auth, .section-passreminder) .navbar .btn-toggler {
  display: none !important;
}

/* ---- Sidebar language list (classic + UI 2) ------------------------------ */

.sidebar #menu-language .nav-subnav {
  background: transparent;
}

.sidebar #menu-language .nav-subnav .nav-link {
  color: var(--crs-text-strong, #101828);
}

/* ---- Saved-on-account confirmation -------------------------------------- */

.crs-lang-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  /* Above the UI 2 beta chip (z-index 2000), below the page loader (9999). */
  z-index: 2100;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: var(--crs-callout-padding-block, 16px) var(--crs-callout-padding-inline, 20px);
  background: var(--crs-callout-info-surface, #E6F4FB);
  border-left: var(--crs-callout-bar-width, 3px) solid var(--crs-callout-info-bar, #005C9F);
  border-radius: 0 var(--crs-callout-radius, 12px) var(--crs-callout-radius, 12px) 0;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.12);
  color: var(--crs-callout-info-text, #005C9F);
  font-family: var(--crs-typography-font-family, Roboto, Helvetica, Arial, sans-serif);
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease-in-out, transform 180ms ease-in-out;
}

.crs-lang-toast.is-visible {
  opacity: 1;
  transform: none;
}

.crs-lang-toast__text {
  flex: 1;
}

.crs-lang-toast__close {
  flex: none;
  margin: -4px -8px -4px 0;
  padding: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .crs-lang-toast {
    transition: none;
  }
}
