/* =========================================================================
   TIPOGRAFÍA CORPORATIVA (Geomanist)
   ========================================================================= */
@font-face {
    font-family: 'Geomanist';
    src: url('../assets/fonts/hinted-Geomanist-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}
@font-face {
    font-family: 'Geomanist';
    src: url('../assets/fonts/hinted-Geomanist-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Geomanist';
    src: url('../assets/fonts/hinted-Geomanist-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Geomanist';
    src: url('../assets/fonts/hinted-Geomanist-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Geomanist';
    src: url('../assets/fonts/hinted-Geomanist-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

:root {
    /* Paleta de Colores LES */
    --color-primary: #1A514D; /* Dark Teal - Corporativo */
    --color-secondary: #009688; /* Bright Teal - Acentos/Botones */
    --color-accent: #00Bfa5; /* Teal muy brillante para hovers */
    
    /* Neutros y Fondos */
    --color-bg-light: #F4F7F6;
    --color-text-main: #2C3E3D;
    --color-text-muted: #6B807E;
    --color-white: #FFFFFF;
    --color-error: #E53935;
    --dark-teal: #1A514D;
    --bright-teal: #009688;
    --accent-teal: #00Bfa5;
    --light-gray: #F4F7F6;
    --dark-slate: #2C3E3D;
    
    /* Variables Estructurales & Escala */
    --font-main: 'Geomanist', sans-serif;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --transition-speed: 0.3s;
    --shadow-soft: 0 8px 30px rgba(26, 81, 77, 0.08);
}

/* =========================================================================
   RESET & TIPOGRAFÍA
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg-light);
    color: var(--color-text-main);
    -webkit-font-smoothing: antialiased;
}

/* Footer Legal */
.legal-footer {
    margin-top: 5rem;
    padding: 3rem 2rem;
    border-top: 1px solid rgba(26, 81, 77, 0.1);
    background: white;
    text-align: center;
}

.legal-container {
    max-width: 1000px;
    margin: 0 auto;
}

.legal-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.legal-brand {
    font-weight: 700;
    color: var(--dark-teal);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--color-primary);
}

/* =========================================================================
   PANTALLA DE LOGIN
   ========================================================================= */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Fondo con un sutil gradiente corporativo */
    background: linear-gradient(135deg, var(--color-bg-light) 0%, #E0EBEA 100%);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    text-align: center;
    animation: fadeIn 0.6s ease-out forwards;
}

.brand-header {
    margin-bottom: 2.5rem;
}

.brand-logo {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    object-position: center;
    margin: 0 auto 1.5rem auto;
    /* Filtro CSS para convertir colores negros/oscuros al verde clarito (#009688) */
    filter: invert(36%) sepia(61%) saturate(2331%) hue-rotate(148deg) brightness(96%) contrast(104%);
}

.portal-title {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-primary);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    padding-right: 3rem; /* Espacio para el icono del ojo */
    border: 1px solid #D0DCDA;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
    background: var(--color-white);
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.15);
}

.toggle-password {
    position: absolute;
    right: 0.8rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    transition: color var(--transition-speed);
    z-index: 10;
}

.toggle-password:hover {
    color: var(--color-primary);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.error-text {
    color: var(--color-error);
    font-size: 0.8rem;
    min-height: 1rem;
}

/* =========================================================================
   ELEMENTOS DE INTERFAZ & BOTONES
   ========================================================================= */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform 0.1s ease;
}

.btn-primary:hover {
    background-color: var(--color-secondary);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* =========================================================================
   ANIMACIONES
   ========================================================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   PANEL DE CONTROL (DASHBOARD - OPCIÓN B)
   ========================================================================= */
.dashboard-body {
    background-color: var(--color-bg-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-nav {
    background-color: var(--color-white);
    border-bottom: 1px solid rgba(26, 81, 77, 0.1);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    height: 35px;
    /* Filtro para teñirlo del color primary (Dark Teal) en la cabecera clara */
    filter: invert(24%) sepia(13%) saturate(2331%) hue-rotate(124deg) brightness(88%) contrast(92%);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.dashboard-main {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 2rem;
    flex: 1;
    width: 100%;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeIn 0.4s ease-out;
}

.dashboard-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--color-text-muted);
}

/* Grilla Centrada de Tarjetas */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.tool-card {
    background: var(--color-white);
    border-radius: var(--border-radius-md);
    padding: 2.5rem 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--color-text-main);
    box-shadow: var(--shadow-soft);
    border: 1px solid transparent;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(26, 81, 77, 0.12);
    border-color: rgba(0, 150, 136, 0.3); /* bright teal */
}

.card-icon {
    width: 60px;
    height: 60px;
    background-color: var(--color-secondary);
    border-radius: 16px 16px 0 16px; /* Forma de hoja de la marca LES */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.8rem;
    transition: all var(--transition-speed);
}

.card-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--color-white);
}

.tool-card:hover .card-icon {
    background-color: var(--color-primary);
    transform: scale(1.05);
}

.tool-card h2 {
    font-size: 1.25rem;
    margin: 0;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.tool-card-disabled {
    opacity: 0.7;
    cursor: default;
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed rgba(26, 81, 77, 0.2);
}

.tool-card-disabled:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
    border-color: rgba(26, 81, 77, 0.2);
}

/* =========================================================================
   PÁGINAS INTERNAS (Páginas de recursos)
   ========================================================================= */

.nav-back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-speed);
}

.nav-back-link:hover {
    color: var(--color-secondary);
}

.nav-back-link svg {
    fill: currentColor;
}

.inner-page-main {
    margin-top: 2rem;
}

/* =========================================================================
   GRILLAS DE ARCHIVOS (Presentaciones / Institucional)
   ========================================================================= */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.file-card {
    background: var(--color-white);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid rgba(26, 81, 77, 0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 81, 77, 0.08);
}

.highlight-card {
    border-color: rgba(0, 150, 136, 0.3);
    background: linear-gradient(180deg, #FFFFFF 0%, #F9FCFC 100%);
}

.file-icon {
    width: 48px;
    height: 48px;
    background: var(--color-bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.file-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.file-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.file-info p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.file-card .btn-primary {
    padding: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    margin-top: auto;
}

/* =========================================================================
   BANCO DE IMÁGENES & FILTROS
   ========================================================================= */
.filter-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    background: var(--color-white);
    border: 1px solid rgba(26, 81, 77, 0.2);
    color: var(--color-text-main);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-btn:hover {
    background: var(--color-bg-light);
}

.filter-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.image-item {
    position: relative;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.image-item:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 81, 77, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    text-align: center;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

.image-overlay h3 {
    color: var(--color-white);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Lightbox Modal */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 25, 24, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--color-white);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
}

.lightbox-caption {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: var(--color-white);
}

.lightbox-caption h3 {
    color: var(--color-white);
    margin: 0;
}

/* =========================================================================
   SECCIÓN INSTITUCIONAL (Colores)
   ========================================================================= */
.institutional-section {
    margin-bottom: 4rem;
}

.institutional-section h2 {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(26, 81, 77, 0.1);
    padding-bottom: 0.5rem;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.color-card {
    background: var(--color-white);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
}

.color-swatch {
    height: 120px;
    width: 100%;
}

.color-details {
    padding: 1rem;
}

.color-details h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.color-code {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    background: var(--color-bg-light);
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.color-code:hover {
    background: rgba(0, 150, 136, 0.1);
}

/* =========================================================================
   ADMIN MODAL (Mock de Carga de Archivos)
   ========================================================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 81, 77, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 450px;
    padding: 2.5rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.upload-zone {
    border: 2px dashed rgba(26, 81, 77, 0.3);
    border-radius: var(--border-radius-md);
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-zone:hover {
    background: rgba(0, 150, 136, 0.05);
    border-color: var(--color-secondary);
}

.upload-zone span {
    color: var(--color-primary);
    font-weight: 500;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
/* =========================================================================
   ESTILOS INSTITUCIONALES AVANZADOS
   ========================================================================= */
.logo-preview-box {
    width: 100%;
    height: 120px;
    background: #fdfdfd;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 0.5rem;
}

.logo-preview-box.bg-dark {
    background: var(--dark-slate);
}

.logo-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.filter-white {
    filter: brightness(0) invert(1);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--color-bg-light);
    color: var(--color-text-muted);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

.typography-card {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 2.5rem;
    display: flex;
    gap: 4rem;
    align-items: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.05);
}

.typo-sample {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-right: 1px solid var(--color-bg-light);
    padding-right: 4rem;
}

.typo-letter {
    font-size: 5rem;
    font-weight: 700;
    color: var(--dark-teal);
    line-height: 1;
}

.typo-weights {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    color: var(--dark-slate);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .typography-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }
    .typo-sample {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--color-bg-light);
        padding-bottom: 2rem;
        width: 100%;
    }
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* =========================================================================
   ASISTENTE marIA - CHAT FLOTANTE
   ========================================================================= */
.maria-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.maria-launcher {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--color-white);
    box-shadow: 0 4px 20px rgba(26, 81, 77, 0.2);
    border: 3px solid var(--accent-teal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.maria-launcher:hover {
    transform: scale(1.1);
}

.maria-launcher img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.maria-chat-window {
    width: 350px;
    height: 500px;
    background: var(--color-white);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    margin-bottom: 20px;
    display: none; /* Se activa por JS */
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(26, 81, 77, 0.1);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.maria-chat-header {
    background: var(--dark-teal);
    color: white;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.maria-chat-header h3 {
    color: white;
    font-size: 1rem;
    margin: 0;
}

.maria-chat-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.maria-chat-body {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--color-bg-light);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.maria-chat-bubble {
    max-width: 85%;
    padding: 1rem;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bubble-maria {
    background: var(--color-white);
    color: var(--dark-slate);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(0,0,0,0.05);
}

.bubble-user {
    background: var(--accent-teal);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.maria-chat-footer {
    padding: 1rem;
    background: var(--color-white);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.maria-chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.maria-chat-options button {
    background: var(--color-bg-light);
    border: 1px solid var(--accent-teal);
    color: var(--dark-teal);
    padding: 0.5rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.maria-chat-options button:hover {
    background: var(--accent-teal);
    color: white;
}
