/* Ling.AI shared frontend language switch. */
.language-switch {
    --language-switch-accent: var(--nav-accent, var(--color-accent, #6768b6));
    --language-switch-active-text: var(--language-switch-accent);
    --language-switch-surface: rgba(21, 21, 27, 0.045);
    --language-switch-active-surface: rgba(255, 255, 255, 0.94);
    --language-switch-border: rgba(21, 21, 27, 0.08);
    --language-switch-text: var(--color-text-secondary, #575866);
    position: relative;
    isolation: isolate;
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 84px;
    min-width: 84px;
    height: 30px;
    padding: 2px;
    border: 1px solid var(--language-switch-border);
    border-radius: 9px;
    background: var(--language-switch-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.language-switch__indicator {
    position: absolute;
    z-index: -1;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: 24px;
    border: 1px solid rgba(21, 21, 27, 0.06);
    border-radius: 7px;
    background: var(--language-switch-active-surface);
    box-shadow: 0 1px 3px rgba(21, 21, 27, 0.08);
    transform: translateX(0);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.language-switch[data-active-locale="en-us"] .language-switch__indicator {
    transform: translateX(100%);
}

.language-switch__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border-radius: 7px;
    color: var(--language-switch-text);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.language-switch__option:hover {
    color: var(--language-switch-accent);
}

.language-switch__option.is-active,
.language-switch__option.is-active:hover {
    color: var(--language-switch-active-text);
}

.language-switch__option:focus-visible {
    outline: 2px solid var(--language-switch-accent);
    outline: 2px solid color-mix(in srgb, var(--language-switch-accent) 72%, #fff);
    outline-offset: 3px;
}

.language-switch.is-switching {
    opacity: 0.64;
    pointer-events: none;
}

.dark .language-switch {
    --language-switch-surface: rgba(255, 255, 255, 0.055);
    --language-switch-active-surface: rgba(255, 255, 255, 0.1);
    --language-switch-border: rgba(255, 255, 255, 0.09);
    --language-switch-text: rgba(255, 255, 255, 0.66);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark .language-switch__indicator {
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.auth-language-switch {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.auth-language-switch__hint {
    color: var(--color-text-tertiary, #7b7c89);
    font-size: 0.72rem;
    font-weight: 550;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .auth-language-switch {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
    }

    .auth-language-switch__hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .language-switch,
    .language-switch__indicator,
    .language-switch__option {
        transition: none;
    }
}
