/* Language switcher — stesso modello UX di demo02 (vm-ar2-lang), da vm_admin_shell.css */
.vm-ar2-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  font-family: Nunito, system-ui, sans-serif;
  z-index: 40;
}
.vm-ar2-lang.is-open {
  z-index: 1060;
}
.vo-topbar .vm-ar2-lang {
  align-self: center;
}
.vm-ar2-lang__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0.3rem 0.7rem 0.3rem 0.45rem;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.vm-ar2-lang__trigger:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.vm-ar2-lang__trigger:focus {
  outline: none;
}
.vm-ar2-lang__trigger:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}
.vm-ar2-lang.is-open .vm-ar2-lang__trigger {
  border-color: #99f6e4;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}
.vm-ar2-lang__trigger-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vm-ar2-lang__flag-img {
  display: block;
  width: 2.5rem;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.35rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.vm-ar2-lang__flag-img--trigger {
  width: 1.65rem;
  border-radius: 0.28rem;
}
.vm-ar2-lang__flag-fallback {
  font-size: 1.2rem;
  line-height: 1;
}
.vm-ar2-lang__flag-fallback--row {
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
}
.vm-ar2-lang__trigger-main {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  max-width: 11rem;
}
.vm-ar2-lang__trigger-name {
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vm-ar2-lang__trigger-code {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 0.25rem;
  padding: 0.12rem 0.32rem;
  line-height: 1;
}
.vm-ar2-lang__chev {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.05rem;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #64748b;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.vm-ar2-lang.is-open .vm-ar2-lang__chev {
  transform: rotate(180deg);
}
.vm-ar2-lang__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(19.5rem, calc(100vw - 1.25rem));
  max-height: min(72vh, 22rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  -webkit-overflow-scrolling: touch;
}
.vm-ar2-lang__panel-head {
  flex-shrink: 0;
  padding: 0.55rem 0.75rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}
.vm-ar2-lang__panel-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #64748b;
}
.vm-ar2-lang__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}
.vm-ar2-lang__item {
  margin: 0;
  padding: 0;
}
.vm-ar2-lang__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.05rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.2rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  background: #f8fafc;
  text-decoration: none;
  color: #0f172a;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.vm-ar2-lang__row:hover {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.vm-ar2-lang__row:focus {
  outline: none;
}
.vm-ar2-lang__row:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 1px;
}
.vm-ar2-lang__row.is-active {
  background: linear-gradient(100deg, #ecfdf5 0%, #f0fdfa 100%);
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 0 0 1px rgba(13, 148, 136, 0.2);
}
.vm-ar2-lang__row-flag {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vm-ar2-lang__row-flag .vm-ar2-lang__flag-img {
  width: 2.25rem;
  border-radius: 0.32rem;
}
.vm-ar2-lang__row-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  text-align: left;
}
.vm-ar2-lang__row-primary {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
}
.vm-ar2-lang__row-secondary {
  display: block;
  width: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
  word-break: break-word;
}
.vm-ar2-lang__row-suffix {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}
.vm-ar2-lang__row-code {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
}
.vm-ar2-lang__row-check {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #0d9488;
  position: relative;
}
.vm-ar2-lang__row-check::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0.28rem;
  height: 0.55rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
@media (max-width: 576px) {
  .vm-ar2-lang__panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    max-height: min(78vh, 28rem);
    border-radius: 0.85rem 0.85rem 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.16);
  }
  .vm-ar2-lang__list {
    padding: 0.5rem 0.45rem calc(0.5rem + env(safe-area-inset-bottom, 0));
  }
  .vm-ar2-lang__row {
    min-height: 3.25rem;
    padding: 0.55rem 0.6rem;
  }
}
@media (max-width: 380px) {
  .vm-ar2-lang__trigger-code {
    display: none;
  }
}

/* ── Stampa: il selettore lingua non deve mai finire sul foglio (cintura di sicurezza) ── */
@media print {
  .vm-ar2-lang,
  .vo-lang-preview-bar {
    display: none !important;
    visibility: hidden !important;
  }
}
