/* =============================================================================
   Language Switcher — pre-auth (landing nav + auth page)
   Dark surface, neon-green accent, Rajdhani locale codes. Tokens: --kc-*.
   ========================================================================== */

.lang-switcher {
    position: relative;
    display: inline-flex;
}

/* --- Toggle ------------------------------------------------------------- */

.lang-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.4rem;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.lang-switcher__toggle:hover,
.lang-switcher__toggle[aria-expanded="true"] {
    color: #fff;
    border-color: var(--kc-turquoise);
    background: rgba(0, 199, 139, 0.08);
}

.lang-switcher__toggle:focus-visible {
    outline: 2px solid var(--kc-turquoise);
    outline-offset: 2px;
}

.lang-switcher__flag {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.lang-switcher__code {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.85rem;
}

.lang-switcher__chev {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 200ms ease;
}

.lang-switcher__toggle[aria-expanded="true"] .lang-switcher__chev {
    transform: rotate(180deg);
}

/* --- Menu --------------------------------------------------------------- */

.lang-switcher__menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 100;
    min-width: 11rem;
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: var(--kc-bg-secondary, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    animation: lang-switcher-in 160ms ease;
}

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

@keyframes lang-switcher-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Option ------------------------------------------------------------- */

.lang-switcher__opt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 44px;
    padding: 0 0.7rem;
    background: transparent;
    border: 0;
    border-radius: 0.35rem;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    text-align: left;
    transition: background-color 120ms ease, color 120ms ease;
}

.lang-switcher__opt:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.lang-switcher__opt:focus-visible {
    outline: 2px solid var(--kc-turquoise);
    outline-offset: -2px;
}

.lang-switcher__opt.is-active {
    color: var(--kc-turquoise);
}

.lang-switcher__opt-flag {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.lang-switcher__opt-name {
    flex: 1;
    font-size: 0.95rem;
}

.lang-switcher__check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--kc-turquoise);
}

/* --- Auth page placement ------------------------------------------------ */

.auth-lang-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
}

@media (prefers-reduced-motion: reduce) {
    .lang-switcher__menu { animation: none; }
    .lang-switcher__chev { transition: none; }
}
