/*
 * Photo quality checker: the checklist inside the crop window (js/calidad/lista.js, phase C).
 * Every rule hangs from .rf-calidad-activo (or an .rf- element), which only a field in "Avisar"
 * or "Bloquear" receives: the window of every other field is untouched.
 */

/* What a checked field does not show: the file box, the quality slider, the aspect buttons
   (a document's crop comes from its own shape; a portrait is locked to 3:4). */
#hivepress-crop-modal.rf-calidad-activo .file-info,
#hivepress-crop-modal.rf-calidad-activo .crop-options {
    display: none;
}

/* The straightened document is the upload: "Subir sin editar" would send the original. */
#hivepress-crop-modal.rf-sin-saltar .crop-skip {
    display: none;
}

#hivepress-crop-modal.rf-calidad-comprobando .crop-container {
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.rf-calidad-panel {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.45;
    color: #1f2328;
}

.rf-calidad-estado {
    margin: 0 0 8px;
    color: #57606a;
}

.rf-calidad-estado::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    vertical-align: -1px;
    border: 2px solid #c8ccd1;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: rf-gira 0.8s linear infinite;
}

@keyframes rf-gira {
    to { transform: rotate(360deg); }
}

.rf-calidad-filas {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rf-fila {
    display: grid;
    grid-template-columns: 22px auto;
    column-gap: 10px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid #eaeef2;
    outline: none;
}

.rf-fila:last-child {
    border-bottom: none;
}

.rf-fila:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.rf-icono {
    grid-row: span 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.rf-palabra {
    font-weight: 600;
    font-size: 13px;
}

.rf-texto {
    grid-column: 2;
}

.rf-fila--ok .rf-icono { background: #1a7f37; }
.rf-fila--ok .rf-palabra { color: #1a7f37; }
.rf-fila--aviso .rf-icono { background: #bf8700; }
.rf-fila--aviso .rf-palabra { color: #8a6100; }
.rf-fila--fallo .rf-icono { background: #cf222e; }
.rf-fila--fallo .rf-palabra { color: #a40e26; }

.rf-calidad-nota {
    margin: 12px 0 0;
    font-size: 13px;
    color: #57606a;
}

/* The regions a failed row is about (glare, a finger), drawn over the image. */
.rf-capas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 3;
}

.rf-capa {
    position: absolute;
    border: 3px solid #cf222e;
    border-radius: 10px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

#hivepress-crop-modal .crop-modal-footer .button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* The capture tips under a checked field (before the file is chosen). */
.rf-calidad-consejo p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #57606a;
}

.rf-calidad-consejo .rf-calidad-privacidad {
    font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .rf-calidad-estado::before { animation: none; }
    #hivepress-crop-modal.rf-calidad-comprobando .crop-container { transition: none; }
}

/* On a phone the panel sits under the photo. Its height is fixed from the start, so the photo
   area Cropper measured when it opened does not shrink when the rows arrive. */
@media (max-width: 768px) {
    #hivepress-crop-modal.rf-calidad-activo .crop-info {
        height: 30vh;
        max-height: 30vh;
        flex: none;
    }
}

/* "Bloquear" refused the photo: only "Volver a tomar la foto" (main), "Cancelar" and, if the
   settings allow it, "Subir de todos modos" remain. */
#hivepress-crop-modal.rf-bloqueado .crop-and-upload,
#hivepress-crop-modal.rf-bloqueado .crop-skip {
    display: none;
}

#hivepress-crop-modal.rf-bloqueado .crop-modal-footer .rf-repetir {
    background: #007cba;
    border-color: #005a87;
    color: #fff;
}

/* 1.8.0: the flow is adjust -> "Comprobar de nuevo" -> save. The re-check is the main button
   only while the upload has not been earned (rf-pendiente); once the crop has passed it steps
   back and "Guardar Cambios y Subir" is the main one. */
#hivepress-crop-modal .crop-modal-footer .rf-recomprobar {
    background: #f6f7f7;
    border-color: #c3c4c7;
    color: #2c3338;
}

#hivepress-crop-modal.rf-pendiente .crop-modal-footer .rf-recomprobar {
    background: #007cba;
    border-color: #005a87;
    color: #fff;
}

#hivepress-crop-modal.rf-pendiente .crop-modal-footer .rf-repetir {
    background: #f6f7f7;
    border-color: #c3c4c7;
    color: #2c3338;
}
