/* ---------- 1. Variables ---------- */
:root {
  --verde-principal: #4CAF50;
  --verde-oscuro: #2E7D32;
  --verde-claro: #A5D6A7;
  --negro: #000000;
  --morado-profundo: #663399;
  --morado-oscuro: #5D3A7A;
  --azul-profundo: #1E3A8A;
  --azul-claro: #60A5FA;

  --fondo-1: #10204d;
  --fondo-2: #3d1f66;
  --acento: #60A5FA;
  --texto: #ffffff;
  --texto-suave: rgba(255,255,255,0.72);
  --tarjeta: rgba(255,255,255,0.06);
  --linea: rgba(255,255,255,0.18);
}

/* ---------- 2. Navbar ---------- */
.navbar-custom {
  background: linear-gradient(135deg, var(--fondo-1), var(--fondo-2));
  padding: 14px 0;
}
.logo-text {
  font-weight: 700;
  font-size: 1.3rem;
  color: white;
  letter-spacing: 0.5px;
}
.navbar-custom .nav-link {
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  transition: color 0.2s ease;
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: var(--acento);
}

/* ---------- 3. Botones ---------- */
.btn-acento {
  background-color: var(--acento);
  color: var(--fondo-1);
  border: none;
  font-weight: 600;
}
.btn-outline-acento {
  background-color: var(--morado-profundo);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
  font-weight: 600;
}

/* ---------- 4. Página principal (index) ---------- */
.logo-navbar {
  object-fit: contain;
  width: 70px;
  height: 80px;
}
.hero-section {
  background: linear-gradient(135deg, var(--fondo-1), var(--fondo-2));
  color: white;
  padding: 100px 0;
}
.hero-blob {
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, #60A5FA 0%, #1E3A8A 40%, transparent 70%);
  filter: blur(60px);
  opacity: 0.6;
}

/* ---------- 5. Páginas oscuras (evaluación, resultado y futuras) ----------*/

body.eval-page,
body.pagina-oscura {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--fondo-1), var(--fondo-2)) fixed;
  color: var(--texto);
}

:where(body.eval-page, body.pagina-oscura) a { color: inherit; }
:where(body.eval-page, body.pagina-oscura) a:hover { color: inherit; }

.acento-texto { color: var(--acento); }
.hide { display: none !important; }

.eval-page footer,
.pagina-oscura footer {
  color: var(--texto-suave);
  font-size: 0.85rem;
  padding-bottom: 90px;
}

/* ---------- 6. Test de evaluación ---------- */
.eval-hero {
  max-width: 640px; margin: 0 auto; padding: 40px 20px 8px;
}
.eval-hero h1 {
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--texto);
}
.eval-hero p {
  color: var(--texto-suave);
  font-size: 0.98rem;
  max-width: 52ch;
  margin: 0;
}

.eval-page main {
  max-width: 640px; margin: 0 auto; padding: 24px 20px;
}
.q-card {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.q-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--acento);
  margin-bottom: 6px;
}
.q-text {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 14px;
  color: var(--texto);
}
.options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
@media (max-width: 420px) {
  .options { grid-template-columns: 1fr; }
}
.opt { position: relative; }
.opt input {
  position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0;
}
.opt label {
  display: block;
  border: 1.5px solid var(--linea);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--texto-suave);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.opt label:hover { border-color: var(--acento); }
.opt input:checked + label {
  border-color: var(--acento);
  background: rgba(96,165,250,0.2);
  color: var(--texto);
  font-weight: 600;
}
.opt input:focus-visible + label {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}

.submit-bar {
  max-width: 640px; margin: 0 auto; padding: 8px 20px 110px;
}
.submit-btn { width: 100%; padding: 14px; }
.submit-btn:disabled {
  background: rgba(255,255,255,0.12);
  color: var(--texto-suave);
  cursor: not-allowed;
  opacity: 1;
}
.hint {
  text-align: center; font-size: 0.82rem; color: var(--texto-suave); margin-top: 10px;
}

/* Barra inferior fija: progreso + volver */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: linear-gradient(135deg, var(--fondo-1), var(--fondo-2));
  border-top: 1px solid var(--linea);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.back-link {
  font-size: 0.9rem; font-weight: 500;
  text-decoration: none;
  color: var(--acento) !important;
  white-space: nowrap;
}
.back-link:hover { color: var(--texto) !important; }
.progress-wrap { flex: 1; max-width: 280px; }
.progress-track {
  height: 6px; border-radius: 4px; background: var(--linea); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--acento), #a78bfa);
  transition: width .3s ease;
}
.progress-label { font-size: 0.75rem; color: var(--texto-suave); margin-top: 4px; }

/* ---------- 7. Página de resultado ---------- */
.panel {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: 16px;
  padding: 24px;
  height: 100%;
}
.puntaje { font-size: 3.5rem; font-weight: 700; line-height: 1; }
.item { border-top: 1px solid var(--linea); padding: 12px 0; }
.item:first-of-type { border-top: 0; }

/* =====================================================
   8. EFECTOS (van al final para tener prioridad)
   ===================================================== */

/* Entrada y salida de página (solo opacidad: así no se rompen
   los elementos position:fixed como la barra inferior) */
body { animation: entrar .5s ease both; }
@keyframes entrar { from { opacity: 0; } to { opacity: 1; } }
body.saliendo { opacity: 0; transition: opacity .35s ease; }

/* Aparición al hacer scroll */
.revelar {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.revelar.visible { opacity: 1; transform: none; }

/* Las cards del carrusel siempre visibles (Bootstrap las desliza solo) */
.carousel .card.revelar { opacity: 1; transform: none; }

/* Navbar al hacer scroll */
.navbar-custom { transition: box-shadow .3s ease, padding .3s ease; }
.navbar-custom.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,.4); padding: 8px 0; }

/* Cards y paneles con efecto al pasar el mouse */
.card, .panel { transition: transform .25s ease, box-shadow .25s ease; }
.revelar.visible.card, .revelar.visible.panel {
  transition: opacity .7s ease, transform .25s ease, box-shadow .25s ease;
}
.card:hover, .panel:hover,
.revelar.visible.card:hover, .revelar.visible.panel:hover,
.carousel .card.revelar:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  body.saliendo { transition: none; }
  .revelar { opacity: 1; transform: none; transition: none; }
  .progress-fill, .card, .panel { transition: none; }
}

/* ---------- 9. Inicio oscuro, cards y ventana emergente ---------- */
.pagina-oscura .hero-section { background: transparent; }
.pagina-oscura .card {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  color: var(--texto);
}
.pagina-oscura .card-footer {
  background: rgba(255,255,255,.05);
  border-top: 1px solid var(--linea);
}
.pagina-oscura .text-muted { color: var(--texto-suave) !important; }
.pagina-oscura footer { padding-bottom: 1rem; }

.badge-cat {
  background: rgba(96,165,250,.2);
  color: var(--acento);
  border: 1px solid rgba(96,165,250,.4);
  font-weight: 600;
}
.tarjeta-info { cursor: pointer; }
.tarjeta-info:hover { border-color: var(--acento); }
.tarjeta-info .leer-mas { color: var(--acento); font-size: .85rem; font-weight: 600; }

.modal-equilibria .modal-content {
  background: linear-gradient(135deg, var(--fondo-1), var(--fondo-2));
  color: var(--texto);
  border: 1px solid var(--linea);
  border-radius: 20px;
}
.modal-equilibria .modal-header,
.modal-equilibria .modal-footer { border-color: var(--linea); }
.modal-equilibria .modal-title { font-weight: 700; }
.modal-equilibria .modal-body p {
  line-height: 1.75;
  margin-bottom: 1rem;
  color: rgba(255,255,255,.9);
}

/* ---------- 10. Página de información ---------- */
html { scroll-behavior: smooth; }

.encabezado-pagina { padding: 56px 0 24px; }
.encabezado-pagina p { color: var(--texto-suave); max-width: 60ch; }

.pill-cat {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--linea);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--texto);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.pill-cat:hover {
  background: rgba(96,165,250,.2);
  border-color: var(--acento);
  color: var(--acento);
}

.seccion-categoria {
  padding-top: 40px;
  scroll-margin-top: 20px;
}

/* ---------- 11. Footer ---------- */
footer.footer-eq {
  position: relative;
  margin-top: 60px;
  padding: 0;
  background: linear-gradient(180deg, #0a1128, #060a1a);
  border-top: 1px solid var(--linea);
  color: var(--texto-suave);
  font-size: .92rem;
  text-align: left;
}
.footer-eq::before {
  content: "";
  position: absolute; top: -1px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--acento), #a78bfa, var(--acento));
}
.footer-main { padding-top: 48px; padding-bottom: 32px; }

.footer-titulo {
  color: var(--texto);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.footer-nota { font-size: .8rem; opacity: .8; }

.footer-eq a { text-decoration: none; }
.footer-link {
  color: var(--texto-suave);
  display: inline-block;
  padding: 3px 0;
  transition: color .2s ease, transform .2s ease;
}
.footer-link:hover { color: var(--acento); transform: translateX(3px); }

.footer-contacto {
  display: flex; align-items: center; gap: 10px;
  color: var(--texto-suave);
  padding: 5px 0;
  transition: color .2s ease;
}
.footer-contacto:hover { color: var(--acento); }
.footer-icono {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--linea);
  border-radius: 50%;
  background: var(--tarjeta);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.footer-contacto:hover .footer-icono {
  background: rgba(96,165,250,.2);
  border-color: var(--acento);
  transform: translateY(-2px);
}

/* Minimapa: oscuro por defecto, a color al pasar el mouse */
.footer-mapa {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--linea);
  aspect-ratio: 16 / 10;
}
.footer-mapa iframe {
  display: block;
  width: 100%; height: 100%;
  border: 0;
  filter: invert(90%) hue-rotate(180deg) brightness(.95) contrast(.9);
  transition: filter .3s ease;
}
.footer-mapa:hover iframe { filter: none; }

.footer-bottom {
  background: rgba(0,0,0,.35);
  border-top: 1px solid var(--linea);
  padding: 16px 0;
  font-size: .85rem;
}

/* En la evaluación, la barra fija inferior no debe tapar el footer */
body:has(.bottom-bar) footer.footer-eq .footer-bottom { padding-bottom: 90px; }

/* ---------- 12. Actividades ---------- */
.actividad {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 32px;
  scroll-margin-top: 20px;
}
.actividad-info {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.actividad-info p { color: var(--texto-suave); }

.actividad-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.sin-video {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--texto-suave);
  background: rgba(0, 0, 0, .28);
}

/* ---------- 13. Nosotros y PQRS ---------- */
.foto-integrante {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
  border: 3px solid var(--acento);
}
.foto-integrante.inicial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 700;
  background: rgba(96, 165, 250, .2);
  color: var(--acento);
}

/* Campos del formulario en modo oscuro */
.pagina-oscura .form-control,
.pagina-oscura .form-select {
  background-color: rgba(255, 255, 255, .08);
  border: 1px solid var(--linea);
  color: var(--texto);
}
.pagina-oscura .form-control:focus,
.pagina-oscura .form-select:focus {
  background-color: rgba(255, 255, 255, .12);
  border-color: var(--acento);
  color: var(--texto);
  box-shadow: 0 0 0 .2rem rgba(96, 165, 250, .25);
}
.pagina-oscura .form-select option { background: #10204d; color: #fff; }

/* ---------- 14. Ayuda urgente ---------- */

/* Recuadro del resultado (amarillo en nivel moderado, rojo en nivel alto) */
.ayuda-urgente {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-left: 5px solid #FBBF24;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
}
.ayuda-urgente.ayuda-alta {
  border-left-color: #F87171;
  background: rgba(248, 113, 113, .10);
}
.ayuda-lista li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--linea);
}
.ayuda-lista li:first-child { border-top: 0; }
.ayuda-numero {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--acento);
  text-decoration: none;
}
.ayuda-numero:hover { text-decoration: underline; }
.ayuda-mas { color: var(--acento); font-weight: 600; text-decoration: none; }
.ayuda-mas:hover { text-decoration: underline; }

/* Franja del footer, aparece en todas las páginas */
.footer-ayuda {
  background: rgba(248, 113, 113, .12);
  border-bottom: 1px solid var(--linea);
  padding: 12px 0;
  font-size: .9rem;
  color: var(--texto);
}
.footer-ayuda a { color: var(--acento); text-decoration: underline; }


/* ---------- 15. Introducción del index ---------- */
.intro-texto { max-width: 62ch; color: var(--texto-suave); font-size: 1.05rem; }
.intro-card { padding: 28px; }
.intro-icono {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  border-radius: 14px;
  background: rgba(96, 165, 250, .2);
  border: 1px solid rgba(96, 165, 250, .4);
  margin-bottom: 16px;
}
.intro-aviso {
  max-width: 70ch;
  border: 1px dashed var(--linea);
  border-radius: 14px;
  padding: 14px 18px;
  color: var(--texto-suave);
  font-size: .9rem;
}
.intro-aviso a { color: var(--acento); text-decoration: underline; }

/* ---------- 16. Página de PQRS ---------- */
.pqrs-tipo {
  border-left: 3px solid var(--acento);
  padding: 2px 0 2px 14px;
  margin-bottom: 16px;
}
.pqrs-tipo strong { display: block; }


/* ---------- 17. Imagen de los temas de información (modal) ---------- */

.modal-imagen {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 1.25rem;
  background: rgba(0, 0, 0, .28);
}
 
/* ---------- 18. Personajes (index) ---------- */
.personaje-card { padding: 24px; }
.personaje-imagen {
  --fondo-personaje: linear-gradient(160deg, #FFF8EC, #FBE9D3);
 
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  background: var(--fondo-personaje);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.personaje-imagen img {
  position: absolute;
  top: 14px;
  left: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  object-fit: contain;
}
 
/* Línea de abajo: en qué actividad aparece, siempre pegada al fondo de la tarjeta */
.personaje-actividad {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--linea);
  font-size: .85rem;
  color: var(--texto-suave);
}

#informacion > .container > h2,
#informacion > .container > p,
.seccion-categoria h3,
.seccion-categoria > p {
  text-align: center;
}

#informacion .container > .d-flex.flex-wrap {
  justify-content: center;
}

/* ---------- 20. Escudo del colegio (footer) ---------- */
.footer-institucion {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--linea);
}
/* Fondo blanco redondo: el borde del escudo es negro y se perdería sobre el footer oscuro */
.footer-institucion img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  flex-shrink: 0;
}
.footer-institucion span { font-size: .85rem; line-height: 1.35; color: var(--texto-suave); }
.footer-institucion strong { color: var(--texto); }