.language-button {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(21, 94, 239, 0.15);
  color: var(--blue);
  cursor: pointer;
}

.language-button svg,
.lang-option svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-button svg {
  width: 24px;
  height: 24px;
}

.language-dialog {
  width: min(320px, calc(100vw - 2rem));
  padding: 1.2rem;
  border: none;
  border-radius: 20px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
}

.language-dialog::backdrop {
  background: rgba(16, 24, 40, 0.45);
}

.language-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.language-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lang-option:hover {
  background: #eaf1ff;
}

.lang-option.is-selected {
  border-color: var(--blue);
  font-weight: 700;
}

.lang-code {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #98a2b3;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
}

.lang-option.is-selected .lang-code {
  background: var(--blue);
}

.lang-name {
  flex: 1;
}

.lang-option svg {
  width: 22px;
  height: 22px;
  color: var(--blue);
}

/* No site ME4X o menu já ocupa o canto: o globo fica ao lado dele */
.has-menu .language-button {
  right: calc(1rem + 46px + 0.6rem);
}

/* Em ecrãs muito pequenos, a etiqueta da marca esconde-se para não bater no globo */
@media (max-width: 420px) {
  .brand-badge {
    display: none;
  }
}

