:root {
    --lhp-primary: #4CAF50;
    --lhp-radius: 12px;
    --lhp-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.lhp-container { max-width: 1400px; margin: 0 auto; padding: 30px 20px; }
.lhp-modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.lhp-module-card { background: white; border-radius: var(--lhp-radius); box-shadow: var(--lhp-shadow); padding: 25px; cursor: pointer; transition: all 0.3s; }
.lhp-module-card:hover { transform: translateY(-5px); }
.lhp-question { background: white; padding: 30px; border-radius: var(--lhp-radius); margin-bottom: 25px; }
.lhp-option { padding: 15px; border: 2px solid #ddd; border-radius: 8px; cursor: pointer; margin: 10px 0; }
.lhp-option:hover { border-color: var(--lhp-primary); }
.lhp-option.selected { border-color: var(--lhp-primary); background: rgba(76, 175, 80, 0.1); }
.lhp-btn { padding: 15px 35px; background: var(--lhp-primary); color: white; border: none; border-radius: var(--lhp-radius); font-size: 16px; cursor: pointer; }
.lhp-btn:hover { opacity: 0.9; }


/* === Resultados PRO centrados === */
.lhp-results-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 40px;
}
.lhp-results-box {
    max-width: 700px;
    width: 90%;
    background: #ffffff;
    padding: 30px 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
}
.lhp-results-box.lhp-dark {
    background: #121212;
    color: #f5f5f5;
}
.lhp-results-title {
    font-size: 28px;
    margin-bottom: 10px;
}
.lhp-score {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}
.lhp-message {
    font-size: 18px;
    margin-bottom: 20px;
}
.lhp-attempt-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}
.lhp-results-box.lhp-dark .lhp-attempt-info {
    color: #cccccc;
}
.lhp-subtitle {
    margin-top: 10px;
    margin-bottom: 15px;
    font-size: 22px;
}
.lhp-toggle-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    margin-bottom: 15px;
}
.lhp-toggle-row label {
    cursor: pointer;
}
.lhp-review-list {
    text-align: left;
}
.lhp-question-review {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
}
.lhp-question-review.ok {
    background: #e8ffe8;
}
.lhp-question-review.bad {
    background: #ffe8e8;
}
.lhp-results-box.lhp-dark .lhp-question-review.ok {
    background: #1b3b1b;
}
.lhp-results-box.lhp-dark .lhp-question-review.bad {
    background: #4a1b1b;
}
.lhp-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.lhp-q-text {
    margin-bottom: 4px;
}
#lhp-retry-btn {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 18px;
    border: none;
    background: #007bff;
    color: #ffffff;
    border-radius: 10px;
    cursor: pointer;
}
#lhp-retry-btn:hover {
    background: #005ec2;
}

/* Respeta prefers-color-scheme para modo oscuro inicial */
@media (prefers-color-scheme: dark) {
    .lhp-results-box {
        background: #181818;
        color: #f5f5f5;
    }
}

.lhp-progress-wrapper{
    position:relative;
    width:100%;
    background:#e9e9e9;
    border-radius:14px;
    height:26px;
    overflow:hidden;
    margin:20px 0 30px 0;
    box-shadow:inset 0 2px 6px rgba(0,0,0,0.15);
}
.lhp-progress-bar{
    height:100%;
    border-radius:14px;
    background:linear-gradient(90deg,#00b4ff,#0077ff);
    box-shadow:0 0 18px rgba(0,123,255,0.7);
    transition:width 0.7s ease-in-out;
}
.lhp-progress-text{
    position:absolute;
    top:0;
    left:50%;
    transform:translateX(-50%);
    font-weight:700;
    font-size:13px;
    color:#ffffff;
    text-shadow:0 1px 2px rgba(0,0,0,0.4);
    line-height:26px;
}

/* === MEJORAS DE ACCESIBILIDAD Y RESPONSIVE === */

/* Focus visible para navegación por teclado */
.lhp-option:focus,
.lhp-btn:focus,
#lhp-retry-btn:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

/* Mejorar contraste para usuarios con problemas visuales */
@media (prefers-contrast: high) {
    .lhp-option {
        border-width: 3px;
    }
    .lhp-option.selected {
        border-color: #000;
        background: rgba(0, 0, 0, 0.15);
    }
}

/* Reducir animaciones para usuarios sensibles */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === Mejoras Responsive === */
@media screen and (max-width: 768px) {
    .lhp-container {
        padding: 20px 15px;
    }
    .lhp-modules-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .lhp-question {
        padding: 20px 15px;
    }
    .lhp-results-box {
        width: 95%;
        padding: 20px 15px;
    }
    .lhp-results-title {
        font-size: 24px;
    }
    .lhp-score {
        font-size: 28px;
    }
    .lhp-toggle-row {
        flex-direction: column;
        gap: 10px;
    }
}

@media screen and (max-width: 480px) {
    .lhp-container {
        padding: 15px 10px;
    }
    .lhp-option {
        padding: 12px;
        font-size: 14px;
    }
    .lhp-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
    .lhp-results-title {
        font-size: 20px;
    }
    .lhp-score {
        font-size: 24px;
    }
    .lhp-message {
        font-size: 16px;
    }
}

/* Highlight para preguntas sin responder */
.lhp-question.lhp-highlight {
    animation: highlight-pulse 1s ease-in-out;
    border: 2px solid #ff9800;
    border-radius: var(--lhp-radius);
}

@keyframes highlight-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 152, 0, 0); }
    50% { box-shadow: 0 0 20px rgba(255, 152, 0, 0.8); }
}

/* Indicador visual de input con contenido */
.lhp-input-answer.has-value {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

/* Spinner de carga */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estadísticas del examen */
.lhp-stats {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
}

.lhp-results-box.lhp-dark .lhp-stats {
    color: #ccc;
}


.lhp-warning-box {
    margin-top: 15px;
    padding: 15px 18px;
    background: #fff8e1;
    border-left: 4px solid #f4c542;
    border-radius: 10px;
    font-size: 0.95rem;
}
.lhp-warning-icon {
    margin-right: 6px;
}
.lhp-student-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 22px;
    border-radius: 999px;
    background: #1f7ae0;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.lhp-student-btn:hover {
    background: #105bb1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}
.lhp-student-panel .lhp-student-header h1 {
    margin-bottom: 4px;
}
.lhp-student-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0 25px;
}
.lhp-stat-card {
    flex: 1 1 160px;
    min-width: 160px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--lhp-shadow);
}
.lhp-stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #78909c;
}
.lhp-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #263238;
}
.lhp-table-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--lhp-shadow);
    overflow-x: auto;
}
.lhp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.lhp-table thead tr {
    background: #f5f7fa;
}
.lhp-table th,
.lhp-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}
.lhp-table tbody tr:nth-child(even) {
    background: #fafafa;
}
.lhp-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.lhp-badge-pass {
    background: #e0f7e9;
    color: #2e7d32;
}
.lhp-badge-fail {
    background: #ffebee;
    color: #c62828;
}
@media (max-width: 768px) {
    .lhp-student-stats {
        flex-direction: column;
    }
}
