/* ============================================================
   static/css/style.css — Estilos globales de Signia
   ============================================================ */

/* ── 1. VARIABLES ── */
:root {
  --blue:       #2563eb;
  --blue-mid:   #3b82f6;
  --blue-pale:  #dbeafe;
  --blue-bg:    #eff6ff;
  --white:      #ffffff;
  --bg:         #f0f6ff;
  --text-dark:  #1e3a5f;
  --text-mid:   #4b6a9b;
  --border:     #c8daf5;
}

/* ── 2. RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  font-family: 'Nunito', 'DM Sans', sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  background: transparent;
  margin: 0;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
}

/* ── 3. FONDO ANIMADO ── */
.bg {
  animation: slide 5s ease-in-out infinite alternate;
  background-image: linear-gradient(-60deg, #BFDBFE 50%, #DBEAFE 50%);
  bottom: 0;
  left: -50%;
  opacity: .4;
  position: fixed;
  right: -50%;
  top: 0;
  z-index: -1;
}
.bg2 { animation-direction: alternate-reverse; animation-duration: 7s; }
.bg3 { animation-duration: 9s; }

@keyframes slide {
  0%   { transform: translateX(-8%); }
  100% { transform: translateX(8%); }
}

nav.main-nav,
.alert-container,
footer.main-footer,
.page, .card, .con, .inner, form,
.modal-overlay, #aviso-inactividad,
.navbar {
  position: relative;
  z-index: 2;
}

/* ── 4. NAVBAR ── */
nav.main-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  padding: 0 2.5rem;
  height: 64px;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
}

nav.main-nav .nav-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  margin-right: auto;
  flex-shrink: 0;
}

nav.main-nav .logo-icon {
  width: 38px;
  height: 38px;
  background: #2563eb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

nav.main-nav .logo-icon svg { width: 22px; height: 22px; fill: white; }

nav.main-nav .logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #2563eb;
}

/* Links desktop */
nav.main-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.main-nav .nav-links a {
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #64748b;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  display: block;
  white-space: nowrap;
}

nav.main-nav .nav-links a:hover       { color: #2563eb; background: #dbeafe; }
nav.main-nav .nav-links .active a     { color: #2563eb; font-weight: 600; }

/* Botón hamburguesa — oculto en desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.nav-hamburger:hover { background: #dbeafe; }

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #2563eb;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  transform-origin: center;
}

/* Animación hamburguesa → X */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú móvil desplegable */
.nav-mobile-menu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  padding: 1rem 1.5rem 1.5rem;
  z-index: 99;
  border-top: 1px solid #dbeafe;
}

.nav-mobile-menu.open { display: block; }

.nav-mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.nav-mobile-menu ul a {
  display: block;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #1e293b;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
}

.nav-mobile-menu ul a:hover,
.nav-mobile-menu ul .active a { background: #dbeafe; color: #2563eb; }

/* Separador en menú móvil */
.nav-mobile-divider {
  height: 1px;
  background: #dbeafe;
  margin: 0.75rem 0;
}

/* ── 5. MENÚ USUARIO ── */
.user-menu {
  position: relative;
  margin-left: 0.75rem;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f0f7ff;
  border: 1.5px solid #dbeafe;
  border-radius: 999px;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
}

.user-menu-btn:hover { background: #dbeafe; border-color: #93c5fd; }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-name {
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chevron {
  width: 16px;
  height: 16px;
  color: #64748b;
  transition: transform 0.2s;
}

.user-menu.open .user-chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15);
  border: 1.5px solid #dbeafe;
  min-width: 200px;
  padding: 0.5rem;
  display: none;
  z-index: 200;
}

.user-menu.open .user-dropdown { display: block; }

.user-dropdown-header {
  padding: 0.6rem 0.75rem 0.5rem;
  border-bottom: 1px solid #dbeafe;
  margin-bottom: 0.4rem;
}

.user-dropdown-header p      { font-size: 0.75rem; color: #64748b; margin: 0; }
.user-dropdown-header strong { font-size: 0.9rem; color: #1e293b; display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: #374151;
  transition: background 0.15s;
}

.dropdown-item:hover           { background: #f0f7ff; color: #2563eb; }
.dropdown-item.danger          { color: #dc2626; }
.dropdown-item.danger:hover    { background: #fee2e2; }
.dropdown-item.admin           { color: #7c3aed; }
.dropdown-item.admin:hover     { background: #f5f3ff; color: #6d28d9; }
.dropdown-divider              { height: 1px; background: #dbeafe; margin: 0.4rem 0; }

/* ── 6. CONTENIDO ── */
.contenido {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── 7. FOOTER ── */
footer.main-footer {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.85rem;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
}

/* ── 8. MENSAJES AUTO-DISMISS ── */
.alert-container {
  max-width: 860px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
}

.alert-msg {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  animation: slideIn 0.3s ease;
  transition: opacity 0.5s, transform 0.5s;
}

.alert-msg.success  { background: #dcfce7; border: 1.5px solid #86efac; color: #16a34a; }
.alert-msg.error    { background: #fee2e2; border: 1.5px solid #fca5a5; color: #dc2626; }
.alert-msg.info     { background: #dbeafe; border: 1.5px solid #93c5fd; color: #2563eb; }
.alert-msg.fade-out { opacity: 0; transform: translateY(-10px); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 9. MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 1rem;
}

.modal-box {
  background: white;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: popIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-icon    { font-size: 3rem; margin-bottom: 1rem; }
.modal-box h2  { font-size: 1.3rem; font-weight: 700; color: #1e293b; margin-bottom: 0.5rem; }
.modal-box p   { font-size: 0.9rem; color: #64748b; line-height: 1.6; margin-bottom: 1.5rem; }

.modal-disc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.modal-disc-ninguna { background: #dcfce7; color: #16a34a; }
.modal-disc-sordo   { background: #dbeafe; color: #2563eb; }
.modal-disc-mudo    { background: #fef3c7; color: #d97706; }

.modal-btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s;
}

.modal-btn:hover { transform: translateY(-1px); }

/* ── 10. AVISO INACTIVIDAD ── */
#aviso-inactividad {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.aviso-box {
  background: white;
  border-radius: 20px;
  padding: 2rem 2.5rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: popIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.aviso-icono  { font-size: 2.8rem; margin-bottom: 0.75rem; }

.aviso-titulo {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.aviso-texto {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.aviso-contador {
  font-size: 2.5rem;
  font-weight: 800;
  color: #dc2626;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 1.25rem;
}

.aviso-btn {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s;
}

.aviso-btn:hover { transform: translateY(-1px); }

/* ── 11. RESPONSIVE NAVBAR ── */
@media (max-width: 768px) {
  nav.main-nav {
    padding: 0 1.25rem;
  }

  /* Ocultar links y user-menu en desktop-nav */
  nav.main-nav .nav-links,
  nav.main-nav .user-menu {
    display: none;
  }

  /* Mostrar hamburguesa */
  .nav-hamburger {
    display: flex;
  }

  /* El menú móvil hereda el user-menu dentro suyo */
  .nav-mobile-menu .user-menu {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-left: 0;
  }

  .nav-mobile-menu .user-menu-btn {
    width: 100%;
    border-radius: 10px;
    padding: 0.6rem 1rem;
  }

  .nav-mobile-menu .user-dropdown {
    width: 100%;
    position: static;
    box-shadow: none;
    border: 1px solid #dbeafe;
    margin-top: 0.5rem;
    padding: 0.5rem;
  }

  footer.main-footer {
    margin-top: 2rem;
  }
}

@media (max-width: 480px) {
  nav.main-nav {
    padding: 0 1rem;
  }

  nav.main-nav .logo-text {
    font-size: 1.15rem;
  }
}

/* ── Bloqueo navbar modal discapacidad ── */
body.disc-modal-activo nav.main-nav {
  z-index: 1 !important;
  pointer-events: none !important;
}

/* ── 12. MANUAL DE USUARIO (FAB & MODAL) ── */

/* Floating Action Button (FAB) */
.fab-manual {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: #185FA5;
  color: #E6F1FB;
  text-decoration: none;
  border-radius: 50px;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(24, 95, 165, 0.30);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: padding 0.30s cubic-bezier(.4, 0, .2, 1),
              gap     0.30s cubic-bezier(.4, 0, .2, 1),
              box-shadow 0.20s ease, 
              background 0.20s ease;
}
.fab-manual:hover  { padding: 14px 20px 14px 16px; gap: 9px; background: #0C447C; box-shadow: 0 6px 24px rgba(24, 95, 165, 0.40); }
.fab-manual:active { transform: scale(0.97); }
.fab-manual svg    { width: 22px; height: 22px; flex-shrink: 0; transition: transform 0.20s ease; }
.fab-manual:hover svg { transform: scale(1.10); }

.fab-manual__label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: max-width 0.30s cubic-bezier(.4, 0, .2, 1), 
              opacity 0.25s ease;
}
.fab-manual:hover .fab-manual__label { max-width: 180px; opacity: 1; }

/* Modal Overlay */
.modal-overlay-manual {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Visible cuando JS añade la clase */
.modal-overlay-manual.is-open { display: flex !important; }

/* Contenedor interior */
.modal-container-manual {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1100px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.30);
}

/* Barra de título */
.modal-header-manual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #1E3A8A;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}

.modal-title-manual {
  color: white;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close-manual {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.modal-close-manual:hover { background: rgba(255, 255, 255, 0.30); }

/* Iframe */
.modal-iframe-manual {
  flex: 1;
  border: none;
  width: 100%;
  display: block;
  min-height: 0;
}

/* ── Responsivo: Tablet (≤768px) ── */
@media (max-width: 768px) {
  .modal-overlay-manual {
    padding: 12px;
    align-items: flex-end;
  }
  .modal-container-manual {
    height: 92vh;
    border-radius: 20px 20px 12px 12px;
  }
}

/* ── Responsivo: Móvil (≤540px) ── */
@media (max-width: 540px) {
  .fab-manual { 
    bottom: 16px; 
    right: 16px; 
    padding: 12px; 
  }
  .fab-manual:hover { padding: 12px; gap: 0; }
  .fab-manual:hover .fab-manual__label { max-width: 0; opacity: 0; }

  .modal-overlay-manual {
    padding: 0;
    align-items: stretch;
  }
  .modal-container-manual {
    height: 100dvh;
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .modal-header-manual {
    border-radius: 0;
    padding: 12px 16px;
  }
  .modal-title-manual { font-size: 13px; }
}