/* ==========================================================================
   Estilos Principales del Portal RNI - Diseño Institucional SSO
   ========================================================================== */

:root {
    /* Paleta Corporativa Principal */
    --color-primary: #1e3a8a; /* Azul marino institucional */
    --color-secondary: #e3001b; /* Rojo institucional */
    
    /* Colores Específicos de Tarjetas */
    --card-influenza: #2563eb; /* Azul */
    --card-covid: #f43f5e;     /* Coral / Rojo */
    --card-vrs: #8b5cf6;       /* Violeta */
    --card-programaticas: #10b981; /* Verde */
    --card-vph: #d946ef;       /* Magenta */

    /* Fondos y Textos */
    --bg-main: #ffffff;
    --bg-accent-blue: rgba(30, 58, 138, 0.03);
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    
    /* Header SSO */
    --sso-header-bg: #0b1f40; /* Color azul institucional oscuro */
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ==========================================================================
   Header Institucional (Emulando SS Osorno)
   ========================================================================== */
.header-sso {
    background: var(--sso-header-bg);
    height: 56px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 999;
}

.header-sso::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #11579b 50%, #e63d3f 50%);
    z-index: 1000;
}

.header-sso .logo h1 {
    font-size: 20px;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-link-sso {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
    text-decoration: none;
}

.nav-link-sso:hover {
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Contenido Principal y Decoraciones de Fondo
   ========================================================================== */
.main-content {
    flex: 1;
    padding-top: 70px;
    padding-bottom: 40px;
    position: relative;
    overflow: hidden;
    background: var(--bg-main);
    background: radial-gradient(circle at 0% 0%, #eaf4ff 0%, transparent 40%),
                radial-gradient(circle at 100% 100%, #eaf4ff 0%, transparent 50%);
}

.portal-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* --- Elementos Decorativos --- */
.decorative-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}



/* Silueta Chile */
.deco-chile {
    position: absolute;
    top: 0;
    left: 0;
    width: 350px;
    height: 100%;
    background-image: url('mapa_chile.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    pointer-events: none;
    mix-blend-mode: darken;
    opacity: 0.40;
    z-index: 0;
}

/* Escudo de Chile (Espejado al mapa) */
.deco-escudo-chile {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background-image: url('Escudo_chile.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right center;
    pointer-events: none;
    mix-blend-mode: darken;
    opacity: 0.20;
    z-index: 0;
}


/* Ola inferior */
.bg-wave-bottom {
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
}
.bg-wave-bottom svg {
    display: block;
    width: 100%;
    height: 70px;
}

/* Breadcrumb */
.portal-breadcrumb {
    font-size: 12px;
    color: var(--color-primary);
    margin-bottom: 30px;
    font-weight: 500;
}
.portal-breadcrumb i {
    margin-right: 5px;
}

/* Escudo Top */
@keyframes floatUpDown {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

.top-shield-icon {
    width: 68px;
    height: 68px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04), inset 0 0 0 3px #f0f4ff;
    border: 1px solid #e2e8f0;
    font-size: 30px;
    color: var(--color-primary);
    animation: floatUpDown 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.top-shield-icon i {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.top-shield-icon:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.06), inset 0 0 0 4px #e0e7ff;
    border-color: #cbd5e1;
}

.top-shield-icon:hover i {
    transform: scale(1.15) rotate(-5deg);
}

.top-shield-icon:active i {
    transform: scale(0.9);
    transition: transform 0.1s ease;
}

/* Títulos */
.portal-pre-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.portal-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.portal-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 6px;
    line-height: 1.2;
}

.title-highlight {
    color: #2563eb;
}

.title-divider {
    width: 60px;
    height: 4px;
    margin: 0 auto;
    background: linear-gradient(90deg, var(--color-primary) 50%, var(--color-secondary) 50%);
}

.portal-description {
    font-size: 14px;
    color: #64748b;
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================================================
   Grid de Tarjetas
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 40px;
}

/* Diseño de la Tarjeta */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.campaign-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 20px;
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: all 0.25s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.campaign-card:hover {
    text-decoration: none;
    color: var(--text-dark);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
}

.campaign-card:hover .card-content h3 {
    transform: scale(1.04);
}

.campaign-card:active {
    transform: translateY(4px) scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Icono de fondo decorativo */
.card-bg-icon {
    position: absolute;
    top: 50%;
    right: -10px;
    left: auto;
    transform: translateY(-50%);
    font-size: 120px;
    opacity: 0.05;
    z-index: 0;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.campaign-card:hover .card-bg-icon {
    transform: translateY(-50%) scale(1.1);
}

/* Asignación de colores por campaña */
.card-influenza { border-color: #bfdbfe; background: linear-gradient(135deg, #ffffff 0%, #f4f7ff 100%); animation-delay: 0.1s; }
.card-influenza:hover { border-color: var(--card-influenza); }
.card-influenza .card-icon-wrapper { background: var(--card-influenza); color: #fff; }
.card-influenza .card-action { background: var(--card-influenza); color: #fff; }

.card-covid { border-color: #fecdd3; background-color: #fffcfc; animation-delay: 0.2s; }
.card-covid:hover { border-color: var(--card-covid); }
.card-covid .card-icon-wrapper { background: var(--card-covid); color: #fff; }
.card-covid .card-action { background: var(--card-covid); color: #fff; }

.card-vrs { border-color: #ddd6fe; background-color: #fcfaff; animation-delay: 0.3s; }
.card-vrs:hover { border-color: var(--card-vrs); }
.card-vrs .card-icon-wrapper { background: var(--card-vrs); color: #fff; }
.card-vrs .card-action { background: var(--card-vrs); color: #fff; }

.card-programaticas { border-color: #bbf7d0; background-color: #f6fdf9; animation-delay: 0.4s; }
.card-programaticas:hover { border-color: var(--card-programaticas); }
.card-programaticas .card-icon-wrapper { background: var(--card-programaticas); color: #fff; }
.card-programaticas .card-action { background: var(--card-programaticas); color: #fff; }

.card-vph { border-color: #fbcfe8; background-color: #fdf2f8; animation-delay: 0.5s; }
.card-vph:hover { border-color: var(--card-vph); }
.card-vph .card-icon-wrapper { background: var(--card-vph); color: #fff; }
.card-vph .card-action { background: var(--card-vph); color: #fff; }

/* Íconos e interior de la tarjeta */
.card-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
    z-index: 1;
}

.card-content {
    flex: 1;
    z-index: 1;
}

.card-content h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-primary);
    transition: transform 0.25s ease, color 0.25s ease;
    transform-origin: left center;
}

.card-programaticas .card-content h3 {
    font-size: 14px;
    letter-spacing: -0.3px;
}

.card-content p {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

/* Botón flecha inferior */
.card-action {
    position: absolute;
    bottom: 25px;
    right: 25px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.25s ease;
    z-index: 1;
}

.campaign-card:hover .card-action {
    transform: scale(1.05) translateX(4px);
}

/* ==========================================================================
   Barra de Información Inferior
   ========================================================================== */
.info-bar {
    display: flex;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    text-align: left;
    flex: 1;
    padding: 10px 15px;
    border-right: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 8px;
    transition: all 0.25s ease;
}

a.info-item:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

a.info-item:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.info-item:last-child {
    border-right: none;
}

.info-item i {
    font-size: 18px;
    color: #2563eb;
    margin-right: 12px;
    background: #eff6ff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-item h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.info-item p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    line-height: 1.3;
}

/* ==========================================================================
   Footer Institucional
   ========================================================================== */
.footer-sso {
    background: #111111;
    color: #ffffff;
    padding: 15px 0;
    position: relative;
    z-index: 10;
}

/* ==========================================================================
   Responsividad (Media Queries)
   ========================================================================== */

/* Tablet Horizontal / Pantallas pequeñas */
@media (max-width: 1100px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet */
@media (max-width: 992px) {
    .info-bar {
        flex-wrap: wrap;
    }
    .info-item {
        flex: 0 0 50%;
        margin-bottom: 20px;
        border-right: none;
    }
}

/* Móvil */
@media (max-width: 768px) {
    .portal-title {
        font-size: 28px;
        word-break: break-word;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .info-item {
        flex: 0 0 100%;
    }
    
    .header-sso {
        position: relative;
    }
    
    .main-content {
        padding-top: 40px;
    }
    
    .deco-medical, .deco-chile, .deco-escudo-chile {
        display: none !important;
    }
}

/* ==========================================================================
   Accesibilidad Global
   ========================================================================== */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* 🛸 NUEVOS ESTILOS GLOBAL NAV BAR DEIS 🛸 */
.global-nav-bar {
    background: #0b1f40 !important; /* Azul oscuro institucional DEIS */
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    height: 56px;
    padding: 0 max(24px, calc((100% - 1400px) / 2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 9999;
    font-family: var(--font, 'Inter', sans-serif);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.global-nav-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #11579b 50%, #e63d3f 50%);
    z-index: 10000;
}

.global-nav-left { flex: 1; display: flex; justify-content: flex-start; }
.global-nav-center { 
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    justify-content: center; 
}
.global-nav-right { flex: 1; display: flex; justify-content: flex-end; position: relative; }

.btn-portal-rni {
    background: transparent;
    color: #f8fafc;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid transparent;
    background-image: linear-gradient(#0b1f40, #0b1f40), linear-gradient(to right, #3b82f6, #ef4444);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: all 0.2s;
}

.btn-portal-rni:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    color: #ffffff;
}

.global-nav-dropdown-btn {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.global-nav-dropdown-btn:hover {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.4);
}

.global-nav-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: #ffffff;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: 1px solid rgba(0,0,0,0.05);
}

/* Puente invisible para evitar que el hover se pierda en el gap de 5px */
.global-nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

.global-nav-right:hover .global-nav-dropdown-content {
    display: block;
}

.global-nav-dropdown-content a {
    color: #334155;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

.global-nav-dropdown-content a:hover {
    background: #f1f5f9;
}

.global-nav-dropdown-content a.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-left: 3px solid #3b82f6;
}

@media (max-width: 768px) {
    .global-nav-center { display: none !important; }
}
/* FIN NUEVOS ESTILOS GLOBAL NAV BAR DEIS */
