/* ============================================
   PÁGINA DE MÓDULOS - ESTILOS EXCLUSIVOS
   Rediseño total con mapa visual por categorías
============================================ */

.modules-page {
    --modules-ink: var(--primary-color);
    --modules-soft: var(--text-dark);
    --modules-line: rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.modules-page h1,
.modules-page h2,
.modules-page h3,
.modules-page h4,
.modules-kicker,
.module-stack-kicker,
.modules-panel-label {
    font-family: var(--font-main);
}

.btn-outline-dark {
    background: transparent;
    color: var(--modules-ink);
    border-color: rgba(15, 23, 42, 0.14);
}

.btn-outline-dark:hover {
    background: var(--modules-ink);
    color: var(--white);
    border-color: var(--modules-ink);
    transform: translateY(-2px);
}

.modules-kicker,
.module-stack-kicker,
.modules-panel-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.modules-kicker {
    color: var(--accent-color);
}

.modules-map {
    padding: 138px 0 96px;
}

.modules-map-header {
    max-width: 760px;
    margin-bottom: 28px;
}

.modules-map-header h2 {
    margin: 14px 0 16px;
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    line-height: 1.02;
    color: var(--modules-ink);
}

.modules-map-header p {
    color: var(--modules-soft);
    font-size: 1.02rem;
}

.module-stack {
    --stack-accent: var(--accent-color);
    --stack-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    --stack-accent-soft: rgba(59, 130, 246, 0.12);
    --stack-border-soft: rgba(59, 130, 246, 0.18);
    display: grid;
    grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
    gap: 24px;
    padding: 26px;
    margin-bottom: 22px;
    border-radius: 32px;
    background: var(--stack-bg);
    border: 1px solid var(--modules-line);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    scroll-margin-top: 160px;
}

.module-stack--commercial {
    --stack-accent: #334155;
    --stack-bg: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
    --stack-accent-soft: rgba(51, 65, 85, 0.08);
    --stack-border-soft: rgba(51, 65, 85, 0.14);
}

.module-stack--finance {
    --stack-accent: #0f766e;
    --stack-bg: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
    --stack-accent-soft: rgba(15, 118, 110, 0.08);
    --stack-border-soft: rgba(15, 118, 110, 0.16);
}

.module-stack--advanced {
    --stack-accent: #475569;
    --stack-bg: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
    --stack-accent-soft: rgba(71, 85, 105, 0.08);
    --stack-border-soft: rgba(71, 85, 105, 0.14);
}

.module-stack--talent {
    --stack-accent: #1e40af;
    --stack-bg: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
    --stack-accent-soft: rgba(30, 64, 175, 0.08);
    --stack-border-soft: rgba(30, 64, 175, 0.16);
}

.module-stack--compliance {
    --stack-accent: #0f172a;
    --stack-bg: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
    --stack-accent-soft: rgba(15, 23, 42, 0.08);
    --stack-border-soft: rgba(15, 23, 42, 0.14);
}

.module-stack-aside {
    position: relative;
    padding: 4px 8px 8px 4px;
}

.module-stack-kicker {
    color: var(--stack-accent);
}

.module-stack-aside h3 {
    margin: 12px 0 14px;
    font-size: 1.8rem;
    line-height: 1.05;
    color: var(--modules-ink);
}

.module-stack-aside p {
    color: var(--modules-soft);
}

.module-stack-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.module-stack-grid--single {
    grid-template-columns: 1fr;
}

.module-tile {
    position: relative;
    min-height: 178px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--modules-line);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.module-tile:hover {
    transform: translateY(-4px);
    border-color: var(--stack-border-soft);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.module-tile--feature {
    min-height: 200px;
}

.module-tile-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 17px;
    background: var(--stack-accent-soft);
}

.module-tile-icon i {
    width: 26px;
    height: 26px;
    color: var(--stack-accent);
    stroke-width: 2.3;
}

.module-tile h4 {
    margin-bottom: 10px;
    font-size: 1.24rem;
    line-height: 1.1;
    color: var(--modules-ink);
}

.module-tile p {
    color: var(--modules-soft);
    font-size: 0.96rem;
}

.modules-anchor {
    position: absolute;
    top: -150px;
}

@media (max-width: 1180px) {
    .module-stack {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .module-stack {
        padding: 22px;
        border-radius: 26px;
    }

    .module-stack-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .modules-map {
        padding-top: 124px;
    }

    .modules-map-header h2,
    .module-stack-aside h3 {
        font-size: 1.7rem;
    }

    .module-tile {
        min-height: auto;
    }
}

/* ============================================
   ESTILOS ANTIGUOS (Mantenidos para compatibilidad)
============================================ */

/* --- Secciones de Módulos --- */
.modulo-section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

/* Primera sección necesita espacio adicional para el navbar fijo */
.modulo-section:first-of-type {
    padding-top: 180px;
}

.modulo-section--alt {
    background-color: var(--bg-light);
}

/* --- Header del Módulo con Icono a la Izquierda --- */
.modulo-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.modulo-icon-left {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
    transition: var(--transition);
}

.modulo-icon-left:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}

.modulo-icon-left i {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
    color: var(--accent-color);
}

.modulo-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

.modulo-intro {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 50px;
    line-height: 1.6;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Grid de Cards de Submódulos --- */
.modulo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.modulo-card {
    background: var(--white);
    padding: 35px 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modulo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
    border-color: var(--accent-color);
}

.modulo-card h3 {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
}

.modulo-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modulo-card li {
    padding: 10px 0 10px 25px;
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}

.modulo-card li:last-child {
    border-bottom: none;
}

.modulo-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.modulo-card li:hover {
    padding-left: 30px;
    color: var(--accent-color);
}

/* --- CTA Section --- */
.cta-section {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 20px;
    font-weight: 700;
}

.cta-content p {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 40px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .modulo-section {
        padding: 60px 0;
    }

    .modulo-layout {
        flex-direction: column;
        gap: 50px;
        min-height: auto;
        text-align: center;
    }

    .modulo-layout--reverse {
        flex-direction: column;
    }

    .modulo-content {
        max-width: 100%;
    }

    .modulo-content h2 {
        font-size: 2.2rem;
    }

    .modulo-intro {
        font-size: 1.05rem;
    }

    .feature-item {
        text-align: left;
    }

    .icon-container {
        width: 220px;
        height: 220px;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-content p {
        font-size: 1.05rem;
    }
}

@media (max-width: 600px) {
    .modulo-content h2 {
        font-size: 1.8rem;
    }

    .icon-container {
        width: 180px;
        height: 180px;
    }

    .modulo-features {
        gap: 20px;
    }

    .cta-section {
        padding: 60px 0;
    }
}
