/* Selector visual ES/EN compartido. No interviene en formularios ni datos. */
.mrj-lang-toggle {
  align-items: center;
  appearance: none;
  background: rgba(255, 255, 255, .97);
  border: 1px solid #9bcbdc;
  border-radius: 999px;
  bottom: 18px;
  box-shadow: 0 8px 24px rgba(16, 69, 101, .18);
  box-sizing: border-box;
  color: #234a62;
  cursor: pointer;
  display: inline-flex;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  gap: 5px;
  height: 36px;
  justify-content: center;
  letter-spacing: .02em;
  line-height: 1;
  margin: 0;
  min-width: 92px;
  padding: 0 11px;
  position: fixed;
  right: 14px;
  text-align: center;
  text-decoration: none;
  text-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  user-select: none;
  z-index: 2147481000;
}

/* Neutraliza adornos heredados que algunos temas agregan a todos los botones. */
.mrj-lang-toggle::before,
.mrj-lang-toggle::after {
  content: none !important;
  display: none !important;
}

/* Algunos temas antiguos insertan un icono <i> genérico en cada botón. */
.mrj-lang-toggle > i {
  display: none !important;
}

/* En cabeceras modernas se integra junto a los indicadores del sistema. */
.mrj-lang-toggle--header {
  bottom: auto;
  box-shadow: 0 3px 10px rgba(16, 69, 101, .14);
  flex: 0 0 auto;
  height: 34px;
  margin: 0 6px 0 4px;
  min-width: 100px;
  position: relative;
  right: auto;
}

/* Cabeceras antiguas como controlv2 no incluyen la franja moderna. */
.mrj-lang-toggle--control {
  bottom: auto;
  box-shadow: 0 3px 10px rgba(16, 69, 101, .14);
  display: flex;
  height: 34px;
  margin: 0 0 12px auto;
  min-width: 100px;
  position: relative;
  right: auto;
  width: 100px;
}

/* Accesos sin cabecera de navegación: selector visible sobre la tarjeta. */
.mrj-lang-toggle--auth {
  bottom: auto;
  box-shadow: 0 3px 10px rgba(16, 69, 101, .14);
  display: flex;
  height: 34px;
  margin: 0 0 10px auto;
  min-width: 100px;
  position: relative;
  right: auto;
  width: 100px;
}

/* Portadas antiguas de acceso (SIDCA, MRJ Verificadora y SIDEFINCO).
   El selector queda dentro de la tarjeta y deja de competir con el footer. */
.auth-modern {
  position: relative;
}

.mrj-lang-toggle--legacy-auth {
  bottom: auto;
  box-shadow: 0 3px 10px rgba(16, 69, 101, .14);
  height: 34px;
  min-width: 100px;
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 30;
}

/* Portada de entidades SIDCA: el selector forma parte de la columna lateral. */
.mrj-lang-toggle--landing {
  align-self: flex-end;
  bottom: auto;
  box-shadow: 0 3px 10px rgba(8, 44, 64, .20);
  flex: 0 0 auto;
  height: 34px;
  margin: 8px 0;
  min-width: 100px;
  position: relative;
  right: auto;
}

/* SIDCA interno: el selector forma parte del encabezado y no cubre el footer
   ni los botones operativos ubicados en la esquina inferior derecha. */
.mrj-lang-toggle--sidca-header {
  bottom: auto;
  box-shadow: 0 3px 10px rgba(16, 69, 101, .14);
  flex: 0 0 auto;
  height: 34px;
  min-width: 92px;
  position: relative;
  right: auto;
}

/* Las etiquetas de identidad de los flujos SIDCA son contenido CSS, por lo
   que también deben responder al selector visual de idioma. */
html[data-mrj-lang="en"] body.mrj-flow-ingreso-general { --mrj-flow-label: "ENTRY · GENERAL"; }
html[data-mrj-lang="en"] body.mrj-flow-ingreso-garita { --mrj-flow-label: "ENTRY · MINE GATE"; }
html[data-mrj-lang="en"] body.mrj-flow-salida-general { --mrj-flow-label: "EXIT · GENERAL"; }
html[data-mrj-lang="en"] body.mrj-flow-salida-garita { --mrj-flow-label: "EXIT · MINE GATE"; }
html[data-mrj-lang="en"] body.mrj-flow-ingreso-vehiculos { --mrj-flow-label: "ENTRY · VEHICLES"; }
html[data-mrj-lang="en"] body.mrj-flow-salida-vehiculos { --mrj-flow-label: "EXIT · VEHICLES"; }

@media screen and (max-width: 760px) {
  html[data-mrj-lang="en"] body.mrj-access-history .mrj-person-controls > .span2:nth-child(2)::before { content: "Name"; }
  html[data-mrj-lang="en"] body.mrj-access-history .mrj-person-controls > .span2:nth-child(3)::before { content: "Company"; }
  html[data-mrj-lang="en"] body.mrj-access-history .mrj-person-controls > .span2:nth-child(4)::before { content: "Work Schedule"; }
  html[data-mrj-lang="en"] body.mrj-access-history .mrj-person-controls > .span2:nth-child(5)::before { content: "Position"; }
  html[data-mrj-lang="en"] body.mrj-flow-ingreso-vehiculos.mrj-access-history .mrj-person-controls > .span2:nth-child(1)::before,
  html[data-mrj-lang="en"] body.mrj-flow-salida-vehiculos.mrj-access-history .mrj-person-controls > .span2:nth-child(1)::before { content: "License Plate"; }
  html[data-mrj-lang="en"] body.mrj-flow-ingreso-vehiculos.mrj-access-history .mrj-person-controls > .span2:nth-child(2)::before,
  html[data-mrj-lang="en"] body.mrj-flow-salida-vehiculos.mrj-access-history .mrj-person-controls > .span2:nth-child(2)::before { content: "Make"; }
}

/* En estas seis portadas el footer se mantiene al final de la ventana.
   El relleno inferior reserva su altura y evita tapar formularios o tarjetas. */
html.mrj-public-access-page,
html.mrj-public-access-page body.mrj-public-access-page {
  min-height: 100%;
}

html.mrj-public-access-page body.mrj-public-access-page {
  padding-bottom: 66px !important;
}

html.mrj-public-access-page .mrj-public-access-footer {
  bottom: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  position: fixed !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1200 !important;
}

html.mrj-public-access-page .ic {
  bottom: 66px !important;
}

.mrj-lang-toggle:hover,
.mrj-lang-toggle:focus {
  border-color: #1597ba;
  box-shadow: 0 10px 28px rgba(15, 119, 157, .24);
  outline: 2px solid rgba(15, 147, 184, .18);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.mrj-lang-toggle:active {
  transform: translateY(0);
}

.mrj-lang-toggle__globe {
  color: #0f8fb4;
  font-size: 14px;
  line-height: 1;
}

.mrj-lang-toggle__code {
  align-items: center;
  border-radius: 999px;
  color: #6c8290;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  min-width: 25px;
  padding: 0 5px;
}

.mrj-lang-toggle__code.is-active {
  background: linear-gradient(135deg, #0f6ea2, #0e9ab3);
  box-shadow: 0 3px 8px rgba(15, 110, 162, .22);
  color: #fff;
}

.mrj-lang-toggle__divider {
  color: #adc1ca;
  font-weight: 400;
}

html.page-loading .mrj-lang-toggle {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 760px) {
  .mrj-lang-toggle {
    bottom: 11px;
    height: 34px;
    min-width: 84px;
    padding: 0 8px;
    right: 9px;
  }

  .mrj-lang-toggle__code {
    height: 22px;
    min-width: 22px;
    padding: 0 4px;
  }

  .mrj-lang-toggle--header {
    bottom: auto;
    margin: 0 4px;
    min-width: 84px;
    position: relative;
    right: auto;
  }

  .mrj-lang-toggle--control {
    bottom: auto;
    margin: 0 0 10px 0;
    min-width: 84px;
    position: relative;
    right: auto;
    width: 84px;
  }

  .mrj-lang-toggle--auth {
    bottom: auto;
    margin: 0 0 8px auto;
    min-width: 84px;
    position: relative;
    right: auto;
    width: 84px;
  }

  .mrj-lang-toggle--legacy-auth {
    bottom: auto;
    min-width: 84px;
    position: absolute;
    right: 8px;
    top: 8px;
  }

  .mrj-lang-toggle--landing {
    align-self: flex-start;
    bottom: auto;
    margin: 8px 0;
    min-width: 84px;
    position: relative;
    right: auto;
  }

  .mrj-lang-toggle--sidca-header {
    bottom: auto;
    min-width: 84px;
    position: relative;
    right: auto;
  }

  html.mrj-public-access-page body.mrj-public-access-page {
    padding-bottom: 106px !important;
  }

  html.mrj-public-access-page .ic {
    bottom: 106px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mrj-lang-toggle {
    transition: none;
  }
}

@media print {
  .mrj-lang-toggle {
    display: none !important;
  }
}

/* Vista inglesa de Tarifas sin alterar el HTML guardado por el editor. */
.mrj-tariff-translation-host {
  position: relative;
}

.mrj-tariff-translation-overlay {
  background: #fff;
  box-sizing: border-box;
  color: #17384f;
  cursor: text;
  display: none;
  left: 0;
  line-height: 1.45;
  overflow: auto;
  padding: 10px;
  position: absolute;
  right: 0;
  text-align: left;
  z-index: 5;
}

.mrj-tariff-translation-overlay p {
  color: inherit;
  font: inherit;
  margin: 0 0 8px;
  text-align: left;
}

.mrj-lang-en .mrj-tariff-translation-host:not(.mrj-tariff-is-editing) > .jqte_editor[data-mrj-tariff-source="true"] {
  visibility: hidden;
}

.mrj-lang-en .mrj-tariff-translation-host:not(.mrj-tariff-is-editing) > .mrj-tariff-translation-overlay {
  display: block;
}

.mrj-lang-es .mrj-tariff-translation-overlay,
.mrj-tariff-is-editing > .mrj-tariff-translation-overlay {
  display: none !important;
}

.mrj-user-avatar-logo--missing {
  display: none !important;
}

.mrj-user-avatar--fallback::before {
  content: "\f007";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-family: "Font Awesome 5 Free", "FontAwesome", sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
}

/* Navegación visible en historiales extensos de ingresos, salidas y garitas. */
legend.mrj-flow-title-with-back {
  align-items: center;
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 38px;
}

legend.mrj-flow-title-with-back .mrj-flow-back-button {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  margin: 0 0 0 auto !important;
  min-height: 32px;
  padding: 5px 12px;
  white-space: nowrap;
}

legend.mrj-flow-title-with-back .mrj-flow-back-button i {
  margin: 0;
}

@media (max-width: 640px) {
  legend.mrj-flow-title-with-back .mrj-flow-back-button {
    margin-left: 0 !important;
  }
}
