/* ============================================================
   NeuroLab — base.css
   Variables, reset, tipografía, utilitarios, animaciones
   Paleta: morado/violeta (neurociencia)
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&display=swap');

/* --- Variables (paleta morada) --- */
:root {
    --navy:       #1A0E2E;          /* fondo principal: morado muy oscuro */
    --navy-mid:   #2A1A4A;          /* cards / superficies */
    --violet:     #8B5CF6;          /* acento principal */
    --violet-light:#A78BFA;
    --violet-dim: #6D28D9;
    --pink:       #EC4899;          /* acento secundario (rosa neuro) */
    --pink-glow:  rgba(236,72,153,0.25);
    --gold:       #C9A84C;          /* compatibilidad con skin ares */
    --white:      #FFFFFF;
    --gray-50:    #F8F9FC;
    --gray-100:   #EEF1F8;
    --gray-300:   #C8B8E0;          /* tono morado en textos secundarios */
    --gray-500:   #9C8AB5;
    --gray-700:   #4A3A6A;
    --text:       #0D1424;
    --radius:     14px;
    --radius-lg:  22px;

    /* Glassmorphism */
    --glass-bg:     rgba(42,26,74,0.55);
    --glass-border: rgba(139,92,246,0.18);
    --glass-blur:   blur(18px);

    /* Sombras */
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.25);
    --shadow-md:  0 6px 24px rgba(0,0,0,0.35);
    --shadow-lg:  0 16px 48px rgba(0,0,0,0.45);

    /* Transiciones */
    --t-fast:   150ms ease;
    --t-base:   250ms ease;
    --t-slow:   400ms ease;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--navy);
    color: var(--gray-100);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

img, video, svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--violet-light);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--violet); }

button {
    font-family: inherit;
    cursor: pointer;
}

ul, ol { list-style: none; }

/* --- Tipografía --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
    color: var(--white);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; font-weight: 700; }

p {
    color: var(--gray-300);
    font-size: 1rem;
    line-height: 1.7;
}

.lead {
    font-size: 1.15rem;
    color: var(--gray-100);
    font-weight: 400;
}

.label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--violet);
}

/* --- Mesh gradient background (morado) --- */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%,  rgba(139,92,246,0.20) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 90%,  rgba(236,72,153,0.14) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 60% 40%,  rgba(109,40,217,0.10) 0%, transparent 50%),
        var(--navy);
    pointer-events: none;
}

/* --- Contenedores --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

/* --- Glassmorphism card --- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.card {
    background: var(--navy-mid);
    border: 1px solid var(--gray-700);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color var(--t-base), box-shadow var(--t-base);
}

.card:hover {
    border-color: rgba(139,92,246,0.35);
    box-shadow: var(--shadow-md);
}

/* --- Botones --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.4rem;
    border-radius: var(--radius);
    border: none;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
    white-space: nowrap;
    cursor: pointer;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--violet);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(139,92,246,0.3);
}
.btn-pink {
    background: var(--pink);
    color: var(--white);
    box-shadow: 0 4px 16px var(--pink-glow);
}
.btn-gold {
    background: var(--gold);
    color: var(--navy);
}
.btn-ghost {
    background: transparent;
    color: var(--gray-100);
    border: 1.5px solid var(--gray-700);
}
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); opacity: 1; }

.btn-sm {
    padding: .4rem .9rem;
    font-size: .8rem;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .7rem;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.badge-violet { background: rgba(139,92,246,.15);  color: var(--violet-light); }
.badge-pink   { background: rgba(236,72,153,.18);   color: #F472B6; }
.badge-gold   { background: rgba(201,168,76,.18);   color: var(--gold); }
.badge-gray   { background: rgba(122,132,158,.15);  color: var(--gray-300); }

/* --- Divisor --- */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-700), transparent);
    border: none;
    margin: 2rem 0;
}

/* --- Scroll reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .6s ease, transform .6s ease;
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}

.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 80ms; }
.stagger > *:nth-child(3) { transition-delay: 160ms; }
.stagger > *:nth-child(4) { transition-delay: 240ms; }
.stagger > *:nth-child(5) { transition-delay: 320ms; }
.stagger > *:nth-child(6) { transition-delay: 400ms; }

/* --- Animaciones --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

/* --- Loader --- */
.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-700);
    border-top-color: var(--violet);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* --- Utilidades --- */
.text-violet { color: var(--violet); }
.text-pink   { color: var(--pink); }
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--gray-500); }
.text-white  { color: var(--white); }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .75rem; }

.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }

.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none; }
.d-block  { display: block; }

.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: .5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.overflow-clip { overflow: clip; }

/* --- IntersectionObserver init (JS añade class .in) --- */
/* Aplicar en JS:
   const io = new IntersectionObserver(entries => {
       entries.forEach(e => { if(e.isIntersecting) e.target.classList.add('in'); });
   }, { threshold: 0.12 });
   document.querySelectorAll('.reveal').forEach(el => io.observe(el));
*/

/* =========================================================
   Barra superior común (_partials/barra.php) y modo de carrera
   ========================================================= */
.nl-barra { position: relative; z-index: 20; background: rgba(15,8,32,.72); border-bottom: 1px solid rgba(139,92,246,.22); backdrop-filter: blur(10px); }
.nl-barra__in {
    max-width: 1500px; margin: 0 auto; padding: .45rem 1.5rem; min-height: 54px;
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem;
}
.nl-barra__logo { display: flex; align-items: center; gap: .5rem; flex: none; }
.nl-barra__logo-nl { height: 32px; width: auto; display: block; }
.nl-barra__logo-uach { height: 26px; width: auto; display: block; opacity: .85; }
.nl-barra__volver { flex: none; font-size: .82rem; font-weight: 700; color: var(--violet-light); text-decoration: none; padding: .3rem .6rem; border-radius: 8px; }
.nl-barra__volver:hover { background: rgba(139,92,246,.15); }
.nl-barra__tit { flex: 1 1 260px; min-width: 0; margin: 0; font-size: clamp(.98rem, 1.6vw, 1.2rem); font-weight: 800; line-height: 1.25; color: var(--white, #fff); }
.nl-barra__niveles { display: flex; gap: .3rem; flex: none; }
.nl-barra__nivel {
    font-size: .78rem; font-weight: 700; padding: .3rem .75rem; border-radius: 99px; text-decoration: none;
    border: 1.5px solid var(--gray-700); color: var(--gray-300); white-space: nowrap;
}
.nl-barra__nivel:hover { border-color: var(--violet); color: var(--violet-light); }
.nl-barra__nivel.is-actual { background: var(--violet); border-color: var(--violet); color: #fff; }
.nl-barra__der { display: flex; align-items: center; gap: .6rem; margin-left: auto; flex: none; }
.nl-carrera { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: rgba(255,255,255,.07); border: 1px solid var(--gray-700); }
.nl-carrera__op {
    font: inherit; font-size: .78rem; font-weight: 800; padding: .28rem .8rem; border-radius: 99px; border: 0; cursor: pointer;
    color: var(--gray-300); background: none; transition: background .2s, color .2s;
}
.nl-carrera__op.active { background: linear-gradient(135deg, #8B5CF6, #EC4899); color: #fff; box-shadow: 0 2px 8px rgba(139,92,246,.4); }
.nl-barra__guia { font-size: .82rem; font-weight: 700; color: var(--gray-100); text-decoration: none; padding: .3rem .6rem; border-radius: 8px; border: 1px solid var(--gray-700); white-space: nowrap; }
.nl-barra__guia:hover { border-color: var(--violet); }
@media (max-width: 900px) {
    .nl-barra__in { padding: .45rem 1rem; }
    .nl-barra__logo-uach { display: none; }
    .nl-barra__tit { order: 5; flex-basis: 100%; font-size: 1rem; }
    .nl-barra__niveles { order: 6; }
    .nl-barra__guia span { display: none; }
}
@media print { .nl-barra { display: none; } }

/* Modo de carrera: se oculta lo de la otra carrera */
/* Textos por carrera: los oculta la regla que genera _partials/carreras.php / js/carrera.js */
.nl-barra__logo-uach { height: 30px; opacity: 1; }

/* ===============================================================
   Navegación del sitio (_partials/nav.php) — estilo DigitalDuck
   =============================================================== */
.nl-nav {
    position: sticky; top: 0; z-index: 900;
    background: linear-gradient(120deg, #3B0764 0%, #5B21B6 60%, #9D174D 100%);
    box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.nl-nav__in { max-width: 1240px; margin: 0 auto; padding: .5rem 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nl-nav__logos { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.nl-nav__logo-nl { height: 40px; width: auto; }
.nl-nav__marca { font-weight: 800; font-size: 1.15rem; color: #fff; letter-spacing: .01em; }
.nl-nav__logo-uach { height: 42px; width: auto; margin-left: .4rem; padding-left: .8rem; border-left: 1px solid rgba(255,255,255,.3); }
.nl-nav__menu { display: flex; align-items: center; gap: 1.1rem; }
.nl-nav__link { color: #EDE9FE; font-weight: 700; font-size: .9rem; text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nl-nav__link:hover, .nl-nav__link.is-activo { color: #fff; border-bottom-color: #FCD34D; }
.nl-nav__pill {
    display: inline-flex; align-items: center; gap: .35rem; height: 2.2rem; padding: 0 1rem;
    font: inherit; font-weight: 800; font-size: .85rem; color: #2E1065; text-decoration: none; white-space: nowrap;
    background: linear-gradient(135deg, #FCD34D, #FDE68A); border: none; border-radius: 99px; cursor: pointer;
    box-shadow: 0 2px 8px rgba(252,211,77,.3); transition: transform .2s ease;
}
.nl-nav__pill:hover { transform: translateY(-1px); color: #2E1065; }
.nl-nav__pill--guia { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; border: 1px solid rgba(255,255,255,.35); }
.nl-nav__pill--guia:hover { color: #fff; background: rgba(255,255,255,.22); }
.nl-nav__caret { font-size: .65rem; }
.nl-nav__drop { position: relative; }
.nl-nav__drop-menu {
    position: absolute; right: 0; top: calc(100% + 10px); min-width: 280px; padding: .4rem;
    background: #fff; border-radius: 14px; box-shadow: 0 12px 35px rgba(0,0,0,.35);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .2s ease;
}
.nl-nav__drop-menu.is-abierto { opacity: 1; visibility: visible; transform: none; }
.nl-nav__drop-menu a { display: block; padding: .6rem .8rem; border-radius: 10px; text-decoration: none; color: #1F1A2E; }
.nl-nav__drop-menu a:hover { background: #F5F3FF; }
.nl-nav__drop-menu strong { display: block; font-size: .92rem; }
.nl-nav__drop-menu span { font-size: .8rem; color: #4B4560; }
.nl-nav__admin { color: #fff; opacity: .4; text-decoration: none; font-size: .9rem; }
.nl-nav__admin:hover { opacity: 1; }
.nl-nav__toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; padding: 6px; cursor: pointer; }
.nl-nav__toggle span { width: 24px; height: 2.5px; border-radius: 2px; background: #FCD34D; }
@media (max-width: 820px) {
    .nl-nav__logo-uach { height: 34px; }
    .nl-nav__toggle { display: flex; }
    .nl-nav__menu {
        display: none; position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: .3rem; padding: .8rem 16px 1rem;
        background: #3B0764; box-shadow: 0 10px 20px rgba(0,0,0,.35);
    }
    .nl-nav__menu.is-abierto { display: flex; }
    .nl-nav__link { padding: .5rem 0; }
    .nl-nav__drop-menu { position: static; min-width: 0; margin-top: .4rem; display: none; opacity: 1; visibility: visible; transform: none; }
    .nl-nav__drop-menu.is-abierto { display: block; }
    .nl-nav__pill { justify-content: center; }
}
@media (max-width: 420px) { .nl-nav__marca { display: none; } }

/* ===============================================================
   Pie común (_partials/footer.php)
   =============================================================== */
.nl-pie { margin-top: 3rem; background: #120822; border-top: 1px solid rgba(167,139,250,.2); color: #DDD6FE; font-size: .88rem; line-height: 1.55; }
.nl-pie a { color: #C4B5FD; }
.nl-pie a:hover { color: #FCD34D; }
.nl-pie__in { max-width: 1240px; margin: 0 auto; padding: 2rem 16px 1.2rem; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1.5rem 2rem; }
.nl-pie__tit { margin: 0 0 .5rem; font-weight: 800; color: #fff; font-size: .95rem; }
.nl-pie p { margin: 0; color: #DDD6FE; }
.nl-pie ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.nl-pie li span { color: #A99BC6; font-size: .82rem; }
.nl-pie__logo-nl { height: 72px; width: auto; display: block; margin-bottom: .6rem; }
.nl-pie__logos { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; }
.nl-pie__logos img { height: 44px; width: auto; }
.nl-pie__logo-tmh { border-radius: 8px; background: #fff; padding: 2px; }
.nl-pie__fuentes { margin-top: .7rem !important; font-size: .82rem; }
.nl-pie__equipo { max-width: 1240px; margin: 0 auto; padding: 1.2rem 16px 1.6rem; border-top: 1px solid rgba(167,139,250,.15); }
.nl-pie__equipo ul { grid-template-columns: repeat(3, 1fr); align-items: start; gap: 1.5rem 2rem; margin-top: .3rem; }
.nl-pie__equipo li { display: flex; align-items: center; gap: .6rem; }
.nl-pie__equipo img { width: 40px; height: 40px; border-radius: 50%; background: #2A1A4A; flex: none; }
.nl-pie__equipo li span { display: flex; flex-direction: column; font-size: .82rem; color: #A99BC6; }
.nl-pie__equipo li strong { color: #fff; font-size: .88rem; }
.nl-pie__copy { margin-top: .4rem !important; font-size: .8rem; color: #A99BC6 !important; }
@media (max-width: 760px) { .nl-pie__in { grid-template-columns: 1fr; } }
@media print { .nl-pie, .nl-nav { display: none !important; } }

/* ============================================================
   NeuroLab — pool de actividades: estados de revisión
   ============================================================ */
.nl-estado {
    display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap;
    font-size: .72rem; font-weight: 700; line-height: 1; padding: .3rem .55rem; border-radius: 100px;
    border: 1px solid transparent;
}
.nl-estado--en_desarrollo { background: rgba(245,158,11,.14); color: #FCD34D; border-color: rgba(245,158,11,.35); }
.nl-estado--en_revision   { background: rgba(56,189,248,.14); color: #7DD3FC; border-color: rgba(56,189,248,.35); }
.nl-estado--visado        { background: rgba(34,197,94,.12);  color: #86EFAC; border-color: rgba(34,197,94,.35); }
.nl-estado--funcionando   { background: rgba(34,197,94,.22);  color: #BBF7D0; border-color: rgba(34,197,94,.5); }
.nl-card-etqs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.nl-barra .nl-estado { flex: none; }
.nl-act-etqs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .6rem; }
.nl-tipo { font-size: .75rem; color: var(--gray-300); }

/* Recursos externos y ficha automática de la actividad */
.nl-enlaces { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.nl-enlaces a { color: var(--violet-light); font-size: .88rem; font-weight: 600; text-decoration: none; }
.nl-enlaces a:hover { text-decoration: underline; }
.nl-enlaces span { display: block; font-size: .78rem; color: var(--gray-300); }

.nl-ficha { padding: 1.4rem 1.5rem; max-width: 760px; color: var(--gray-100); }
.nl-ficha h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--violet-light); margin: 1.1rem 0 .35rem; }
.nl-ficha h3:first-child { margin-top: 0; }
.nl-ficha p, .nl-ficha li { font-size: .95rem; line-height: 1.6; }
.nl-ficha ul { padding-left: 1.1rem; }
.nl-ficha a { color: var(--violet-light); }
.nl-ficha__aviso { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem .9rem; border-radius: 12px;
    background: rgba(245,158,11,.08); border: 1px dashed rgba(245,158,11,.4); margin-bottom: .6rem; font-size: .88rem !important; }
.nl-ficha__docente { margin-top: 1.4rem; padding: 1rem 1.1rem; border-radius: 12px; background: rgba(139,92,246,.07); border: 1px solid rgba(139,92,246,.25); }
.nl-ficha__docente dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; font-size: .88rem; }
.nl-ficha__docente dt { color: var(--gray-300); font-weight: 700; }
.nl-act-html .nl-ficha { padding: 0; }
.nl-act-recurso-pane:has(.nl-ficha) { min-height: 0; }

/* Pie: columnas de contacto y «Experiencia digital» sobre el copyright */
.nl-pie__equipo img { object-fit: cover; }
.nl-pie .nl-pie__exp { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(167,139,250,.12); font-size: .82rem; font-weight: 700; color: var(--violet-light); }
.nl-pie__cols { display: grid; grid-template-columns: 3fr 1.1fr; gap: 1.5rem 2rem; }
.nl-pie__contacto { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; }
.nl-pie__contacto strong { color: #fff; font-size: .88rem; margin-top: .45rem; }
.nl-pie__contacto .nl-pie__tit + strong { margin-top: .3rem; }
@media (max-width: 1000px) { .nl-pie__cols { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .nl-pie__equipo ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .nl-pie__equipo ul { grid-template-columns: 1fr; } }
