:root {
    --primary-purple: #3b1443;
    --secondary-blue: #0284c7;
    --accent-green: #10b981;
    --dark-neutral: #1e293b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark-neutral);
    line-height: 1.6;
    padding-top: 135px;
}

/* =========================================
   BARRA SUPERIOR INSTITUCIONAL
   ========================================= */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #200a26;
    color: #cbd5e1;
    font-size: 0.75rem;
    padding: 6px 15px;
    z-index: 1001;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.top-bar-info {
    display: flex;
    gap: 15px;
}

/* =========================================
   HEADER FIJO Y NAVEGACIÓN
   ========================================= */
header {
    position: fixed;
    top: 28px;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-container a.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
}

.nav-container img {
    height: 34px;
    width: auto;
}

.logo-text {
    color: var(--primary-purple);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 18px;
}

nav a {
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

nav a:hover, nav a.active {
    color: var(--secondary-blue);
}

.btn-portal {
    background-color: var(--primary-purple);
    color: var(--white) !important;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.btn-portal:hover {
    background-color: #2b0f32;
}

/* =========================================
   HERO LLAMATIVO CON FONDO FOTOGRÁFICO
   ========================================= */
.hero {
    background: linear-gradient(135deg, rgba(59, 20, 67, 0.92) 0%, rgba(32, 10, 38, 0.95) 100%), 
                url('https://images.unsplash.com/photo-1556742049-0a67d553c2a5?auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 70px 20px 50px 20px;
    text-align: center;
    position: relative;
    box-shadow: inset 0 -20px 30px rgba(0,0,0,0.15);
}

.hero-content {
    max-width: 850px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #6ee7b7;
}

.hero h1 {
    font-size: 2.3rem;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.05rem;
    margin-bottom: 30px;
    color: #e2e8f0;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 35px;
}

.btn-primary, .btn-secondary {
    padding: 12px 26px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent-green);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background-color: #0e9f6e;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Mini beneficios flotantes integrados en el Hero */
.hero-perks {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    flex-wrap: wrap;
}

.perk-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #f1f5f9;
    font-weight: 500;
}

.perk-icon {
    background-color: var(--accent-green);
    color: var(--white);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Franja de Indicadores */
.stats-strip {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 25px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.stats-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
}

.stat-item h4 {
    color: var(--primary-purple);
    font-size: 1.6rem;
    font-weight: 800;
}

.stat-item p {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

/* =========================================
   CONTENEDORES Y PILARES CON IMÁGENES
   ========================================= */
.container, .features-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.section-title-main {
    text-align: center;
    color: var(--primary-purple);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.section-subtitle-main {
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.features-grid, .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.feature-box, .product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.feature-box:hover, .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(59, 20, 67, 0.08);
}

/* Contenedor de Imagen superior en las tarjetas */
.feature-img-container {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}

.feature-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.feature-box:hover .feature-img-container img {
    transform: scale(1.05);
}

.feature-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.feature-box h3 {
    color: var(--primary-purple);
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.feature-box p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =========================================
   SIMULADOR DE CRÉDITO
   ========================================= */
.simulator-box {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: center;
    margin-top: 20px;
}

.sim-form .form-group {
    margin-bottom: 15px;
}

.sim-form label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark-neutral);
    margin-bottom: 6px;
}

.sim-form input, .sim-form select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: var(--light-bg);
}

.sim-result {
    background: linear-gradient(135deg, #f3e8ff 0%, #e0f2fe 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #d8b4fe;
}

.sim-result .cuota-valor {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-purple);
    margin: 10px 0;
}

/* =========================================
   MODAL
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 400px;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.modal-btn {
    background-color: var(--primary-purple);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
}

/* =========================================
   ESTILOS PARA GOBIERNO CORPORATIVO
   ========================================= */
.gov-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
}

.gov-header h1 {
    color: var(--primary-purple);
    font-size: 2.2rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.gov-header p {
    color: #64748b;
    font-size: 1rem;
}

/* Estructura del Organigrama */
.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 50px;
}

.org-level {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
}

.org-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.org-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 20, 67, 0.08);
}

.org-card.principal {
    border-top: 5px solid var(--primary-purple);
    max-width: 450px;
    width: 100%;
}

.org-card.directiva {
    border-top: 5px solid var(--secondary-blue);
    max-width: 550px;
    width: 100%;
}

.org-level.level-3 .org-card {
    flex: 1;
    min-width: 280px;
    max-width: 360px;
    border-top: 5px solid var(--accent-green);
}

.org-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.org-card h3 {
    color: var(--primary-purple);
    font-size: 1.15rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.org-card p {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Línea conectora visual entre niveles */
.org-connector {
    width: 2px;
    height: 25px;
    background-color: #cbd5e1;
}

/* Sección de Principios Éticos */
.ethics-section {
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
}

.section-title {
    color: var(--primary-purple);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
}

.ethics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ethic-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.ethic-card h4 {
    color: var(--primary-purple);
    font-size: 1.05rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.ethic-card p {
    color: #64748b;
    font-size: 0.88rem;
}

/* =========================================
   ESTILOS PARA TARJETAS DE PRODUCTOS
   ========================================= */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px;
}

.product-tag {
    display: inline-block;
    background-color: #f3e8ff;
    color: var(--primary-purple);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.product-card h3 {
    color: var(--primary-purple);
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.product-card > p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.product-features {
    list-style: none;
    margin-bottom: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.product-features li {
    font-size: 0.88rem;
    color: #475569;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-features li span {
    color: var(--accent-green);
    font-weight: bold;
}

/* =========================================
   ESTILOS PARA SECCIONES INDEPENDIENTES DE PRODUCTOS
   ========================================= */
.detalle-seccion {
    margin-top: 70px;
    border-top: 2px dashed var(--border-color);
    padding-top: 40px;
}

.detalle-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 25px auto;
}

.detalle-badge {
    display: inline-block;
    background-color: #f3e8ff;
    color: var(--primary-purple);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.detalle-header h2 {
    color: var(--primary-purple);
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.detalle-header p {
    color: #64748b;
    font-size: 0.92rem;
}

.detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.detalle-info ul {
    list-style: none;
    margin-top: 10px;
}

.detalle-info ul li {
    font-size: 0.88rem;
    color: #475569;
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.detalle-info ul li::before {
    content: "•";
    color: var(--primary-purple);
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: -2px;
}

.detalle-form-box {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.detalle-form-box h4, .detalle-info h4 {
    color: var(--primary-purple);
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.regional-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.regional-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-green);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.regional-card h4 {
    color: var(--primary-purple);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.regional-card p {
    color: #64748b;
    font-size: 0.88rem;
}

/* =========================================
   ADAPTABILIDAD MÓVIL OPTIMIZADA (< 850px)
   ========================================= */
@media (max-width: 850px) {
    body {
        padding-top: 110px;
    }

    .top-bar {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .top-bar-info {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    header {
        top: 45px;
    }

    .nav-container {
        flex-direction: column;
        gap: 12px;
        padding: 10px 15px;
    }

    nav ul {
        gap: 8px 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        font-size: 0.85rem;
        padding: 4px 8px;
    }

    .btn-portal {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    .hero {
        padding: 40px 15px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.92rem;
    }

    .hero-perks {
        gap: 12px;
        margin-top: 20px;
        padding-top: 15px;
    }

    .perk-item {
        font-size: 0.82rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .simulator-box {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .detalle-grid {
        grid-template-columns: 1fr;
    }

    /* --- OPTIMIZACIÓN DEL ORGANIGRAMA EN MÓVIL --- */
    .org-chart {
        gap: 8px;
        padding: 0 10px;
    }

    .org-level {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .org-card {
        width: 100%;
        max-width: 100% !important;
        padding: 16px;
        text-align: left;
        display: flex;
        align-items: flex-start;
        gap: 12px;
        border-top: 1px solid var(--border-color) !important;
        border-left: 4px solid var(--primary-purple) !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    }

    .org-card.principal {
        border-left-color: var(--primary-purple) !important;
        background: linear-gradient(135deg, #fdf8ff 0%, #ffffff 100%);
    }

    .org-card.directiva {
        border-left-color: var(--secondary-blue) !important;
    }

    .org-level.level-3 .org-card {
        border-left-color: var(--accent-green) !important;
    }

    .org-icon {
        font-size: 1.5rem;
        margin-bottom: 0;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .org-card div {
        flex-grow: 1;
    }

    .org-card h3 {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .org-card p {
        font-size: 0.82rem;
    }

    .org-connector {
        width: 2px;
        height: 16px;
        background-color: var(--primary-purple);
        opacity: 0.4;
        margin: 2px 0;
    }
}

.hero {
    background: linear-gradient(135deg, rgba(59, 20, 67, 0.82) 0%, rgba(32, 10, 38, 0.88) 100%), 
                url('https://images.unsplash.com/photo-1551836022-d5d88e9218df?auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--white);
    padding: 75px 20px 55px 20px;
    text-align: center;
    position: relative;
    box-shadow: inset 0 -30px 40px rgba(0, 0, 0, 0.2);
}

/* Encabezado estándar para páginas internas (Créditos, Nosotros, Transparencia) */
.page-header {
    background: linear-gradient(135deg, rgba(59, 20, 67, 0.95) 0%, rgba(32, 10, 38, 0.98) 100%);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--white);
}

.page-header p {
    font-size: 0.95rem;
    color: #e2e8f0;
    max-width: 700px;
    margin: 0 auto;
}

/* Mejora para el menú responsivo en móviles para que no se amontone */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    header nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    header nav ul li a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}