/* ===============================
   RESET GLOBAL
=============================== */
* {
    box-sizing: border-box;
}

/* ===============================
   BASE
=============================== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

footer {
    background: #222;
    color: white;
    text-align: center;
    padding: 10px;
}

/* ===============================
   CONTENEDOR
=============================== */
#reporte {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: #1e3a8a;
    padding: 40px 20px;
}

#formulario {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* ===============================
   INPUTS
=============================== */
#formulario input,
#formulario select,
#formulario textarea {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* ===============================
   BOTONES
=============================== */
#formulario button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #1e40af;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

#formulario button:hover {
    background: #1d4ed8;
}

/* BOTONES ANTERIOR */
#btnAnterior2,
#btnAnterior3,
#btnAnterior4 {
    background: #64748b;
}

#btnAnterior2:hover,
#btnAnterior3:hover,
#btnAnterior4:hover {
    background: #475569;
}

/* ===============================
   PASOS
=============================== */
.paso {
    display: none;
}

.paso.activo {
    display: block;
}

/* ===============================
   CATEGORÍAS (ACORDEÓN)
=============================== */
.categoria {
    margin-bottom: 20px;
}

/* BOTÓN */
.toggle {
    width: 100%;
    padding: 14px;
    background: #0f172a;
    color: white;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
}

/* CONTENIDO */
.categoria .contenido {
    display: none;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
}

/* ESTADO ABIERTO (CLAVE) */
.categoria.abierta .contenido {
    display: block;
}

/* ===============================
   SUBCATEGORÍAS
=============================== */
.subcategoria {
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
}

/* HEADER */
.subheader {
    background: #334155;
    color: white;
    padding: 14px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

/* CONTENIDO */
.subcategoria .subcontenido {
    display: none;
    padding: 15px;
    background: #f8fafc;
}

/* ESTADO ABIERTO */
.subcategoria.abierta .subcontenido {
    display: block;
}

/* ===============================
   ITEMS CHECK
=============================== */
.item-check {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
}

.item-check:hover {
    transform: scale(1.01);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.item-check span {
    font-weight: bold;
    word-break: break-word;
}

/* BOTONES BIEN / MAL */
.item-check label {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

/* COLORES */
.item-check label:nth-of-type(1) {
    background: #dcfce7;
}

.item-check label:nth-of-type(2) {
    background: #fee2e2;
}

/* RADIO OCULTO */
.item-check input[type="radio"] {
    display: none;
}

/* SELECCIÓN VISUAL */
.item-check label:has(input:checked) {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px #1e40af inset;
}

/* ===============================
   ESTADOS DEL ITEM
=============================== */
.item-check.bien {
    background: #dcfce7;
    border-left: 5px solid #22c55e;
}

.item-check.mal {
    background: #fee2e2;
    border-left: 5px solid #ef4444;
}

/* ===============================
   TEXTAREA FALLA
=============================== */
.comentario-falla {
    display: none; /* controlado por JS */
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 5px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* ===============================
   PROGRESO
=============================== */
.barra-contenedor {
    position: relative;
    width: 100%;
    height: 30px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

#barraProgreso,
#barraProgresoJaula {
    height: 100%;
    width: 0%;
    background: #22c55e;
    transition: width 0.3s ease;
}

#textoProgreso,
#textoProgresoJaula {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 0;
    left: 0;
    line-height: 30px;
    font-weight: bold;
    color: #111;
}

/* BOTONES TODO BIEN */
#btnTodoBien,
#btnTodoBienJaula {
    margin: 15px 0 25px 0;
    display: inline-block;
}

/* ===============================
   VALIDACIÓN VISUAL
=============================== */
input.error,
select.error {
    border: 2px solid #ef4444;
    background: #fee2e2;
}

input.correcto,
select.correcto {
    border: 2px solid #22c55e;
    background: #dcfce7;
}

/* ===============================
   RESPONSIVE
=============================== */
@media (max-width: 600px) {
    .item-check {
        grid-template-columns: 1fr;
    }

    .item-check label {
        justify-content: flex-start;
        width: 100%;
    }
}

.texto-evidencia {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}