.lang-gate[hidden],
.lang-fab[hidden] {
  display: none !important;
}

.lang-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: rgba(17, 34, 26, 0.72);
  backdrop-filter: blur(2px);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lang-gate.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.lang-gate__panel {
  width: min(90vw, 420px);
  background: #ffffff;
  border-radius: 28px;
  padding: 36px 30px;
  text-align: center;
  box-shadow: 0 38px 85px rgba(0, 0, 0, 0.18);
  position: relative;
}

.lang-gate__title {
  display: grid;
  gap: 6px;
  font-weight: 800;
  font-size: 22px;
  color: var(--text);
}

.lang-gate__subtitle {
  margin: 18px auto 0;
  display: grid;
  gap: 4px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted, #5c5c5c);
}

.lang-gate__options {
  margin-top: 28px;
  width: 100%;
  display: grid;
  gap: 14px;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.lang-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 20px;
  background: #f4faf2;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 20px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 0 0 1px rgba(84, 180, 53, 0.12) inset;
}

.lang-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(84, 180, 53, 0.18);
}

.lang-option.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 18px 34px rgba(84, 180, 53, 0.28);
}

.lang-option:focus-visible {
  outline: 3px solid rgba(84, 180, 53, 0.4);
  outline-offset: 2px;
}

.lang-option__flag,
.lang-fab__flag {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(84, 180, 53, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-option__flag img,
.lang-fab__flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.lang-option__label {
  pointer-events: none;
}

.lang-fab__toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 24px 45px rgba(84, 180, 53, 0.32);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lang-fab__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 55px rgba(84, 180, 53, 0.36);
}

.lang-fab__toggle:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(84, 180, 53, 0.45);
}

.lang-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 2600;
}

.lang-fab__menu {
  position: absolute;
  left: 0;
  bottom: 68px;
  min-width: 170px;
  padding: 14px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-fab.is-open .lang-fab__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-fab__menu-inner {
  display: grid;
  gap: 10px;
}

.lang-fab__menu-inner .lang-option {
  width: 100%;
  border-radius: 14px;
  font-size: 14px;
  padding-block: 10px;
  box-shadow: 0 0 0 1px rgba(84, 180, 53, 0.12) inset;
}

.lang-fab__menu-inner .lang-option__flag {
  width: 28px;
  height: 28px;
}

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

@media (max-width: 640px) {
  .lang-fab {
    left: 16px;
    bottom: 16px;
  }

  .lang-fab__toggle {
    width: 50px;
    height: 50px;
  }

  .lang-fab__menu {
    bottom: 64px;
  }
}
