﻿/* ========================================
   DEA Consulting - MASTER CSS FINAL
   Versión moderna, elegante y corporativa
   Archivo: Stilo_Master.css
   ======================================== */

/* ============ VARIABLES GLOBALES ============ */
:root {
    --navy: #081C33;
    --navy-dark: #061625;
    --navy-light: #0E2A47;
    --navy-soft: #16385b;
    --primary: #2FA4D9;
    --primary-light: #5BC0EB;
    --primary-soft: rgba(47, 164, 217, 0.10);
    --gold: #b08d57;
    --gold-light: #c9a97a;
    --gold-hover: #9a7a4a;
    --gold-soft: rgba(176, 141, 87, 0.10);
    --muted: #64748b;
    --muted-light: #94a3b8;
    --line: rgba(8, 28, 51, 0.08);
    --bg: #f4f8fc;
    --card: #ffffff;
    --error: #dc2626;
    --success: #16a34a;
    --header-bg-start: rgba(255, 255, 255, 0.96);
    --header-bg-end: rgba(248, 251, 255, 0.92);
    --header-border: rgba(8, 28, 51, 0.08);
    --footer-bg-start: #0A1D34;
    --footer-bg-end: #061321;
    --footer-text: #e2e8f0;
    --footer-text-muted: #94a3b8;
    --footer-link: #d7e3f1;
    --footer-border: rgba(47, 164, 217, 0.14);
    --shadow-sm: 0 6px 18px rgba(8, 28, 51, 0.06);
    --shadow: 0 14px 38px rgba(8, 28, 51, 0.10);
    --shadow-hover: 0 22px 54px rgba(8, 28, 51, 0.16);
    --shadow-primary: 0 12px 30px rgba(47, 164, 217, 0.22);
    --shadow-gold: 0 8px 24px rgba(176, 141, 87, 0.22);
    --radius: 18px;
    --radius-sm: 12px;
    --radius-pill: 999px;
    --border: 1px solid rgba(8, 28, 51, 0.08);
    --border-soft: 1px solid rgba(47, 164, 217, 0.14);
    --border-gold: 1px solid rgba(176, 141, 87, 0.24);
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --font-size-base: 14px;
    --font-size-sm: 12px;
    --font-size-lg: 16px;
}

/* ============ RESET Y BASE ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(circle at top left, rgba(91, 192, 235, 0.08), transparent 24%), linear-gradient(180deg, #f4f8fc 0%, #eef3f9 100%);
    color: var(--navy);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Enlaces globales */
a {
    color: var(--navy);
    text-decoration: none;
    transition: var(--transition);
}

    a:hover {
        color: var(--primary);
    }

/* Imágenes */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============ CONTENEDOR PRINCIPAL ============ */
.shell {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

/* ============ HEADER ============ */
.header {
    background: linear-gradient(180deg, var(--header-bg-start) 0%, var(--header-bg-end) 100%);
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 20px rgba(8, 28, 51, 0.05);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

/* Brand / Logo */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex: 0 0 auto;
    padding: 4px 0;
    transition: var(--transition);
}

    .brand:hover {
        transform: translateX(2px);
    }

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: contain;
    background: linear-gradient(180deg, #ffffff 0%, #f3f8fd 100%);
    border: 1px solid rgba(47, 164, 217, 0.12);
    padding: 6px;
    box-shadow: var(--shadow-sm);
}

.brand-text {
    line-height: 1.2;
}

.brand-name {
    font-weight: 900;
    font-size: 15px;
    color: var(--navy);
    letter-spacing: -0.3px;
}

.brand-tag {
    font-size: 11px;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Toggle Móvil */
.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: var(--border-soft);
    background: linear-gradient(180deg, #ffffff 0%, #f5fafe 100%);
    cursor: pointer;
    flex: 0 0 auto;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
}

    .menu-toggle:hover {
        background: rgba(47, 164, 217, 0.08);
        border-color: rgba(47, 164, 217, 0.24);
    }

    .menu-toggle:active {
        transform: scale(0.98);
    }

    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--navy);
        margin: 5px auto;
        border-radius: 2px;
        transition: var(--transition);
    }

/* Animación del toggle a X */
body.nav-open .menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

body.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.nav-open .menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============ NAVEGACIÓN - ESCRITORIO ============ */
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Links de navegación */
.nav-link {
    position: relative;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    color: var(--navy) !important;
    text-decoration: none !important;
    transition: var(--transition);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.1px;
}

    .nav-link::after {
        content: '';
        position: absolute;
        left: 16px;
        right: 16px;
        bottom: 6px;
        height: 2px;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
        transform: scaleX(0);
        transform-origin: center;
        transition: var(--transition);
        opacity: 0.95;
    }

    .nav-link:hover {
        background: rgba(47, 164, 217, 0.08);
        border-color: rgba(47, 164, 217, 0.12);
        color: var(--navy) !important;
    }

        .nav-link:hover::after {
            transform: scaleX(1);
        }

    .nav-link.active {
        background: rgba(47, 164, 217, 0.10);
        border-color: rgba(47, 164, 217, 0.18);
        color: var(--navy) !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.60);
    }

        .nav-link.active::after {
            transform: scaleX(1);
        }

/* Separador para admin */
.nav-sep {
    width: 1px;
    height: 24px;
    background: rgba(8, 28, 51, 0.10);
    margin: 0 6px;
}

/* CTA principal */
.nav-cta {
    position: relative;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--primary) 100%);
    border: 1px solid rgba(47, 164, 217, 0.16);
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none !important;
    transition: var(--transition);
    box-shadow: var(--shadow-primary);
    margin-left: 6px;
}

    .nav-cta:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 36px rgba(47, 164, 217, 0.28);
        background: linear-gradient(135deg, var(--navy) 0%, var(--primary-light) 100%);
    }

    .nav-cta:active {
        transform: translateY(0);
    }

/* Botón Login */
.nav-auth {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(8, 28, 51, 0.12);
    background: rgba(255,255,255,0.60);
    color: var(--navy) !important;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none !important;
    transition: var(--transition);
}

    .nav-auth:hover {
        background: rgba(47, 164, 217, 0.06);
        border-color: rgba(47, 164, 217, 0.20);
        color: var(--primary) !important;
    }

/* User Chip */
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(47, 164, 217, 0.16);
    background: linear-gradient(135deg, rgba(47,164,217,0.08) 0%, rgba(91,192,235,0.06) 100%);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--navy);
}

    .user-chip .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--success);
        box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

.user-chip .role {
    color: var(--primary);
    font-weight: 700;
    margin-left: 2px;
}

/* Botón Logout */
.nav-logout {
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(220, 38, 38, 0.24);
    background: rgba(220, 38, 38, 0.05);
    color: var(--error) !important;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
    display: inline-block;
}

    .nav-logout:hover {
        background: rgba(220, 38, 38, 0.10);
        border-color: rgba(220, 38, 38, 0.40);
    }

/* Links admin */
.nav-admin {
    font-size: 12px !important;
    opacity: 0.86;
}

    .nav-admin:hover {
        opacity: 1;
        background: rgba(8, 28, 51, 0.06) !important;
    }

/* ============ CONTENIDO PRINCIPAL ============ */
main {
    min-height: calc(100vh - 180px);
    padding: 28px 0 48px;
}

/* ============ FOOTER ============ */
.footer {
    background: linear-gradient(180deg, var(--footer-bg-start) 0%, var(--footer-bg-end) 100%);
    border-top: 1px solid var(--footer-border);
    color: var(--footer-text);
    position: relative;
    overflow: hidden;
}

    .footer::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at top left, rgba(91, 192, 235, 0.08), transparent 22%), radial-gradient(circle at top right, rgba(47, 164, 217, 0.06), transparent 18%);
        pointer-events: none;
    }

.footer-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 0;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-brand {
    font-weight: 900;
    color: #f8fbff;
    font-size: 14px;
    letter-spacing: -0.2px;
}

.footer-meta {
    color: var(--footer-text-muted);
    font-size: 12px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--footer-text-muted);
    font-size: 13px;
}

    .footer-right a {
        color: var(--footer-link);
        text-decoration: none;
        font-weight: 700;
        transition: var(--transition);
        padding: 7px 10px;
        border-radius: 10px;
    }

        .footer-right a:hover {
            color: var(--primary-light);
            background: rgba(47, 164, 217, 0.10);
        }

    .footer-right .sep {
        color: rgba(148, 163, 184, 0.38);
        font-weight: 400;
    }

/* ============ WHATSAPP FLOTANTE ============ */
.wa-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 25px rgba(22, 163, 74, 0.35);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .wa-float .wa-icon {
        font-size: 16px;
    }

    .wa-float:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 40px rgba(22, 163, 74, 0.45);
    }

    .wa-float:active {
        transform: translateY(-1px);
    }

/* ============ ACCESIBILIDAD ============ */
.nav-link:focus-visible,
.nav-cta:focus-visible,
.nav-auth:focus-visible,
.nav-logout:focus-visible,
.menu-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Evitar selección de texto en elementos UI */
.brand, .menu-toggle, .nav-link, .nav-cta, .nav-auth, .nav-logout, .user-chip {
    user-select: none;
    -webkit-user-select: none;
}

/* ============ UTILIDADES ============ */
a, a:visited, a:hover, a:active, a:focus {
    -webkit-tap-highlight-color: transparent;
}

/* Scrollbar personalizado para menú móvil */
.nav::-webkit-scrollbar {
    width: 6px;
}

.nav::-webkit-scrollbar-track {
    background: transparent;
}

.nav::-webkit-scrollbar-thumb {
    background: rgba(47, 164, 217, 0.35);
    border-radius: 3px;
}

    .nav::-webkit-scrollbar-thumb:hover {
        background: var(--primary);
    }

/* Animación de entrada para menú móvil */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ RESPONSIVE - MÓVIL ============ */
@media (max-width: 900px) {
    html {
        font-size: 10px;
    }

    .shell {
        width: min(100%, calc(100% - 8px));
        margin: 0 auto;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav {
        display: none;
        position: absolute;
        left: 12px;
        right: 12px;
        top: 68px;
        background: rgba(255,255,255,0.98);
        border: 1px solid rgba(47, 164, 217, 0.12);
        border-radius: var(--radius);
        padding: 10px;
        box-shadow: 0 24px 60px rgba(8, 28, 51, 0.16);
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: slideDown 0.2s ease-out;
        z-index: 999;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    body.nav-open .nav {
        display: flex;
    }

    .nav-link {
        display: flex;
        width: 100%;
        padding: 14px 16px;
        border-radius: var(--radius-sm);
        border: 1px solid transparent;
        background: #fff;
        text-align: left;
        font-size: 14px;
        justify-content: flex-start;
    }

        .nav-link:hover {
            background: rgba(47, 164, 217, 0.08);
            border-color: rgba(47, 164, 217, 0.16);
        }

        .nav-link.active {
            background: rgba(47, 164, 217, 0.10);
            border-color: rgba(47, 164, 217, 0.20);
        }

    .nav-cta,
    .nav-auth {
        width: 100%;
        border-radius: var(--radius-sm);
        padding: 14px 16px;
        text-align: center;
        font-size: 14px;
        margin: 4px 0;
        justify-content: center;
    }

    .user-chip,
    .nav-logout {
        width: 100%;
        justify-content: center;
        border-radius: var(--radius-sm);
        padding: 12px 16px;
        font-size: 13px;
        margin: 4px 0;
    }

    .nav-sep {
        display: none;
    }

    .footer {
        display: none;
    }

    .wa-float {
        right: 12px;
        bottom: 12px;
        padding: 10px 16px;
        font-size: 12px;
    }

        .wa-float .wa-text {
            display: none;
        }

        .wa-float .wa-icon {
            font-size: 18px;
        }
}

/* ============ EXTRA: MUY MÓVIL (< 400px) ============ */
@media (max-width: 400px) {
    .brand-name {
        font-size: 14px;
    }

    .brand-tag {
        font-size: 10px;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
    }

    .nav-cta,
    .nav-auth {
        font-size: 13px;
        padding: 12px 14px;
    }
}

/* ============ PRINT ============ */
@media print {
    .header, .footer, .wa-float, .menu-toggle {
        display: none !important;
    }

    main {
        padding: 0;
        min-height: auto;
    }

    body {
        background: #fff;
        color: #000;
    }
}
