/* =/* ===== IMPORTAR FUENTE ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ===== RESET Y VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --secondary: #ecf0f1;
    --accent: #27ae60;
    --accent-dark: #1e8449;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --bg: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --radius: 12px;
    --transition: 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== PÁGINAS DE LOGIN / REGISTRO ===== */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

.login-container {
    background: white;
    padding: 48px 36px;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-container h2 {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dce1e8;
    border-radius: 8px;
    font-size: 1rem;
    transition: border var(--transition);
    background: #f8f9fa;
    font-family: inherit;
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
    background: white;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
}
.btn-primary:hover {
    background: var(--accent-dark);
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--primary);
}
.btn-secondary:hover {
    background: #d5dbdb;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-weight: 500;
    font-size: 0.95rem;
}
.alert.error {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6c6;
}
.alert.success {
    background: #eafaf1;
    color: var(--accent-dark);
    border: 1px solid #a9dfbf;
}

.register-link {
    margin-top: 20px;
    font-size: 0.95rem;
    color: var(--text-light);
}
.register-link a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.register-link a:hover {
    text-decoration: underline;
}

/* ===== BANNER ===== */
.banner {
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    padding: 100px 20px;
    text-align: center;
    border-bottom: 1px solid #e0e4e8;
}

.banner-content h1.titulo-principal {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0;
    line-height: 1.2;
}

.banner-content h2.subtitulo {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-top: 0;
    margin-bottom: 20px;
}

.banner-content p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 30px;
}

.banner .btn-primary {
    width: auto;
    padding: 14px 40px;
}

/* ===== SECCIONES ===== */
.section {
    padding: 70px 0;
}
.alt-bg {
    background: var(--secondary);
}

.card {
    background: white;
    padding: 40px 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #eceff2;
}

.section h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
    text-align: center;
}
.section h3 {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}
.section p {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 28px 0;
}
.grid-2 ul {
    list-style: none;
    padding: 0;
}
.grid-2 ul li {
    padding: 8px 0;
    border-bottom: 1px solid #eceff2;
    color: var(--text-light);
}

/* Galería */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform var(--transition), box-shadow var(--transition);
}
.gallery-item img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}
.video-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Consejos */
.tips-list {
    list-style: none;
    padding: 0;
}
.tips-list li {
    padding: 14px 20px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    color: var(--text-light);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--primary);
    color: #dce1e8;
    text-align: center;
    padding: 32px 0;
    margin-top: 20px;
}
.footer p {
    margin: 4px 0;
    font-size: 0.95rem;
}

/* ===== BOTÓN FLOTANTE ===== */
.bubble-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 999;
    animation: float 3s ease-in-out infinite;
    font-family: 'Poppins', sans-serif;
}

.bubble-btn:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 12px 35px rgba(39, 174, 96, 0.6);
}

.bubble-icon {
    font-size: 1.6rem;
    line-height: 1;
}
.bubble-text {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: -2px;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .bubble-btn {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }
    .bubble-icon { font-size: 1.4rem; }
    .bubble-text { font-size: 0.5rem; }

    .banner-content h1.titulo-principal {
        font-size: 2.5rem;
    }
    .banner-content h2.subtitulo {
        font-size: 1.6rem;
    }
    .banner {
        padding: 70px 16px;
    }
    .section h2 {
        font-size: 1.8rem;
    }
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .card {
        padding: 28px 20px;
    }
    .login-container {
        padding: 32px 20px;
        margin: 0 16px;
    }
}

/* ===== BANNER CON IMÁGENES ROTATIVAS ===== */
.banner-slider {
    position: relative;
    overflow: hidden;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: none;
}
.hero-slides,
.hero-overlay {
    position: absolute;
    inset: 0;
}
.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1.2s ease, transform 6s ease-out;
}
.hero-slide.active {
    opacity: 1;
    transform: scale(1);
}
.hero-overlay {
    background: linear-gradient(180deg, rgba(20,32,44,0.55) 0%, rgba(20,32,44,0.65) 100%);
}
.banner-slider .banner-content {
    position: relative;
    z-index: 2;
}
.banner-slider .banner-content h1.titulo-principal,
.banner-slider .banner-content h2.subtitulo {
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
.banner-slider .banner-content p {
    color: #eef2f5;
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background var(--transition);
}
.hero-arrow:hover { background: rgba(255,255,255,0.4); }
.hero-prev { left: 20px; }
.hero-next { right: 20px; }
.hero-dots {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 20px;
}
.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.hero-dot.active {
    background: #fff;
    transform: scale(1.3);
}
@media (max-width: 768px) {
    .banner-slider { min-height: 480px; }
    .hero-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide { transition: opacity 0.3s; transform: none; }
}

/* Portada (afiche) como primera diapositiva: se muestra completa, sin texto encima */
.hero-poster .poster-bg,
.hero-poster .poster-fg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.hero-poster .poster-bg {
    object-fit: cover;
    filter: blur(22px) brightness(0.7);
    transform: scale(1.1);
}
.hero-poster .poster-fg {
    object-fit: contain;
}
.banner-slider.poster-active .hero-overlay,
.banner-slider.poster-active .banner-content {
    opacity: 0;
    pointer-events: none;
}
.hero-overlay,
.banner-slider .banner-content {
    transition: opacity 0.6s ease;
}

/* ============================================================
   BARRA SUPERIOR CON MENÚ DESPLEGABLE
   Una sola línea: logo Altamira a la izquierda, SENA + ☰ a la
   derecha. Todo lo demás (enlaces, usuario, cerrar sesión) vive
   dentro del panel desplegable.
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #2c3e50;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Logo izquierdo */
.topbar-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}
.topbar-brand:hover { transform: scale(1.06); }

.topbar-brand img {
    width: 52px;
    height: 52px;
    display: block;
    border-radius: 50%;
    background: #fff;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Zona derecha: SENA + botón hamburguesa */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.topbar-sena {
    width: 52px;
    height: 52px;
    display: block;
    border-radius: 50%;
    background: transparent;
    object-fit: contain;
}

.menu-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* Botón hamburguesa: tres líneas que se convierten en X */
.menu-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.menu-toggle:hover { background: rgba(255,255,255,0.1); }
.menu-toggle:focus-visible { outline: 2px solid #27ae60; outline-offset: 2px; }

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    border-radius: 2px;
    background: #fff;
    transition: transform 0.3s ease, opacity 0.18s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Panel desplegable, pegado a la derecha */
.menu-panel {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 330px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 8px;
    background: #22303f;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    box-shadow: 0 22px 50px rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}
.menu-panel.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Cabecera del panel: usuario conectado */
.mp-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}
.mp-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
}
.mp-user-data {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.mp-user-name {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mp-user-role {
    color: #8fa6bb;
    font-size: 0.74rem;
    letter-spacing: 0.3px;
}

/* Enlaces del menú */
.mp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mp-list a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #dfe7ee;
    font-size: 0.93rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
}
.mp-list a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    padding-left: 16px;
}
.mp-list a:focus-visible { outline: 2px solid #27ae60; outline-offset: -2px; }

/* Página actual: gris azulado + acento verde */
.mp-list a.active {
    background: #566573;
    color: #fff;
    box-shadow: inset 3px 0 0 #27ae60;
}
.mp-ico {
    flex: 0 0 22px;
    width: 22px;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1;
}

/* Separador y cerrar sesión */
.mp-sep {
    height: 1px;
    margin: 6px 10px;
    background: rgba(255,255,255,0.09);
}
.mp-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 6px 6px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
}
.mp-logout:hover {
    background: #d33f2f;
    color: #fff;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .topbar-inner { height: 64px; padding: 0 16px; }
    .topbar-brand img { width: 44px; height: 44px; }
    .topbar-sena { width: 44px; height: 44px; }
    .topbar-actions { gap: 8px; }
    .menu-toggle { width: 40px; height: 40px; }
    .menu-panel { width: min(330px, calc(100vw - 20px)); }
}
@media (max-width: 380px) {
    .topbar-brand img { width: 38px; height: 38px; }
    .topbar-sena { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    .topbar-brand, .menu-toggle, .menu-toggle span, .menu-panel, .mp-list a, .mp-logout {
        transition: none;
    }
}
