/* Language switch on the customer portal and sign-in page
   (templates/includes/language_switch.html). The desk has its own:
   language.bundle.css. */

.lang-switch { position: relative; }

.lang-flag {
  display: block;
  width: 22px;
  height: 15px;
  border-radius: 2px;
  /* Keeps the white stripe visible on a white background. */
  box-shadow: 0 0 0 1px var(--color-border);
  flex-shrink: 0;
}

.lang-switch-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 180px;
  padding: 6px 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}
.lang-switch-menu[hidden] { display: none; }

.lang-switch-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.lang-switch-option:hover,
.lang-switch-option:focus-visible { background: var(--color-primary-50); outline: none; }
.lang-switch-option.is-current { font-weight: 600; }
.lang-switch-tick { margin-left: auto; color: var(--color-primary); }

/* Sign-in and thank-you pages: top right corner. */
.lang-switch-corner {
  position: absolute;
  top: 32px;
  right: 40px;
  z-index: 10;
}
@media (max-width: 900px) {
  .lang-switch-corner { top: var(--gutter); right: var(--gutter); }
}

/* Switching language (public/js/portal_i18n.js): the page loads again, and
   the new one fades in over the old instead of flashing white. Browsers
   without view transitions just load it. Every page that loads this file
   opts in; the script skips the fade for anything but a language switch. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 220ms; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
.lang-switching, .lang-switching * { cursor: progress !important; }
