/* Reset / base */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --accent: rgba(11, 116, 222, 0.7);
  --muted: #6b7280;
  --danger: #313945;
  --success: #1c1e4d;
  --shadow: 0 6px 18px rgba(11, 116, 222, 0.08);
  --radius: 12px;
  --max-width: 420px;
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, #eef2fb 0%, var(--bg) 100%);
  color: #111827;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Card - Estilo del Login */
.card {
  width: 100%;
  max-width: var(--max-width);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 18px;
}

#loginTitle {
  text-align: center;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #c9a892);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
}

h1 {
  margin: 0;
  font-size: 20px
}

p.lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}



form {
  display: grid;
  gap: 12px;
}

label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px
}

.field {
  display: flex;
  flex-direction: column;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e6e9ef;
  outline: none;
  font-size: 15px;
  transition: box-shadow .15s, border-color .15s;
  background: #fbfdff;
}

input:focus {
  border-color: rgba(11, 116, 222, 0.7);
  box-shadow: 0 6px 18px rgba(11, 116, 222, 0.06);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
}

.btn[disabled] {
  opacity: .6;
  cursor: default
}

.helper {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.msg {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.msg.error {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.12)
}

.msg.success {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.08)
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.9);
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* footer small */
.meta {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 6px
}

/* responsive: stack on small widths */
@media (max-width:420px) {
  .card {
    padding: 18px
  }

  .brand {
    gap: 8px
  }
}

.logo-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.logo-pequeno {
  width: 200px;
  height: auto;
}


/* --- ESTILOS DEL PANEL DE APLICACIONES (MÓDULOS) --- */

#appsPanel {
  display: none;
  padding: 0;
  width: 100%;
  max-width: 1400px;
}

/* TÍTULO */
.apps-title {
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  margin-bottom: 25px;
  color: #111827;
}

/* GRID DE APPS */
.grid-apps {
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(6, 1fr);
}

/* Media Queries para Responsive Design */
@media (max-width: 1200px) {
  .grid-apps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .grid-apps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-apps {
    grid-template-columns: repeat(2, 1fr);
  }

  #appsPanel {
    padding: 15px;
  }
}

/* CONTENEDOR DEL ENLACE (CRÍTICO: QUITAR DECORACIÓN) */
.app-card-link {
  text-decoration: none;
  /* Elimina el subrayado del enlace */
  color: inherit;
  display: block;
  height: 100%;
}

/* CARD - Estilo Base */
.app-card {
  background: var(--card);
  padding: 12px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
  /* Para animar color y transformación */
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* HOVER EFFECT: AZUL DE FONDO */
.app-card-link:hover .app-card {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(11, 116, 222, 0.25);
  background-color: var(--accent);
  /* Fondo Azul */
}

/* IMAGEN MÁS GRANDE Y COMPLETA */
.app-img {
  width: 100%;
  height: auto;
  margin-bottom: 8px;
}

/* TÍTULO - Estilo Base */
.app-card h3 {
  color: #1a237e;
  margin: 6px 0 4px;
  font-size: 18px;
  transition: color 0.2s ease-in-out;
}

/* CAMBIO CRÍTICO: TÍTULO BLANCO en Hover */
.app-card-link:hover h3 {
  color: var(--card);
  /* Blanco */
}

/* DESCRIPCIÓN - Estilo Base */
.app-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
  transition: color 0.2s ease-in-out;
  flex-grow: 1;
}

/* CAMBIO CRÍTICO: DESCRIPCIÓN BLANCA en Hover */
.app-card-link:hover p {
  color: var(--card);
  /* Blanco */
}

/* Eliminar el estilo del botón, ya que el <a> completo es el que se usa */
.app-card button {
  display: none;
}


/* --- AJUSTES PARA EL PANEL DE APLICACIONES --- */

/* Contenedor del Título y Botón */
.apps-header {
  display: flex;
  justify-content: space-between;
  /* Alinea el título a la izquierda y el botón a la derecha */
  align-items: center;
  /* Centra verticalmente el título y el botón */
  margin-bottom: 25px;
  /* Espacio debajo del encabezado */
  max-width: 1400px;

}

.bienvenda {
  display: flex;
  max-width: 1400px;
  margin-bottom: 5px;
}


/* TÍTULO - Aseguramos que no se deforme al lado del botón */
.apps-title {
  margin: 0;
  /* Elimina márgenes innecesarios si están dentro de flex */
  font-size: 26px;
  font-weight: bold;
  text-align: left;
  /* Alineación del título a la izquierda */
}

/* ESTILO DEL BOTÓN DE CERRAR SESIÓN */
#logoutBtn {
  /* Basado en tu estilo .btn, solo cambiamos el color y el padding */
  background-color: var(--danger);
  /* Rojo */
  color: white;
  font-size: 14px;
  padding: 8px 14px;
  transition: background-color 0.2s;
}

#logoutBtn:hover {
  background-color: #b91c1c;
  /* Un rojo un poco más oscuro al hacer hover */
}

/* Ajuste al contenedor principal de apps para que el header no se vea mal */
#appsPanel {
  /* Quitamos el padding global que podría duplicarse */
  padding: 0;
  width: 100%;
  max-width: 1400px;
  /* Necesitamos un margen superior e inferior porque quitamos la alineación vertical del body */
  margin: 40px auto;
  min-height: 100vh;
  /* Para que el fondo se mantenga si la lista es corta */
}

/* Responsive para el header */
@media (max-width: 600px) {
  .apps-header {
    flex-direction: column;
    /* Apila título y botón en móviles */
    text-align: center;
    padding: 0 15px;
  }

  .apps-title {
    text-align: center;
    /* Centrar título al apilar */
    margin-bottom: 15px;
    /* Espacio entre título y botón */
  }
}


/* --- Estilos para el Ícono de Mostrar/Ocultar Contraseña --- */

/* Contenedor Flex para alinear input y botón */
.password-container {
  position: relative;
  /* Esencial para posicionar el ícono dentro */
  display: flex;
  align-items: center;
}

/* El input debe ocupar el 100% del contenedor */
.password-container input {
  width: 100%;
}

/* Estilo del ícono (el "ojo") */
.password-toggle {
  position: absolute;
  right: 14px;
  /* Posición dentro del campo */
  top: 50%;
  /* Centrado verticalmente */
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
  font-size: 18px;
  /* Tamaño del ícono */
  color: var(--muted);
  /* Color tenue */
  transition: color 0.15s ease;
}

/* Cambiar color al pasar el ratón */
.password-toggle:hover {
  color: var(--accent);
}

/* Estilo para simular el ícono del ojo tachado cuando la contraseña está oculta */
.password-toggle.toggled {
  opacity: 0.6;
}


/* Loader en esquina inferior derecha */
#loaderLogin {
  position: fixed;
  bottom: 15px;
  right: 15px;
  width: 150px;
  display: none;
  z-index: 9999;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.modal-btn {
  width: 100%;
}

.modal-close {
  margin-top: 15px;
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer;
}

/* ---------------- MODAL ---------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-box {
  background: white;
  padding: 25px;
  border-radius: 12px;
  width: 300px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}


.modal-restablecer {
  background: white;
  padding: 25px;
  border-radius: 12px;
  width: 450px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}


.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.modal-btn {
  width: 100%;
  padding: 10px;
}

.modal-close {
  margin-top: 15px;
  background: transparent;
  border: none;
  color: white;
  background-color: red;
  cursor: pointer;
  font-weight: bold;
}

.footer-site {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #f5f5f5;
  text-align: center;
  padding: 15px;
  border-top: 1px solid #ddd;
  font-size: 14px;
  color: #666;
  z-index: 100;
}


/* estilo de seccion de noticias */

/* PANEL DE NOTICIAS */
.news-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #ddd;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.08);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.news-panel.oculto {
  transform: translateX(100%);
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  background: #1c1e4d;
  color: #d2d2d2;
}

.news-header h3 {
  margin: 0;
  font-size: 16px;
}

.news-header button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.news-content {
  padding: 12px;
  overflow-y: auto;
}

.news-card {
  background: #f9f9f9;
  border-radius: 10px;
  margin-bottom: 14px;
  padding: 10px;
}

.news-card img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}

.news-card h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: #c9a892;
}

.news-card p {
  margin: 0;
  font-size: 13px;
  color: #444;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .news-panel {
    display: none;
  }
}



/* BOTÓN FLOTANTE NOTICIAS */
.news-fab {
  position: fixed;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: var(--accent);
  color: #fff;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  z-index: 998;
}

/* CONTADOR */
.news-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: red;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* PANEL DE NOTICIAS */

/* PANEL DE NOTICIAS */
.news-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #ddd;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.08);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  transform: translateX(100%);
  /* ✅ OCULTO DESDE EL INICIO */
}

.news-panel.oculto {
  transform: translateX(100%);
}

.news-panel:not(.oculto) {
  transform: translateX(0);
}




/* MODAL OVERLAY */
.news-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.news-modal.oculto {
  display: none;
}

/* CONTENIDO */
.news-modal-content {
  background: #fff;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 10px;
  padding: 20px;
  position: relative;
  animation: fadeUp 0.25s ease;
}

.news-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.modal-date {
  color: #777;
  font-size: 13px;
  margin-bottom: 12px;
}


@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RELOJ FLOTANTE */
.clock-fab {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  /* Efecto Glassmorphism sutil para premium feel */
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: #313945;
  padding: 8px 16px;
  border-radius: 30px;
  display: none;
  /* Oculto inicialmente por JS logic */
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 998;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  font-family: inherit;
}

.clock-fab:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.clock-icon {
  font-size: 18px;
}