/*
 * Estilos propios del comprobador de requisitos.
 * Complementan a Bootstrap 5. Aspecto limpio y neutro, pensado para integrarse
 * después en cualquier tema de Moodle sin chocar.
 */

:root {
    --check-ok: #198754;
    --check-warn: #997404;
    --check-error: #dc3545;
    --check-info: #6c757d;
    --check-unknown: #adb5bd;
}

body {
    background-color: #f4f5f7;
    color: #212529;
    padding: 1.5rem 1rem;
}

.check-wrapper {
    max-width: 760px;
    margin: 0 auto;
}

.check-card {
    background-color: #fff;
    border: 1px solid #e3e6ea;
    border-radius: .75rem;
    padding: 1.75rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .06);
}

.check-title {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: .25rem;
}

.check-intro {
    text-align: center;
    color: #495057;
    margin-bottom: 1.5rem;
}

/* Enlace "saltar al contenido".
   Color explícito con contraste alto incluso mientras está oculto,
   para que las herramientas de accesibilidad no lo marquen. */
.check-skip {
    color: #084298;
    background-color: #fff;
}

.check-skip:focus {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 1080;
    padding: .5rem .75rem;
    border-radius: .375rem;
    box-shadow: 0 0 0 3px #0d6efd;
}

/* Lista de resultados */
.check-list {
    margin: 0;
}

.check-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.check-item:last-child {
    border-bottom: 0;
}

.check-item__head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.check-item__icon {
    flex: 0 0 auto;
    line-height: 0;
}

.check-item__body {
    flex: 1 1 auto;
    min-width: 0;
}

.check-item__name {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 .15rem;
}

.check-item__value {
    margin: 0;
    color: #495057;
}

.check-item__badge {
    flex: 0 0 auto;
    align-self: center;
    font-size: .8rem;
    padding: .4em .65em;
}

/* Color del icono según estado */
.check-item--ok .check-item__icon { color: var(--check-ok); }
.check-item--warn .check-item__icon { color: var(--check-warn); }
.check-item--error .check-item__icon { color: var(--check-error); }
.check-item--info .check-item__icon { color: var(--check-info); }
.check-item--unknown .check-item__icon { color: var(--check-unknown); }

/* Acciones (botón del test de popup) */
.check-item__actions {
    margin: .75rem 0 0 calc(30px + .85rem);
}

/* Bloque de ayuda desplegable */
.check-item__help {
    margin: .6rem 0 0 calc(30px + .85rem);
}

.check-item__help > summary {
    cursor: pointer;
    color: #0d6efd;
    font-weight: 500;
    width: fit-content;
}

.check-item__help > summary:hover {
    text-decoration: underline;
}

.check-item__help-content {
    margin-top: .5rem;
    padding: .85rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    font-size: .95rem;
}

.check-item__help-content p:last-child,
.check-item__help-content ul:last-child {
    margin-bottom: 0;
}

/* Foco visible reforzado para navegación por teclado */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .check-item__head {
        flex-wrap: wrap;
    }
    .check-item__badge {
        order: 3;
        margin-left: calc(30px + .85rem);
    }
    .check-item__actions,
    .check-item__help {
        margin-left: 0;
    }
}

/* Respeto a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
