/*
===============================================================================
  TODO: VARIABLES CSS PRINCIPALES
  Define los colores institucionales usando variables dinamicas de BD
  Las variables --color-* son cargadas desde colores-institucionales.php
===============================================================================
*/
:root {
  /* Usar variables dinamicas con fallback a valores por defecto */
  --uea-azul: var(--color-principal, #384152);
  --uea-verde: var(--color-secundario-1, #00AAA7);
  --uea-amarillo: var(--color-secundario-2, #BAD00C);
  --uea-blanco: var(--color-texto-claro, #ffffff);
  --uea-gris: var(--color-texto-gris, #5d5d5d);
}

/*
===============================================================================
  TODO: FOOTER Y FILAS DE ÍCONOS
  Estilos para el pie de página y los íconos de redes sociales, contacto, etc.
===============================================================================
*/
.uea-footer {
  background: transparent;
  text-align: center;
  padding: 1.2em 0 0.5em 0;
  font-family: "Segoe UI", Arial, sans-serif;
}

.uea-icon-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 0.4em 0;
  padding: 0;
  list-style: none;
}

.uea-icon-row li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15em;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  padding: 0;
  margin: 0;
  color: inherit;
  position: relative;
  transition:
    color 0.19s,
    transform 0.16s;
  z-index: 10;
}

.uea-icon-row li a:active {
  transform: scale(0.93);
}

/* TODO: Colores alternos por tipo de íconos */
.uea-social-row li:nth-child(odd) a {
  color: var(--uea-azul);
}

.uea-social-row li:nth-child(even) a {
  color: #e3007e;
}

.uea-social-row li a:hover,
.uea-social-row li a:focus-visible {
  color: var(--uea-amarillo);
  transform: scale(1.12);
}

.uea-contact-row li:nth-child(odd) a {
  color: var(--uea-verde);
}

.uea-contact-row li:nth-child(even) a {
  color: var(--uea-gris);
}

.uea-contact-row li a:hover,
.uea-contact-row li a:focus-visible {
  color: var(--uea-azul);
  transform: scale(1.12);
}

.uea-sys-row li:nth-child(odd) a {
  color: var(--uea-amarillo);
}

.uea-sys-row li:nth-child(even) a {
  color: var(--uea-azul);
}

.uea-sys-row li a:hover,
.uea-sys-row li a:focus-visible {
  color: var(--uea-verde);
  transform: scale(1.12);
}

/*
===============================================================================
  TODO: TOOLTIP DE LOS ÍCONOS
===============================================================================
*/
.uea-tooltip {
  visibility: hidden;
  opacity: 0;
  min-width: 88px;
  max-width: 210px;
  background: rgba(255, 255, 255, 0.93);
  color: var(--uea-gris);
  text-align: center;
  border-radius: 8px;
  padding: 5px 13px 7px 13px;
  position: absolute;
  left: 50%;
  bottom: 125%;
  transform: translateX(-50%) translateY(-7px) scale(0.97);
  font-size: 0.92em;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.04em;
  pointer-events: none;
  box-shadow:
    0 6px 16px 0 rgba(56, 65, 82, 0.19),
    0 1.5px 7px 0 rgba(0, 0, 0, 0.13);
  border: 1.5px solid rgba(94, 164, 162, 0.13);
  z-index: 999999 !important;
  white-space: pre-line;
  transition:
    opacity 0.18s,
    visibility 0.15s,
    transform 0.17s;
}

.uea-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.93) transparent transparent transparent;
  filter: drop-shadow(0 2px 2px rgba(56, 65, 82, 0.15));
}

.uea-icon-row li a:hover .uea-tooltip,
.uea-icon-row li a:focus-visible .uea-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-11px) scale(1.03);
}

.uea-tooltip .fa-up-right-from-square {
  font-size: 0.88em;
  margin-left: 0.36em;
  vertical-align: -0.1em;
  color: #bababa;
}

/*
===============================================================================
  TODO: MODAL DE IFRAME (para sistemas y servicios externos embebidos)
===============================================================================
*/
.uea-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(56, 65, 82, 0.57);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
}

.uea-modal-content {
  position: relative;
  width: 94vw;
  max-width: 660px;
  min-width: 320px;
  height: 82vh;
  max-height: 530px;
  min-height: 320px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 7px 42px 0 rgba(56, 65, 82, 0.27);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.93) translateY(40px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.uea-modal-overlay[closing="true"] .uea-modal-content {
  animation: modalFadeOut 0.24s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.89);
  }
}

.uea-modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1 1 auto;
  background: #fff;
}

.uea-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  z-index: 2;
  background: rgba(94, 164, 162, 0.07);
  color: #384152;
  font-size: 2rem;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  transition: background 0.18s;
  box-shadow: 0 1.5px 7px 0 rgba(0, 0, 0, 0.11);
}

.uea-modal-close:hover {
  background: rgba(94, 164, 162, 0.16);
  color: #e3007e;
}

#uea-modal-external {
  position: absolute;
  top: 12px;
  right: 58px;
  z-index: 2;
  display: none;
  padding: 7px 15px 7px 12px;
  background: #5ea4a2;
  color: #fff !important;
  border-radius: 8px;
  font-size: 0.99em;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 1.5px 7px 0 rgba(56, 65, 82, 0.11);
  border: none;
  transition: background 0.14s;
}

#uea-modal-external:hover {
  background: #384152;
  color: #e3007e !important;
}

/*
===============================================================================
  TODO: MEDIA QUERIES PARA RESPONSIVE/DISPOSITIVOS PEQUEÑOS
===============================================================================
*/

/* TODO: Iconos y tooltips más compactos en móviles pequeños */
@media (max-width: 650px) {
  .uea-icon-row {
    gap: 9px;
  }

  .uea-icon-row li a {
    font-size: 0.97em;
  }

  .uea-tooltip {
    min-width: 60px;
    font-size: 0.75em;
    padding: 3px 5px;
  }
}

/* TODO: Modal más pequeño aún en móviles */
@media (max-width: 520px) {
  .uea-modal-content {
    max-width: 96vw;
    min-width: 0;
    width: 99vw;
    height: 78vh;
    min-height: 220px;
  }
}

/* TODO: Oculta la columna de la imagen/banner (derecha) en móviles y
   fuerza la columna de login a ocupar todo el ancho */
@media (max-width: 767px) {
  .fxt-bg-img,
  .vegas-container.fxt-bg-img {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
  }

  .fxt-bg-color.col-md-6 {
    width: 100% !important;
    max-width: 100vw !important;
    flex: 1 0 100% !important;
    border-radius: 0 !important;
  }

  .container-fluid,
  .row {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
}

/* TODO: Barra de botones superior SOLO para móvil */
.fxt-mobile-page-switcher {
  display: none;
}

@media (max-width: 767px) {
  .fxt-mobile-page-switcher {
    display: flex !important;
    width: 100vw;
    max-width: 100vw;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    border-bottom: 1.5px solid #d5d5d5;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 8000;
    padding: 0 4vw;
    height: 46px;
    gap: 6px;
    box-shadow: 0 2px 10px 0 rgba(56, 65, 82, 0.09);
  }

  .fxt-mobile-page-switcher a {
    flex: 1 1 auto;
    margin: 0 3px;
    padding: 5px 2vw;
    border-radius: 7px;
    font-size: 0.96em;
    background: #ffffff;
    color: var(--color-principal-seguro, #384152);
    text-align: center;
    text-decoration: none;
    border: 1.1px solid #d4d8e2;
    box-shadow: 0 1.2px 4px 0 rgba(56, 65, 82, 0.08);
    font-weight: 500;
    transition:
      background 0.16s,
      color 0.16s;
  }

  .fxt-mobile-page-switcher a.active,
  .fxt-mobile-page-switcher a:hover {
    background: #5ea4a2;
    color: #fff;
    border-color: #5ea4a2;
  }

  .container-fluid {
    margin-top: 49px !important;
  }

  .fxt-bg-color.col-md-6 {
    width: 100% !important;
    max-width: 100vw !important;
    flex: 1 0 100% !important;
    border-radius: 0 !important;
  }
}

/* TODO: Oculta la barra móvil en escritorio, muestra la original */
@media (min-width: 768px) {
  .fxt-mobile-page-switcher {
    display: none !important;
  }

  .fxt-page-switcher {
    display: block !important;
  }
}

/*
===============================================================================
  TODO: Fondo especial de imágenes para móvil, con overlay azul oscuro
===============================================================================
*/
@media (max-width: 767px) {
  body.f-default {
    position: relative;
  }

  body.f-default::before {
    content: "";
    display: block;
    position: fixed;
    inset: 0;
    /* Usa variable de tema activo para fondo de movil y mantiene fallback local */
    background-image: var(--login-mobile-bg, url("../../img/portada/uea001.jpg"));
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.1; /* Cambia este valor según la transparencia que desees */
    z-index: 1;
    pointer-events: none;
  }

  .fxt-template-animation,
  .fxt-template-layout29,
  .container-fluid,
  .fxt-bg-color,
  .fxt-content,
  .uea-footer {
    position: relative;
    z-index: 3;
  }

  .fxt-bg-img,
  .vegas-container.fxt-bg-img {
    display: none !important;
  }

  /* Quita fondo blanco en formulario y sus hijos */
  .fxt-bg-color,
  .fxt-content,
  .fxt-form,
  .container-fluid,
  .row,
  .col-md-6,
  .col-12 {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }
}
