/* Seletor de idioma */
.lang { position: relative; }
.lang__btn { display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .55rem 0 .5rem; border-radius: 10px; border: 0; background: var(--bg-2); color: var(--ink); font-size: .8rem; font-weight: 500; transition: background .2s; }
.lang__btn:hover { background: var(--tab-hover); }
.lang__flag { width: 21px; height: 14px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18); flex-shrink: 0; }
.lang__flag svg, .lang__item .lang__flag svg { width: 100%; height: 100%; display: block; }
.lang__chev { width: 14px; height: 14px; color: var(--muted); transition: transform .25s var(--ease-out); }
.lang__btn[aria-expanded="true"] .lang__chev { transform: rotate(180deg); }
.lang__menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; margin: 0; padding: 6px; list-style: none; background: var(--menu-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-3); transform-origin: top right; animation: menu-in .22s var(--ease-out); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.lang__item { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .62rem .75rem; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: .9rem; font-weight: 500; text-align: left; transition: background .15s; }
.lang__item:hover, .lang__item:focus-visible { background: var(--tab-hover); outline: none; }
.lang__item[aria-selected="true"] { background: var(--bg-2); }
.lang__item .lang__flag { width: 24px; height: 16px; }
.lang__check { margin-left: auto; width: 16px; height: 16px; color: var(--accent); }

/* Switch de tema */
.theme { border: 0; background: none; padding: 0; display: grid; place-items: center; }
.theme__track { position: relative; display: block; width: 52px; height: 30px; border-radius: 999px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .3s; }
.theme__icon { position: absolute; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--muted); transition: opacity .3s; }
.theme__icon--sun { left: 8px; }
.theme__icon--moon { right: 8px; }
.theme__knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .22); transition: transform .35s var(--ease-out); }
.theme:hover .theme__track { box-shadow: inset 0 0 0 1px var(--line); }
[data-theme="dark"] .theme__track { background: #2C2C2E; }
[data-theme="dark"] .theme__knob { transform: translateX(22px); background: #F5F5F7; }
[data-theme="dark"] .theme__icon--moon { opacity: 0; }
[data-theme="light"] .theme__icon--sun { opacity: 0; }

@media (max-width: 640px) {
  .lang__code, .lang__chev { display: none; }
  .lang__btn { padding: 0 .5rem; }
  .nav__actions { gap: .6rem; }
  .theme__track { width: 46px; height: 28px; }
  .theme__knob { width: 22px; height: 22px; }
  [data-theme="dark"] .theme__knob { transform: translateX(18px); }
}
