.lang-switch {
  position: relative;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.35rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line-strong, rgba(0, 0, 0, 0.12));
  border-radius: 999px;
  background: var(--surface-solid, #fff);
  color: var(--ink, #0a0a0a);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s;
}

.lang-switch-btn:hover {
  transform: translateY(-1px);
  background: var(--surface, rgba(255, 255, 255, 0.55));
}

.lang-flag {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 60;
  width: 8rem;
  padding: 0.35rem 0;
  border: 1px solid var(--line-strong, rgba(0, 0, 0, 0.12));
  border-radius: 1rem;
  background: var(--surface-solid, #fff);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

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

.lang-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-mute, #6b6b6b);
  background: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-option:hover {
  background: var(--surface-mute, #eee);
}

.lang-option.is-active {
  color: var(--ink, #0a0a0a);
  font-weight: 600;
}

.auth-form-panel .lang-switch {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
}

.auth-page--register .auth-form-panel > .lang-switch {
  position: static;
}

html[data-theme="dark"] .lang-switch-btn,
html[data-theme="dark"] .lang-menu {
  background: var(--surface-solid, #121212);
  border-color: var(--line-strong);
  color: var(--ink);
}

html[data-theme="dark"] .lang-option:hover {
  background: var(--surface, rgba(255, 255, 255, 0.06));
}
