/**
 * Estilos Públicos del LMS Rural - Diseño Moderno Premium
 * Basado en mockups proporcionados
 * Optimizado para zonas rurales con bajo ancho de banda
 */

/* ========================================
   IMPORTAR FUENTE INTER
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ========================================
   VARIABLES Y RESET
   ======================================== */
:root {
    /* Colores Primarios */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --primary-border: #bfdbfe;

    /* Colores de Estado */
    --success-color: #10b981;
    --success-bg: #d1fae5;
    --success-border: #6ee7b7;
    --success-text: #065f46;

    --error-color: #ef4444;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #991b1b;

    --warning-color: #f59e0b;
    --warning-bg: #fffbeb;

    /* Colores de Texto */
    --text-dark: #111827;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* Fondos y Bordes */
    --bg-page: #f8fafc;
    --bg-white: #ffffff;
    --bg-light: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Sombras */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.05);

    /* Radios */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
.lms-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ========================================
   PÁGINA DE LOGIN - DISEÑO MODERNO
   ======================================== */
.lms-inicio-box {
    max-width: 420px;
    margin: 4rem auto;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    border: 1px solid var(--border-light);
}

.lms-inicio-box h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    text-align: center;
    letter-spacing: -0.02em;
}

.lms-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0 0 2rem 0;
    text-align: center;
    font-weight: 400;
}

/* Formularios */
.lms-form {
    margin-top: 1rem;
}

.lms-form-group {
    margin-bottom: 1.25rem;
}

.lms-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

/* Input con Icono */
.lms-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.lms-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.125rem;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
}

.lms-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    background: var(--bg-white);
    color: var(--text-primary);
}

.lms-input-wrapper .lms-input {
    padding-left: 2.75rem;
}

.lms-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.lms-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Botones */
.lms-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    text-decoration: none !important;
    line-height: 1.4;
}

.lms-button-primary {
    background: var(--primary-color);
    color: white !important;
    width: 100%;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.lms-button-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.lms-button-primary:active {
    transform: translateY(0);
}

.lms-button-secondary {
    background: var(--bg-white);
    color: var(--primary-color) !important;
    border: 1.5px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.lms-button-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
}

.lms-button-success {
    background: var(--success-color) !important;
    background-color: var(--success-color) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.lms-button-success:hover {
    background: #059669 !important;
    background-color: #059669 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25);
}

.lms-button-disabled {
    background: var(--bg-light);
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

/* Link alternativo */
.lms-acceso-alternativo {
    margin-top: 1.5rem;
    text-align: center;
}

.lms-link-alternativo {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-base);
    padding: 0.5rem;
    font-family: inherit;
}

.lms-link-alternativo:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.lms-form-alternativo {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Mensajes */
.lms-mensaje {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.lms-mensaje p {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin: 0.5rem 0;
    font-weight: 500;
}

.lms-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
    padding: 15px;
    border-radius: 15px;
}

.lms-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.lms-loading {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border: 1px solid var(--primary-border);
}

/* ========================================
   HEADER DEL CURSO
   ======================================== */
.lms-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.lms-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.lms-back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: auto;
}

.lms-back-link:hover {
    text-decoration: underline;
}

/* ========================================
   TEMARIO DEL CURSO - DISEÑO MODERNO
   ======================================== */
.lms-welcome-box {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.lms-welcome {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Título del Temario */
.lms-temario-titulo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.lms-temario-subtitulo {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    font-weight: 400;
}

/* Barra de Progreso General */
.lms-progreso-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.lms-progreso-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.lms-progreso-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lms-progreso-porcentaje {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--success-color);
}

.lms-progreso-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.lms-progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--success-color) 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.lms-progreso-mensaje {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* Sección de Módulos */
.lms-modulos-seccion {
    margin-top: 2rem;
}

.lms-modulos-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

/* Cards de Temas - Lista Horizontal */
.lms-temas-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lms-tema-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    transition: var(--transition-base);
    cursor: pointer;
}

.lms-tema-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-sm);
}

.lms-tema-card.activo {
    background: var(--primary-bg);
    border-color: var(--primary-border);
    border-left: 4px solid var(--primary-color);
}

.lms-tema-card.completado {
    background: var(--bg-white);
}

.lms-tema-card.bloqueado {
    opacity: 0.7;
    cursor: not-allowed;
}

.lms-tema-card.bloqueado:hover {
    box-shadow: none;
    border-color: var(--border-light);
}

/* Icono de estado del tema */
.lms-tema-estado-icono {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.lms-tema-card.completado .lms-tema-estado-icono {
    background: var(--success-color);
    color: white;
}

.lms-tema-card.activo .lms-tema-estado-icono {
    background: var(--primary-color);
    color: white;
}

.lms-tema-card.bloqueado .lms-tema-estado-icono {
    background: var(--bg-light);
    color: var(--text-muted);
}

/* Contenido del tema */
.lms-tema-content {
    flex: 1;
    min-width: 0;
}

.lms-tema-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.01em;
}

.lms-tema-card.activo .lms-tema-content h3 {
    font-weight: 700;
}

.lms-tema-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 500;
}

.lms-tema-info.disponible {
    color: var(--primary-color);
}

.lms-tema-fecha {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Acción del tema */
.lms-tema-action {
    flex-shrink: 0;
}

.lms-tema-action .lms-button {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
}

.lms-tema-action .lms-button-primary {
    width: auto;
}

/* Flecha de navegación */
.lms-tema-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* ========================================
   INTRO DEL MÓDULO
   ======================================== */
.lms-modulo-intro {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.lms-modulo-badge {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary-color);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.5rem;
}

.lms-modulo-titulo {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.lms-modulo-descripcion {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    line-height: 1.7;
}

.lms-modulo-cta {
    margin-bottom: 3rem;
}

.lms-modulo-cta .lms-button {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    width: auto;
}

/* Métricas del módulo */
.lms-modulo-metricas {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.lms-metrica {
    text-align: center;
}

.lms-metrica-icono {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.lms-metrica-valor {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   CONTENIDO DEL CURSO / QUIZ
   ======================================== */
.lms-curso-header {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.lms-curso-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.lms-curso-header p,
.lms-objetivo {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* Quiz Header con Progreso */
.lms-quiz-header {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.lms-quiz-titulo {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lms-quiz-contador {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.lms-quiz-progreso {
    height: 4px;
    background: var(--bg-light);
    border-radius: 0;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.lms-quiz-progreso .lms-progreso-fill {
    background: var(--success-color);
    border-radius: 0;
}

/* Contenido/Pregunta */
.lms-contenido {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
}

.lms-pregunta-container h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin: 0 0 2rem 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Opciones de Respuesta - Diseño Moderno */
.lms-pregunta-form {
    max-width: 540px;
    margin: 0 auto;
}

.lms-opcion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--bg-white);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-base);
}

.lms-opcion:hover {
    border-color: var(--primary-border);
    background: var(--bg-light);
}

.lms-opcion.seleccionada,
.lms-opcion:has(input:checked) {
    border-color: var(--primary-color);
    background: var(--primary-bg);
}

.lms-opcion input[type="radio"] {
    order: 2;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.lms-opcion span {
    order: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
    flex: 1;
}

/* Estados de respuesta */
.lms-opcion.lms-opcion-correcta {
    border-color: var(--success-color) !important;
    background: var(--success-bg) !important;
}

.lms-opcion.lms-opcion-incorrecta {
    border-color: var(--error-color) !important;
    background: var(--error-bg) !important;
}

/* Opciones deshabilitadas - después de responder o agotar intentos */
.lms-opcion:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

.lms-opcion:has(input:disabled):hover {
    border-color: var(--border-color);
    background: var(--bg-white);
}

/* Mantener estilos cuando están marcadas como correcta/incorrecta aunque disabled */
.lms-opcion.lms-opcion-correcta:has(input:disabled) {
    opacity: 1;
    border-color: var(--success-color) !important;
    background: var(--success-bg) !important;
}

.lms-opcion.lms-opcion-incorrecta:has(input:disabled) {
    opacity: 1;
    border-color: var(--error-color) !important;
    background: var(--error-bg) !important;
}

.lms-icono-correcto {
    color: var(--success-color);
    font-weight: bold;
    margin-left: 0.5rem;
}

/* Feedback de Respuesta */
.lms-feedback {
    margin-top: 1.5rem;
}

.lms-feedback-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-lg);
}

.lms-feedback-icono {
    width: 28px;
    height: 28px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.lms-feedback-contenido {
    flex: 1;
}

.lms-feedback-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success-text);
    margin: 0 0 0.25rem 0;
}

.lms-feedback-texto {
    font-size: 0.875rem;
    color: var(--success-text);
    margin: 0;
    opacity: 0.9;
}

.lms-feedback-accion {
    flex-shrink: 0;
    align-self: center;
}

.lms-feedback-accion .lms-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Botón Verificar */
.lms-pregunta-form button[type="submit"] {
    margin-top: 1.5rem;
}

/* Intentos */
.lms-intentos {
    background: var(--warning-bg);
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 1rem;
}

.lms-intentos-agotados {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 1rem;
}

.btn-reintentar {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: var(--transition-base);
    font-family: inherit;
}

.btn-reintentar:hover {
    background: #d97706;
}

/* Clases utilitarias */
.lms-mt-1 {
    margin-top: 0.5rem !important;
}

.lms-mt-2 {
    margin-top: 1rem !important;
}

.lms-mt-3 {
    margin-top: 1.5rem !important;
}

.lms-mb-1 {
    margin-bottom: 0.5rem !important;
}

.lms-mb-2 {
    margin-bottom: 1rem !important;
}

/* Estilos para botones dentro del feedback */
.lms-feedback .lms-button {
    display: inline-block !important;
    margin-top: 1rem;
}

.lms-feedback .btn-siguiente,
.lms-feedback .btn-finalizar {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Navegación */
.lms-navegacion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.lms-navegacion .lms-button {
    width: auto;
    min-width: 140px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
}

.lms-navegacion .lms-btn-anterior {
    padding-left: 1rem;
    padding-right: 1.5rem;
    border: 0px;
    background: #10b981;
    color: #ffffff !important;
}

.lms-navegacion .btn-siguiente,
.lms-navegacion .btn-finalizar,
.lms-navegacion .lms-btn-siguiente {
    margin-left: auto;
}

/* Hint/Instrucción */
.lms-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 1.5rem;
}

.lms-hint::before {
    content: "💡 ";
}

/* ========================================
   VIDEO
   ======================================== */
.lms-video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000;
    margin-bottom: 1.5rem;
}

.lms-video-container iframe,
.lms-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lms-progreso-video {
    margin-bottom: 1rem;
}

.lms-progreso-texto {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: right;
}

/* ========================================
   CURSO COMPLETADO - CARD DE ÉXITO
   ======================================== */
.lms-completado-card {
    max-width: 440px;
    margin: 3rem auto;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    border: 1px solid var(--border-light);
}

.lms-completado-icono {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.lms-completado-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.02em;
}

.lms-completado-mensaje {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.lms-completado-mensaje strong {
    color: var(--text-primary);
}

/* Estado del curso */
.lms-estado-curso {
    margin-bottom: 1.5rem;
}

.lms-estado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.lms-estado-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.lms-estado-porcentaje {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-color);
}

.lms-estado-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.lms-estado-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #60a5fa 100%);
    border-radius: var(--radius-full);
}

.lms-requisitos {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--success-text);
    margin-top: 0.75rem;
}

.lms-requisitos::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: bold;
}

/* Botones de completado */
.lms-completado-acciones {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lms-completado-acciones .lms-button-primary {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

.lms-link-explorar {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    padding: 0.5rem;
    font-family: inherit;
    transition: var(--transition-base);
}

.lms-link-explorar:hover {
    color: var(--primary-color);
}

/* ========================================
   CERTIFICADO BOX (en lista de temas)
   ======================================== */
.lms-certificado-box {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #dbeafe 100%);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.lms-certificado-box h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.lms-certificado-box p {
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
}

.lms-button-large {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

/* ========================================
   CERTIFICADO DOCUMENTO
   Diseño optimizado para formato carta (8.5x11")
   ======================================== */
.lms-certificado-wrapper {
    max-width: 100%;
    margin: 2rem auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Dimensiones fijas proporcionales a carta (8.5:11 = 0.773 ratio) */
.lms-certificado-documento {
    width: 816px;
    /* 8.5" a 96dpi */
    height: 1056px;
    /* 11" a 96dpi */
    max-width: 100%;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 0;
    padding: 0;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    overflow: hidden;
}

.lms-certificado-documento.con-marco {
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    padding: 80px 60px;
}

.lms-certificado-documento.sin-marco {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 3px double var(--primary-color);
    padding: 60px 50px;
}

.certificado-logo {
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.certificado-logo img {
    max-width: 160px;
    max-height: 80px;
    object-fit: contain;
}

.certificado-titulo {
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
    flex-shrink: 0;
}

.certificado-titulo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.08em;
    margin: 0;
    text-transform: uppercase;
}

.certificado-texto {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0;
    width: 100%;
}

.certificado-otorga {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.certificado-nombre-estudiante {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0.5rem 0;
    text-transform: uppercase;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 0.25rem;
}

.certificado-descripcion {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 1rem 0 0.5rem;
}

.certificado-nombre-curso {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0.5rem 0;
    line-height: 1.3;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.certificado-horas {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.certificado-adicional {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    font-style: italic;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.certificado-fecha {
    text-align: center;
    margin: 1rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.certificado-firma-seccion {
    text-align: center;
    margin-top: 0.5rem;
    min-width: 240px;
    flex-shrink: 0;
}

.certificado-firma-imagen {
    margin-bottom: 0.25rem;
}

.certificado-firma-imagen img {
    max-width: 140px;
    max-height: 50px;
    object-fit: contain;
}

.certificado-firma-linea {
    width: 180px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 0 auto 0.25rem;
}

.certificado-firmante-nombre {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.25rem 0 0.15rem;
}

.certificado-firmante-cargo {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.lms-certificado-acciones {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Escalado responsivo para móviles - mantiene proporciones */
@media (max-width: 900px) {
    .lms-certificado-wrapper {
        padding: 0.5rem;
        overflow-x: auto;
        align-items: flex-start;
    }

    .lms-certificado-documento {
        /* Escalar proporcionalmente para pantallas pequeñas */
        transform-origin: top left;
        transform: scale(calc(min(100vw - 1rem, 816px) / 816));
        margin-bottom: calc(2rem + 1056px * (1 - calc(min(100vw - 1rem, 816px) / 816)));
    }
}

/* ========================================
   CONTENIDO ITEM (para navegación)
   ======================================== */
.lms-contenido-item {
    display: none;
}

.lms-contenido-item.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   OBJETIVO BOX
   ======================================== */
.lms-objetivo-box {
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.lms-objetivo-box h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0 0 0.25rem 0;
}

.lms-objetivo-box p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .lms-container {
        padding: 1rem;
    }

    .lms-inicio-box {
        padding: 1.5rem;
        margin: 1rem auto;
        border-radius: var(--radius-lg);
    }

    .lms-inicio-box h2 {
        font-size: 1.5rem;
    }

    .lms-temario-titulo {
        font-size: 1.5rem;
    }

    .lms-modulo-titulo {
        font-size: 1.75rem;
    }

    .lms-modulo-metricas {
        gap: 2rem;
    }

    .lms-pregunta-container h3 {
        font-size: 1.125rem;
    }

    .lms-tema-card {
        padding: 0.875rem 1rem;
    }

    .lms-navegacion {
        flex-direction: column;
    }

    .lms-navegacion .lms-button {
        width: 100%;
    }

    .lms-completado-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    /* Los estilos del certificado se manejan en @media (max-width: 900px) */
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ========================================
   IMPRESIÓN - Certificado formato carta
   ======================================== */
@page {
    size: 8.5in 11in;
    margin: 0;
}

@media print {

    /* Ocultar absolutamente todo excepto el certificado */
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        width: 8.5in !important;
        height: 11in !important;
        overflow: hidden !important;
        background: white !important;
        /* Forzar impresión de fondos */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ocultar elementos no deseados */
    .lms-certificado-acciones,
    .lms-header,
    .lms-navegacion,
    .lms-completado-card,
    header,
    footer,
    nav,
    aside,
    #wpadminbar,
    .admin-bar,
    .site-header,
    .site-footer,
    .wp-site-blocks>*:not(.lms-container),
    script,
    style {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
    }

    /* Container ocupa toda la página */
    .lms-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 8.5in !important;
        height: 11in !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        overflow: hidden !important;
    }

    .lms-certificado-wrapper {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 8.5in !important;
        height: 11in !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        display: block !important;
        overflow: hidden !important;
    }

    /* Certificado ocupa exactamente toda la página */
    .lms-certificado-documento {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 8.5in !important;
        height: 11in !important;
        max-width: none !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        overflow: hidden !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
        break-after: avoid !important;
        break-before: avoid !important;
        break-inside: avoid !important;
        /* Forzar impresión de fondo */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Marco con padding adecuado */
    .lms-certificado-documento.con-marco {
        padding: 0.6in 0.5in !important;
        background-size: 8.5in 11in !important;
        background-repeat: no-repeat !important;
        background-position: top left !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .lms-certificado-documento.sin-marco {
        padding: 0.5in 0.4in !important;
    }

    /* Tamaños de fuente para impresión */
    .certificado-titulo h1 {
        font-size: 24pt !important;
    }

    .certificado-nombre-estudiante {
        font-size: 22pt !important;
    }

    .certificado-nombre-curso {
        font-size: 16pt !important;
    }

    .certificado-otorga,
    .certificado-descripcion,
    .certificado-horas,
    .certificado-fecha p {
        font-size: 12pt !important;
    }

    .certificado-firmante-nombre {
        font-size: 11pt !important;
    }

    .certificado-firmante-cargo {
        font-size: 10pt !important;
    }

    /* Forzar impresión de imágenes */
    .certificado-logo img,
    .certificado-firma-imagen img {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Logo más pequeño para impresión */
    .certificado-logo img {
        max-height: 0.7in !important;
        max-width: 1.8in !important;
    }

    /* Firma más pequeña */
    .certificado-firma-imagen img {
        max-height: 0.5in !important;
        max-width: 1.5in !important;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */
.lms-text-center {
    text-align: center;
}

.lms-mt-1 {
    margin-top: 0.5rem;
}

.lms-mt-2 {
    margin-top: 1rem;
}

.lms-mt-3 {
    margin-top: 1.5rem;
}

.lms-mt-4 {
    margin-top: 2rem;
}

.lms-mb-1 {
    margin-bottom: 0.5rem;
}

.lms-mb-2 {
    margin-bottom: 1rem;
}

.lms-mb-3 {
    margin-bottom: 1.5rem;
}

/* ========================================
   LEGACY COMPATIBILITY - KEEP OLD CLASSES WORKING
   ======================================== */
.lms-tema-numero {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    background: var(--primary-color);
    color: white;
}

.lms-tema-card.completado .lms-tema-numero {
    background: var(--success-color);
}

.lms-tema-card.bloqueado .lms-tema-numero {
    background: var(--bg-light);
    color: var(--text-muted);
}

.lms-checkmark,
.lms-lock {
    font-size: 0.875rem;
}

.lms-puntaje {
    font-size: 0.75rem;
    color: var(--success-color);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Progreso general legacy */
.lms-progreso-general {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.lms-progreso-general h3 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Header legacy */
.lms-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.lms-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* ========================================
   OVERRIDES FORZADOS PARA WORDPRESS
   ======================================== */

/* BOTÓN PRIMARIO - FORZAR ESTILOS */
.lms-container button.lms-button-primary,
.lms-container .lms-button.lms-button-primary,
.lms-inicio-box button.lms-button-primary,
.lms-inicio-box .lms-button.lms-button-primary,
button.lms-button.lms-button-primary,
.lms-form button[type="submit"].lms-button-primary {
    display: block !important;
    width: 100% !important;
    padding: 0.875rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    text-align: center !important;
    background: #2563eb !important;
    background-color: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3) !important;
    margin-top: 0.5rem !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.lms-container button.lms-button-primary:hover,
.lms-inicio-box button.lms-button-primary:hover,
button.lms-button.lms-button-primary:hover {
    background: #1d4ed8 !important;
    background-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
}

/* LINK DE REGISTRO - FORZAR ESTILOS */
.lms-acceso-alternativo button.lms-link-alternativo,
button.lms-link-alternativo,
.lms-link-alternativo {
    display: inline-block !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    color: #2563eb !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    cursor: pointer !important;
    text-decoration: none !important;
    padding: 0.5rem !important;
    margin: 0 !important;
    text-align: center !important;
    width: auto !important;
}

.lms-acceso-alternativo button.lms-link-alternativo:hover,
button.lms-link-alternativo:hover,
.lms-link-alternativo:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
    background: none !important;
}

.lms-acceso-alternativo {
    margin-top: 1.5rem !important;
    text-align: center !important;
    border-top: none !important;
    padding-top: 0 !important;
}

/* ========================================
   LOGO CENTRADO - ESTILO TEMARIO
   ======================================== */
.lms-logo-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 2rem !important;
}

.lms-logo-box {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lms-logo-box img {
    max-height: 80px !important;
    max-width: 200px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.lms-logo-box .lms-logo-placeholder {
    color: #6b7280 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    font-style: normal !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Ocultar header viejo si existe el nuevo logo */
.lms-container .lms-header.lms-header-hidden {
    display: none !important;
}

/* ========================================
   ESTILOS ADICIONALES DE NAVEGACIÓN
   ======================================== */
.lms-btn-anterior {
    background-color: var(--bg-white);
    color: var(--text-secondary) !important;
    border: 1.5px solid var(--border-color);
    margin-right: 0.75rem;
    padding: 0.875rem 1.5rem;
    font-weight: 500;
}

.lms-btn-anterior:hover {
    background-color: var(--bg-light);
    color: var(--text-primary) !important;
    border-color: var(--text-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}