/* =================================================================
   INFORMACIÓN INSTITUCIONAL - FUNDECIMA
   Estilos separados para el módulo standalone
   ================================================================= */

/* --- VARIABLES GLOBALES --- */
:root {
    --lm-blue-primary: #1e3a8a;
    --lm-blue-dark: #172554;
    --lm-blue-light: #3b82f6;
    --lm-green-primary: #059669;
    --lm-green-dark: #047857;
    --lm-green-light: #10b981;
    --lm-gray-50: #FAFAFA;
    --lm-gray-100: #F5F7FA;
    --lm-gray-200: #E9ECEF;
    --lm-gray-300: #DEE2E6;
    --lm-gray-700: #495057;
    --lm-gray-800: #343A40;
    --lm-gray-900: #0f172a;
    --lm-white: #FFFFFF;
    --lm-gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #059669 100%);
    --lm-gradient-soft: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
    --lm-shadow-sm: 0 2px 8px rgba(30, 58, 138, 0.08);
    --lm-shadow-md: 0 4px 16px rgba(30, 58, 138, 0.12);
    --lm-shadow-lg: 0 8px 32px rgba(30, 58, 138, 0.16);
    --lm-shadow-xl: 0 16px 48px rgba(30, 58, 138, 0.20);
    --lm-radius-sm: 8px;
    --lm-radius-md: 12px;
    --lm-radius-lg: 16px;
    --lm-radius-xl: 24px;
    --lm-radius-full: 9999px;
    --lm-font-primary: 'Poppins', sans-serif;
    --lm-font-secondary: 'Inter', sans-serif;
    --lm-transition-normal: 0.3s ease;
    --lm-transition-fast: 0.2s ease;
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--lm-font-secondary);
    background-color: var(--lm-gray-50);
    color: var(--lm-gray-700);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--lm-font-primary);
    color: var(--lm-gray-900);
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--lm-transition-normal);
}

/* --- HEADER SUPERIOR --- */
.top-bar {
    background: var(--lm-gradient-primary);
    color: var(--lm-white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--lm-shadow-md);
}

.top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--lm-font-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.brand i {
    font-size: 1.8rem;
    color: var(--lm-white);
}

.btn-volver {
    background: rgba(255, 255, 255, 0.15);
    color: var(--lm-white);
    padding: 8px 20px;
    border-radius: var(--lm-radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--lm-transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-volver:hover {
    background: var(--lm-white);
    color: var(--lm-blue-primary);
    transform: translateY(-2px);
    box-shadow: var(--lm-shadow-md);
}

/* --- HERO SECTION --- */
.hero {
    background: var(--lm-gradient-primary);
    color: var(--lm-white);
    text-align: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    pointer-events: none;
}

.hero h1 {
    color: var(--lm-white);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    max-width: 1200px;
    margin: -40px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* --- TARJETA DE INTRODUCCIÓN LEGAL --- */
.legal-intro-card {
    background: var(--lm-white);
    padding: 40px;
    border-radius: var(--lm-radius-lg);
    box-shadow: var(--lm-shadow-md);
    margin-bottom: 40px;
    border-left: 5px solid var(--lm-green-primary);
}

.legal-intro-card h2 {
    color: var(--lm-blue-primary);
    font-size: 1.8rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.legal-intro-card h2 i {
    color: var(--lm-green-primary);
}

.legal-intro-card p {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
    color: var(--lm-gray-700);
    margin-bottom: 15px;
}

/* --- SECCIÓN DE DOCUMENTOS --- */
.documents-section {
    background: var(--lm-white);
    padding: 40px;
    border-radius: var(--lm-radius-lg);
    box-shadow: var(--lm-shadow-md);
    margin-bottom: 40px;
}

.documents-section h2 {
    color: var(--lm-blue-primary);
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.documents-section h2 i {
    color: var(--lm-green-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--lm-gray-700);
    font-size: 0.95rem;
    margin-bottom: 30px;
    font-style: italic;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--lm-gray-50);
    border-radius: var(--lm-radius-md);
    border: 2px solid var(--lm-gray-200);
    transition: all var(--lm-transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.document-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--lm-gradient-primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--lm-transition-normal);
}

.document-item:hover {
    background: var(--lm-gradient-soft);
    border-color: var(--lm-blue-primary);
    transform: translateY(-3px);
    box-shadow: var(--lm-shadow-md);
}

.document-item:hover::before {
    transform: scaleY(1);
}

.document-item i:first-child {
    font-size: 1.5rem;
    color: var(--lm-blue-primary);
    flex-shrink: 0;
    transition: color var(--lm-transition-normal);
}

.document-item:hover i:first-child {
    color: var(--lm-green-primary);
}

.document-item span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--lm-gray-800);
    line-height: 1.4;
    flex: 1;
}

.document-view-icon {
    font-size: 1rem !important;
    color: var(--lm-gray-300) !important;
    transition: all var(--lm-transition-normal) !important;
}

.document-item:hover .document-view-icon {
    color: var(--lm-green-primary) !important;
    transform: scale(1.2);
}

/* --- SECCIÓN CUMPLIMIENTO NORMATIVO --- */
.compliance-section {
    background: var(--lm-gradient-soft);
    padding: 40px;
    border-radius: var(--lm-radius-lg);
    box-shadow: var(--lm-shadow-sm);
    margin-bottom: 40px;
    border: 1px solid rgba(30, 58, 138, 0.1);
}

.compliance-section h2 {
    color: var(--lm-blue-primary);
    font-size: 1.6rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.compliance-section h2 i {
    color: var(--lm-green-primary);
}

.compliance-section p {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
    color: var(--lm-gray-700);
}

/* =================================================================
   MODAL PROFESIONAL PARA PDFs
   ================================================================= */

/* Overlay oscuro */
.pdf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: pdfModalFadeIn 0.3s ease;
}

@keyframes pdfModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Contenedor del Modal */
.pdf-modal {
    background: var(--lm-white);
    border-radius: var(--lm-radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.pdf-modal-show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Estado Maximizado */
.pdf-modal-maximized {
    max-width: 100%;
    width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    height: calc(100vh - 40px);
    border-radius: var(--lm-radius-md);
}

/* Header del Modal */
.pdf-modal-header {
    background: var(--lm-gradient-primary);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-shrink: 0;
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.pdf-modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.pdf-modal-icon {
    font-size: 1.8rem;
    color: var(--lm-white);
    flex-shrink: 0;
    animation: pdfIconPulse 2s ease-in-out infinite;
}

@keyframes pdfIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.pdf-modal-title-info {
    flex: 1;
    min-width: 0;
}

.pdf-modal-title-info h3 {
    color: var(--lm-white);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-modal-subtitle {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 2px;
}

/* Botones del Header */
.pdf-modal-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pdf-modal-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: var(--lm-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--lm-transition-fast);
    font-size: 0.95rem;
    padding: 0;
}

.pdf-modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.pdf-modal-btn:active {
    transform: translateY(0);
}

.pdf-modal-btn-close:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.pdf-modal-btn-download:hover {
    background: var(--lm-green-primary);
    border-color: var(--lm-green-primary);
}

.pdf-modal-btn-maximize:hover {
    background: var(--lm-blue-light);
    border-color: var(--lm-blue-light);
}

/* Barra de progreso decorativa */
.pdf-modal-progress-bar {
    height: 3px;
    background: var(--lm-gray-200);
    flex-shrink: 0;
    overflow: hidden;
}

.pdf-modal-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--lm-gradient-primary);
    animation: pdfProgress 1.5s ease forwards;
}

@keyframes pdfProgress {
    to {
        width: 100%;
    }
}

/* Cuerpo del Modal */
.pdf-modal-body {
    flex: 1;
    position: relative;
    background: var(--lm-gray-100);
    overflow: hidden;
    min-height: 500px;
}

.pdf-modal-body iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdf-modal-maximized .pdf-modal-body iframe {
    min-height: calc(100vh - 250px);
}

/* Loading Spinner */
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.pdf-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--lm-gray-200);
    border-top-color: var(--lm-blue-primary);
    border-radius: 50%;
    animation: pdfSpin 0.8s linear infinite;
}

@keyframes pdfSpin {
    to {
        transform: rotate(360deg);
    }
}

.pdf-loading p {
    color: var(--lm-gray-700);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Footer del Modal */
.pdf-modal-footer {
    background: var(--lm-gray-50);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--lm-gray-200);
    flex-shrink: 0;
}

.pdf-modal-footer-info {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--lm-gray-700);
}

.pdf-modal-footer-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-modal-footer-info i {
    color: var(--lm-green-primary);
}

.pdf-footer-btn {
    background: var(--lm-gradient-primary);
    color: var(--lm-white);
    border: none;
    padding: 8px 20px;
    border-radius: var(--lm-radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--lm-transition-normal);
    font-family: var(--lm-font-primary);
}

.pdf-footer-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--lm-shadow-md);
}

/* =================================================================
   FOOTER --- */
.footer {
    background: var(--lm-gray-900);
    color: var(--lm-white);
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer-brand {
    font-family: var(--lm-font-primary);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--lm-white);
    margin-bottom: 10px;
}

.footer p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* --- ANIMACIONES DE ENTRADA --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legal-intro-card,
.documents-section,
.compliance-section {
    animation: fadeInUp 0.6s ease forwards;
}

.documents-section {
    animation-delay: 0.2s;
}

.compliance-section {
    animation-delay: 0.4s;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .top-bar-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .brand {
        justify-content: center;
    }

    .legal-intro-card,
    .documents-section,
    .compliance-section {
        padding: 25px;
    }

    .legal-intro-card h2,
    .documents-section h2,
    .compliance-section h2 {
        font-size: 1.4rem;
    }

    .documents-grid {
        grid-template-columns: 1fr;
    }

    .document-item {
        padding: 15px;
    }

    /* Modal Responsive */
    .pdf-modal {
        max-width: 100%;
        max-height: 95vh;
    }

    .pdf-modal-header {
        padding: 14px 16px;
        flex-wrap: wrap;
    }

    .pdf-modal-title-info h3 {
        font-size: 0.95rem;
    }

    .pdf-modal-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .pdf-modal-footer {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .pdf-modal-footer-info {
        flex-direction: column;
        gap: 6px;
        font-size: 0.75rem;
    }

    .pdf-modal-body {
        min-height: 400px;
    }

    .pdf-modal-body iframe {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 15px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .main-content {
        margin-top: -30px;
    }

    .btn-volver {
        padding: 6px 15px;
        font-size: 0.85rem;
    }

    .pdf-modal-overlay {
        padding: 10px;
    }

    .pdf-modal-maximized {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
    }

    .pdf-modal-subtitle {
        display: none;
    }
}

/* =================================================================
   ACCESIBILIDAD - Reducir movimiento
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
    .pdf-modal,
    .pdf-modal-btn,
    .document-item,
    .btn-volver {
        transition: none;
    }

    .pdf-modal-icon,
    .pdf-loading-spinner {
        animation: none;
    }

    .pdf-modal-progress-fill {
        animation: none;
        width: 100%;
    }
}