/* PREMIUR — Flat premium language selector
   Non-intrusive, accessible, responsive, namespaced.
   Mounts via JS without changing existing site content. */

:root {
  --premiur-lang-bg: rgba(13, 17, 23, 0.96);
  --premiur-lang-surface: rgba(16, 21, 29, 0.98);
  --premiur-lang-border: rgba(255, 255, 255, 0.1);
  --premiur-lang-border-strong: rgba(255, 255, 255, 0.16);
  --premiur-lang-text: #f5f7fa;
  --premiur-lang-muted: #9ba6b2;
  --premiur-lang-accent: #ffffff;
  --premiur-lang-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --premiur-lang-radius: 16px;
  --premiur-lang-radius-sm: 12px;
  --premiur-lang-focus: 0 0 0 3px rgba(255, 255, 255, 0.16);
  --premiur-lang-zindex: 1200;
}

.premiur-lang {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: var(--premiur-lang-zindex);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.premiur-lang__inner {
  position: relative;
}

.premiur-lang__button {
  appearance: none;
  border: 1px solid var(--premiur-lang-border);
  background: var(--premiur-lang-bg);
  color: var(--premiur-lang-text);
  min-width: 124px;
  height: 52px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--premiur-lang-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.premiur-lang__button:hover {
  border-color: var(--premiur-lang-border-strong);
  background: rgba(20, 27, 36, 0.98);
}

.premiur-lang__button:focus-visible,
.premiur-lang__option:focus-visible {
  outline: none;
  box-shadow: var(--premiur-lang-focus);
}

.premiur-lang__button[aria-expanded="true"] {
  transform: translateY(-1px);
  border-color: var(--premiur-lang-border-strong);
}

.premiur-lang__button-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.premiur-lang__globe {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--premiur-lang-muted);
}

.premiur-lang__current {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.premiur-lang__current-code {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.premiur-lang__current-name {
  font-size: 0.74rem;
  color: var(--premiur-lang-muted);
}

.premiur-lang__chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--premiur-lang-muted);
  transition: transform 180ms ease;
}

.premiur-lang__button[aria-expanded="true"] .premiur-lang__chevron {
  transform: rotate(180deg);
}

.premiur-lang__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(280px, calc(100vw - 32px));
  padding: 10px;
  background: var(--premiur-lang-surface);
  border: 1px solid var(--premiur-lang-border);
  border-radius: var(--premiur-lang-radius);
  box-shadow: var(--premiur-lang-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.premiur-lang.is-open .premiur-lang__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.premiur-lang__menu-title {
  padding: 8px 10px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--premiur-lang-muted);
}

.premiur-lang__options {
  display: grid;
  gap: 6px;
}

.premiur-lang__option {
  appearance: none;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--premiur-lang-text);
  border-radius: var(--premiur-lang-radius-sm);
  min-height: 52px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.premiur-lang__option:hover,
.premiur-lang__option:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.premiur-lang__option[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.premiur-lang__option-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--premiur-lang-text);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.premiur-lang__option-meta {
  min-width: 0;
}

.premiur-lang__option-name {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
}

.premiur-lang__option-native {
  display: block;
  font-size: 0.78rem;
  color: var(--premiur-lang-muted);
}

.premiur-lang__check {
  width: 16px;
  height: 16px;
  color: var(--premiur-lang-accent);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 160ms ease, transform 160ms ease;
}

.premiur-lang__option[aria-selected="true"] .premiur-lang__check {
  opacity: 1;
  transform: scale(1);
}

.premiur-lang__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .premiur-lang {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .premiur-lang__button {
    width: 100%;
    min-width: 0;
  }

  .premiur-lang__menu {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .premiur-lang__button,
  .premiur-lang__chevron,
  .premiur-lang__menu,
  .premiur-lang__option,
  .premiur-lang__check {
    transition: none;
  }
}
