/* ==========================================================================
   T-ONE APPLICATION - MAIN STYLESHEET
   Directorio: /styles/main.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES DE MARCA Y COLORES (PANTONE OFICIALES)
   -------------------------------------------------------------------------- */
:root {
    /* Paleta Oficial Pantone Taurus */
    --pantone-286c: #0033A0;        /* Azul Oscuro Corporativo */
    --pantone-278c: #8FA9C4;        /* Azul Claro Transición */
    --pantone-382c: #C4D600;        /* Verde Lima Acento */
    --pantone-382c-hover: #a8b800;  /* Verde Lima Hover */

    /* Variables de Compatibilidad y UI */
    --taurus-blue: var(--pantone-278c); 
    --action-green: var(--pantone-382c); 
    --action-green-hover: var(--pantone-382c-hover);
    
    --text-dark: #222222;
    --text-light: #ffffff;
    --border-radius: 6px;
    --shadow-soft: 0 10px 25px rgba(0, 51, 160, 0.2);
}

/* --------------------------------------------------------------------------
   2. FUENTES Y TIPOGRAFÍA
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Myriad';
    src: url('/images/myriad.eot');
    src: url('/images/myriad.eot?#iefix') format('embedded-opentype'),
         url('/images/myriad.woff') format('woff'),
         url('/images/myriad.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; 
}

/* --------------------------------------------------------------------------
   3. RESET Y NORMALIZACIÓN
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   4. ESTILOS GLOBALES Y FONDO INTEGRADO (Degradado + Trama)
   -------------------------------------------------------------------------- */
html, body {
    font-family: 'Myriad', Arial, Helvetica, sans-serif;
    font-size: 14px; 
    line-height: 1.5;
    color: var(--text-dark);
    width: 100%;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 100vh;

    background: 
        url('/images/bg-body.jpg') no-repeat right top,
        linear-gradient(
            135deg, 
            var(--pantone-286c) 0%, 
            var(--pantone-286c) 8%, 
            var(--pantone-278c) 75%, 
            #ffffff 88%, 
            var(--pantone-382c) 100%
        );
    background-attachment: fixed;
    background-size: 60% auto, cover;
    background-blend-mode: multiply, normal;
}

/* --------------------------------------------------------------------------
   5. ENCABEZADO Y BANNER DE LOGIN
   -------------------------------------------------------------------------- */
.header-login { 
    width: 100%;
    padding: 20px 10%; 
}

.login-banner { 
    width: 90%;
    max-width: 950px;
    background: rgba(255, 255, 255, 0.788);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 40px 50px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: var(--shadow-soft);
    border-left: 6px solid var(--pantone-382c);
    margin: auto 0;
}

.login-banner img {
    width: 340px;
    max-width: 100%;
    height: auto;
    display: block;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   6. FORMULARIO DE INGRESO
   -------------------------------------------------------------------------- */
.login-form { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    width: 320px; 
}

.form-group { 
    display: flex; 
    flex-direction: column;
    gap: 6px; 
}

.form-group label { 
    font-weight: 600; 
    font-size: 1.15em; 
    color: #000000b0;
    text-shadow: 1px 1px 2px var(--text-light);
}

.form-group input { 
    padding: 10px 12px; 
    width: 100%; 
    border: 1.5px solid #d1d5db; 
    border-radius: 4px; 
    color: #000000b0;
    background-color: #f9fafb;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    border-color: var(--pantone-286c);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.15);
}

.btn-ingresar { 
    background-color: var(--action-green); 
    color: #111111;
    border: none; 
    padding: 12px; 
    font-weight: bold; 
    font-size: 1.15em;
    text-shadow: 1px 1px 2px var(--text-light);
    cursor: pointer; 
    width: 100%; 
    margin-top: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 10px rgba(196, 214, 0, 0.3);
}

.btn-ingresar:hover { 
    background-color: var(--action-green-hover); 
}

.btn-ingresar:active {
    transform: translateY(1px);
}

.btn-ingresar:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.msg-error { 
    color: #dc2626; 
    font-size: 0.9em; 
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    text-align: center;
    border-radius: 4px;
    display: none; 
    width: 100%;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   7. ESTRUCTURA DEL PANEL PRINCIPAL Y MENÚ DE NAVEGACIÓN (PRINCIPAL.PHP)
   -------------------------------------------------------------------------- */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.app-header {
    background: #ffffff;
    border-bottom: 1px solid #d1d5db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 50px;
}

/* Menú Principal Horizontal */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 15px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    color: var(--pantone-286c);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(0, 51, 160, 0.08);
    color: var(--pantone-286c);
}

/* Submenús Desplegables */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    list-style: none;
    padding: 5px 0;
    z-index: 1100;
    border: 1px solid #e5e7eb;
}

.nav-item:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 8px 15px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu li a:hover {
    background-color: var(--pantone-286c);
    color: #ffffff;
}

/* Botón Hamburguesa para Móviles (Oculto por defecto en escritorio) */
.menu-toggle {
    display: none;
    background: #ffffff;
    border: 2px solid var(--action-green);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.menu-toggle span {
    font-size: 1.2em;
    color: var(--action-green);
}

/* Área de Trabajo Central (Donde cargará cada página) */
.app-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   8. PIE DE PÁGINA (COPYRIGHT)
   -------------------------------------------------------------------------- */
.footer-login { 
    width: 100%;
    padding: 30px 10%; 
    font-size: 1.2em; 
    color: rgba(255, 255, 255, 0.9); 
    line-height: 1.5;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* --------------------------------------------------------------------------
   9. ADAPTABILIDAD RESPONSIVA (MÓVILES Y TABLETS)
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
    body {
        background-size: 60% auto, cover;
    }

    .login-banner {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 30px 20px;
        gap: 25px;
        width: 92%;
    }

    .login-banner img {
        max-width: 200px;
        margin: 0 auto;
    }

    .login-form {
        width: 100%;
        max-width: 360px;
    }

    .form-group {
        text-align: left;
    }

    /* Comportamiento del Menú Móvil tipo Cuadro Desplegable */
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.15);
        border-bottom: 2px solid var(--pantone-286c);
        gap: 5px;
    }

    /* Clase condicional de despliegue controlado por JS (ej. .nav-menu.active) */
    .nav-menu.active {
        display: flex;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 15px;
        background: #f9fafb;
    }
}

@media (max-width: 480px) {
    .header-login {
        padding: 10px 5%;
    }

    .login-banner {
        padding: 25px 16px;
        border-radius: 8px;
    }

    .form-group input,
    .btn-ingresar {
        padding: 12px;
        font-size: 1em;
    }

    .footer-login {
        padding: 20px 5%;
        font-size: 0.78em;
    }
}