/* =============================================================================
   LMS – MAM · PYMES
   Versión definitiva: sin @import, con variables locales y logo forzado por ID
   ============================================================================= */

/* --- Variables CSS (definidas localmente) --- */
:root {
    --mam-azul: #0038d1;
    --mam-bg-sec-2: #f8fafc;
    --mam-text-dark: #1a202c;
    --mam-text-light: #ffffff;
    --mam-text-muted: #4a5568;
    --mam-border: #e2e8f0;
    --mam-btn-primario: #0038d1;
    --mam-btn-primario-hover: #002a9e;
    --mam-blanco: #ffffff;
    --mam-shadow-md: 0 4px 6px rgba(0,0,0,0.05);
    --mam-transition-smooth: 0.2s ease;
    --mam-font-titulo: 'Cormorant Garamond', 'Times New Roman', serif;
    --mam-font-base: 'Inter', sans-serif;
    --mam-container-max-width: 1200px;
}

/* --- Layout general del LMS --- */
.mam-lms {
    background-color: var(--mam-bg-sec-2);
    color: var(--mam-text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

/* --- Cabecera y pie del LMS --- */
.lms-header,
.lms-footer {
    background-color: #051d2c;
    color: var(--mam-text-light);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.lms-footer {
    margin-top: auto;
    font-size: 0.85rem;
    opacity: 0.7;
}

.lms-brand a {
    color: var(--mam-text-light);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.lms-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.lms-nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--mam-transition-smooth);
}

.lms-nav-link:hover {
    color: var(--mam-text-light);
}

/* --- Logo --- */
#logo-mam {
    height: 36px !important;
    width: auto !important;
    max-height: none !important;
    max-width: none !important;
    display: block !important;
}

/* --- Contenido principal del LMS --- */
.lms-main {
    max-width: var(--mam-container-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 48px 20px;
    box-sizing: border-box;
}

/* --- Curso: página de índice --- */
.lms-curso-header {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--mam-border);
}

.lms-curso-titulo {
    font-family: var(--mam-font-titulo);
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--mam-azul);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.lms-curso-descripcion {
    font-family: var(--mam-font-base);
    font-size: 1.1rem;
    color: var(--mam-text-muted);
    max-width: 700px;
}

/* --- Lista de lecciones --- */
.lms-lecciones-titulo {
    font-family: var(--mam-font-base);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--mam-text-dark);
    margin-bottom: 24px;
}

.lms-lecciones-lista {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 12px;
}

.lms-leccion-item {
    border: 1px solid var(--mam-border);
    background: var(--mam-blanco);
    transition: var(--mam-transition-smooth);
}

.lms-leccion-item:hover {
    border-color: var(--mam-btn-primario);
}

.lms-leccion-enlace {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--mam-text-dark);
    gap: 16px;
}

.lms-leccion-numero {
    font-family: var(--mam-font-titulo);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mam-btn-primario);
    min-width: 40px;
}

.lms-leccion-titulo {
    font-family: var(--mam-font-base);
    font-weight: 500;
    font-size: 1rem;
    flex: 1;
}

.lms-leccion-check {
    color: #2ecc71;
    font-size: 1.2rem;
    font-weight: 700;
}

/* --- Lección: página individual --- */
.lms-leccion-detalle {
    background: var(--mam-blanco);
    border: 1px solid var(--mam-border);
    padding: 48px;
    box-shadow: var(--mam-shadow-md);
}

.lms-leccion-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mam-border);
}

.lms-leccion-titulo {
    font-family: var(--mam-font-titulo);
    font-weight: 700;
    font-size: 2rem;
    color: var(--mam-azul);
    margin-bottom: 8px;
}

.lms-leccion-meta {
    font-family: var(--mam-font-base);
    font-size: 0.9rem;
    color: var(--mam-text-muted);
}

.lms-leccion-contenido {
    font-family: var(--mam-font-base);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--mam-text-dark);
    margin-bottom: 40px;
}

.lms-leccion-acciones {
    margin-bottom: 32px;
}

.lms-btn {
    font-family: var(--mam-font-base);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    transition: var(--mam-transition-smooth);
}

.lms-btn-completar {
    background-color: var(--mam-btn-primario);
    color: var(--mam-text-light);
}

.lms-btn-completar:hover {
    background-color: var(--mam-btn-primario-hover);
}

.lms-completada-mensaje {
    font-family: var(--mam-font-base);
    color: #2ecc71;
    font-weight: 500;
    font-size: 0.95rem;
}

.lms-leccion-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--mam-border);
}

.lms-nav-anterior,
.lms-nav-siguiente {
    font-family: var(--mam-font-base);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--mam-btn-primario);
    text-decoration: none;
    transition: var(--mam-transition-smooth);
}

.lms-nav-anterior:hover,
.lms-nav-siguiente:hover {
    color: var(--mam-btn-primario-hover);
}

.lms-nav-vacio {
    visibility: hidden;
}

.lms-emision-aviso {
    background: rgba(0, 56, 209, 0.05);
    border: 1px solid var(--mam-btn-primario);
    padding: 16px;
    margin-top: 32px;
    font-family: var(--mam-font-base);
    font-size: 0.9rem;
    color: var(--mam-azul);
}

.lms-volver {
    display: inline-flex;
    align-items: center;
    font-family: var(--mam-font-base);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--mam-text-muted);
    text-decoration: none;
    margin-top: 32px;
    transition: var(--mam-transition-smooth);
}

.lms-volver:hover {
    color: var(--mam-azul);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .lms-main {
        padding: 32px 16px;
    }
    .lms-leccion-detalle {
        padding: 32px 20px;
    }
    .lms-curso-titulo {
        font-size: 2rem;
    }
    .lms-lecciones-lista {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   AVISO LEGAL (lección 01)
   ================================================== */
.mam-aviso-legal {
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0038d1;
    background: #f8fafc;
    padding: 1.5rem 1.75rem;
    margin: 0 0 2rem 0;
}

.mam-aviso-legal h2 {
    margin-top: 0;
    font-family: var(--mam-font-titulo);
    color: #0038d1;
    font-size: 1.25rem;
}

.mam-aviso-legal p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #2d3748;
    margin-bottom: 0.85rem;
}

.mam-aviso-legal p:last-child {
    margin-bottom: 0;
}

/* ==================================================
   MEJORA DEL ANCHO PARA LECCIONES (máx. 1500px)
   ================================================== */
.mam-leccion {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 40px;
}

@media (max-width: 1600px) {
    .mam-leccion {
        max-width: 1280px;
        padding: 20px 30px;
    }
}

@media (max-width: 768px) {
    .mam-leccion {
        max-width: 100%;
        padding: 15px;
    }
}

/* ==================================================
   ACORDEONES PARA LECCIONES (DISEÑO EDITORIAL PREMIUM)
   ================================================== */

.mam-leccion .manifiesto-accordion {
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.mam-leccion .accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    color: #1a202c;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    line-height: 1.4;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    gap: 1rem;
}

.mam-leccion .accordion-toggle:hover {
    background: #f7fafc;
}

.mam-leccion .accordion-number {
    flex-shrink: 0;
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #0038d1;
    letter-spacing: 0.01em;
    margin-right: 0.25rem;
}

.mam-leccion .accordion-title-text {
    flex: 1;
    font-weight: 500;
    color: #1a202c;
}

.mam-leccion .accordion-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #4a5568;
}

.mam-leccion .accordion-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mam-leccion .accordion-toggle[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

.mam-leccion .accordion-panel {
    display: none;
    padding: 0 1.5rem 1.5rem 1.5rem;
    background: #fafbfc;
    border-top: 1px solid #edf2f7;
}

.mam-leccion .accordion-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mam-leccion .accordion-content {
    color: #2d3748;
    font-size: 1rem;
    line-height: 1.75;
    font-family: 'Inter', sans-serif;
}

.mam-leccion .accordion-content h3 {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #1a202c;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.mam-leccion .accordion-content h4 {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #2d3748;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.mam-leccion .accordion-content p {
    margin-bottom: 1rem;
    color: #4a5568;
}

.mam-leccion .accordion-content ul,
.mam-leccion .accordion-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: #4a5568;
}

.mam-leccion .accordion-content ul li,
.mam-leccion .accordion-content ol li {
    margin-bottom: 0.4rem;
}

.mam-leccion .accordion-content strong {
    color: #1a202c;
    font-weight: 600;
}

.mam-leccion .accordion-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.mam-leccion .accordion-content th,
.mam-leccion .accordion-content td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    text-align: left;
}

.mam-leccion .accordion-content th {
    background: #f7fafc;
    color: #1a202c;
    font-weight: 600;
}

.mam-leccion .accordion-content .mam-plantilla {
    background: #f7fafc;
    border-left: 4px solid #0038d1;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: #2d3748;
    line-height: 1.6;
    border: 1px solid #e2e8f0;
}

.mam-leccion .accordion-content .mam-caso-practico {
    background: #f7fafc;
    border-left: 4px solid #d69e2e;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
}

.mam-leccion .accordion-content .mam-caso-practico h4 {
    color: #d69e2e;
    margin-top: 0;
}

.mam-leccion .accordion-content .mam-ejercicio {
    background: #f7fafc;
    border-left: 4px solid #38a169;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
}

.mam-leccion .accordion-content .mam-ejercicio h4 {
    color: #38a169;
    margin-top: 0;
}

.mam-leccion .accordion-content .mam-ejemplo-doc {
    background: #f7fafc;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-left: 3px solid #a0aec0;
    font-style: italic;
    color: #4a5568;
}

.mam-leccion .accordion-content .mam-tabla-raci,
.mam-leccion .accordion-content .mam-tabla-auditoria {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.mam-leccion .accordion-content .mam-tabla-raci th,
.mam-leccion .accordion-content .mam-tabla-raci td,
.mam-leccion .accordion-content .mam-tabla-auditoria th,
.mam-leccion .accordion-content .mam-tabla-auditoria td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.mam-leccion .accordion-content .mam-tabla-raci th,
.mam-leccion .accordion-content .mam-tabla-auditoria th {
    background: #f7fafc;
    color: #1a202c;
    font-weight: 600;
}

/* --- Test dentro de lección --- */
.mam-leccion .mam-test-preguntas {
    list-style: none;
    padding: 0;
}

.mam-leccion .mam-test-preguntas li {
    background: #f7fafc;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #0038d1;
    border: 1px solid #e2e8f0;
}

.mam-leccion .mam-test-preguntas li p {
    margin: 0.5rem 0;
    color: #2d3748;
}

.mam-leccion .mam-test-preguntas li ul {
    list-style: lower-alpha;
    padding-left: 1.5rem;
}

.mam-leccion .mam-test-preguntas li ul li {
    background: transparent;
    padding: 0;
    margin: 0.2rem 0;
    border: none;
}

/* --- Responsive (acordeones) --- */
@media (max-width: 768px) {
    .mam-leccion .accordion-toggle {
        padding: 1rem 1rem;
        font-size: 0.95rem;
    }
    .mam-leccion .accordion-number {
        font-size: 1rem;
    }
    .mam-leccion .accordion-panel {
        padding: 0 1rem 1rem 1rem;
    }
    .mam-leccion .accordion-content {
        font-size: 0.95rem;
    }
    .mam-leccion .accordion-content h3 {
        font-size: 1.3rem;
    }
    .mam-leccion .accordion-content h4 {
        font-size: 1.1rem;
    }
    .mam-leccion .accordion-content table,
    .mam-leccion .accordion-content .mam-tabla-raci,
    .mam-leccion .accordion-content .mam-tabla-auditoria {
        font-size: 0.8rem;
    }
    .mam-leccion .accordion-content th,
    .mam-leccion .accordion-content td {
        padding: 0.4rem 0.5rem;
    }
}

/* ==========================================================
   INTERACTIVIDAD LIGERA – PREGUNTAS TIPO TEST
   ========================================================== */

.mam-test-preguntas li {
    background: #ffffff;
    padding: 28px 32px;
    margin-bottom: 20px;
    border-left: 3px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.mam-test-preguntas li > p:first-child {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #0f172a;
    margin-bottom: 16px;
}

.mam-test-preguntas li ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mam-test-preguntas li ul li {
    padding: 12px 16px;
    margin: 6px 0;
    background: transparent;
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-family: 'Inter', sans-serif;
    font-size: 0.98rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
}

.mam-test-preguntas li ul li:hover {
    background: rgba(0, 0, 0, 0.02);
}

.mam-test-preguntas li ul li:focus-visible {
    outline: 2px solid #004dff;
    outline-offset: 2px;
}

.mam-test-preguntas li ul li.seleccionada-correcta {
    border-left-color: #004dff;
    background: rgba(0, 77, 255, 0.04);
    color: #0f172a;
}

.mam-test-preguntas li ul li.seleccionada-incorrecta {
    border-left-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
    color: #64748b;
    opacity: 0.6;
}

.mam-test-preguntas li.respondida ul li {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.mam-test-preguntas li.respondida ul li.seleccionada-correcta,
.mam-test-preguntas li.respondida ul li.seleccionada-incorrecta {
    opacity: 1;
}

.mam-test-preguntas li .respuesta-feedback {
    display: none;
    margin-top: 16px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid #004dff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #0f172a;
}

.mam-test-preguntas li .respuesta-feedback.visible {
    display: block;
}

.mam-test-preguntas li ul li .icono-feedback {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 400;
    color: #0f172a;
    letter-spacing: 0.02em;
}

.mam-toggle-solucion {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    margin: 16px 0 8px 0;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 44px;
    border-radius: 0;
}

.mam-toggle-solucion:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.2);
}

.mam-toggle-solucion:focus-visible {
    outline: 2px solid #004dff;
    outline-offset: 2px;
}

.mam-toggle-solucion[aria-expanded="true"] {
    border-color: #004dff;
    background: rgba(0, 77, 255, 0.04);
}

.mam-solucion-contenido {
    display: none;
    padding: 20px 24px;
    margin: 12px 0 20px 0;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid #004dff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #0f172a;
}

.mam-solucion-contenido.visible {
    display: block;
}

@media (max-width: 768px) {
    .mam-test-preguntas li {
        padding: 20px 20px;
    }
    .mam-test-preguntas li > p:first-child {
        font-size: 0.98rem;
    }
    .mam-test-preguntas li ul li {
        padding: 12px 14px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    .mam-toggle-solucion {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 0.8rem;
    }
    .mam-solucion-contenido {
        padding: 16px 18px;
        font-size: 0.9rem;
    }
}