.card-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.card .card-header {
  position: relative;
  z-index: 50;
}

.card:has(.lang-dropdown-toggle[aria-expanded="true"]) {
  overflow: visible;
}

.card-header-row .step-indicator {
  flex: 1 1 200px;
  justify-content: center;
  margin: 0;
}

.lang-switcher {
  position: relative;
  z-index: 30;
}

.lang-switcher--nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 9.5rem;
}

.lang-switcher--nav .lang-switcher-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-switcher-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

.lang-dropdown {
  position: relative;
  min-width: 9.5rem;
  width: 100%;
}

.lang-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  -webkit-appearance: none;
  appearance: none;
}

.lang-dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lang-dropdown-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lang-dropdown-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.lang-dropdown-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7rem;
}

@media (min-width: 480px) {
  .lang-dropdown-name {
    max-width: none;
  }
}

.lang-dropdown-chevron {
  opacity: 0.85;
  font-size: 0.75rem;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 11rem;
  width: max-content;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  border-radius: 10px;
  background: #fff;
  color: var(--text, #333);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  max-height: 16rem;
  overflow-y: auto;
  z-index: 1000;
}

.lang-dropdown-menu[hidden] {
  display: none;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.lang-dropdown-item:hover,
.lang-dropdown-item:focus {
  background: rgba(102, 126, 234, 0.12);
  outline: none;
}

.lang-dropdown-item.selected {
  background: rgba(102, 126, 234, 0.18);
  font-weight: 600;
}

.lang-dropdown-item-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.lang-dropdown-item-name {
  flex: 1;
}

@media (max-width: 520px) {
  .card-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .lang-switcher--nav {
    width: 100%;
    max-width: 100%;
  }

  .card-header-row .step-indicator {
    width: 100%;
  }
}
