/* =====================================================
   PRÁCTICA 1.2 — PROGRAMACIÓN LÓGICA Y FUNCIONAL
   Estilos del laboratorio interactivo
===================================================== */

#practicaPLF12 {
    --plf12-primario: #6558e8;
    --plf12-primario-oscuro: #4f46b8;
    --plf12-secundario: #14b8a6;
    --plf12-verde: #16a34a;
    --plf12-verde-claro: #ecfdf3;
    --plf12-rojo: #dc2626;
    --plf12-rojo-claro: #fef2f2;
    --plf12-amarillo: #f59e0b;
    --plf12-fondo: #f5f7fb;
    --plf12-panel: #ffffff;
    --plf12-borde: #dfe4ef;
    --plf12-texto: #182033;
    --plf12-texto-suave: #606b80;
    --plf12-editor: #111827;
    --plf12-editor-borde: #293449;
    --plf12-sombra:
        0 15px 40px rgba(31, 41, 55, 0.08);

    width: 100%;
    color: var(--plf12-texto);
}

#practicaPLF12 * {
    box-sizing: border-box;
}

/* Botón que aparecerá en la ruta de la Unidad 1 */

.plf12-boton-abrir {
    margin-top: 0.8rem;
}

/* Encabezado */

.plf12-encabezado {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(220px, 290px);
    align-items: center;
    gap: 2rem;
    margin: 1.5rem 0;
    padding: 1.8rem;
    border: 1px solid var(--plf12-borde);
    border-radius: 24px;
    background:
        radial-gradient(
            circle at top right,
            rgba(101, 88, 232, 0.18),
            transparent 42%
        ),
        linear-gradient(
            135deg,
            #ffffff,
            #f7f6ff
        );
    box-shadow: var(--plf12-sombra);
}

.plf12-encabezado h1 {
    margin:
        0.6rem
        0
        0.5rem;
    color: var(--plf12-texto);
    font-size: clamp(
        1.75rem,
        3vw,
        2.7rem
    );
    line-height: 1.08;
}

.plf12-encabezado .subtitulo {
    max-width: 720px;
    margin: 0;
    color: var(--plf12-texto-suave);
    font-size: 1.02rem;
    line-height: 1.65;
}

/* Progreso */

.plf12-progreso {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.2rem;
    border: 1px solid rgba(
        101,
        88,
        232,
        0.2
    );
    border-radius: 18px;
    background: rgba(
        255,
        255,
        255,
        0.82
    );
}

.plf12-progreso strong {
    color: var(--plf12-primario);
    font-size: 2.2rem;
    line-height: 1;
}

.plf12-progreso > span {
    color: var(--plf12-texto-suave);
    font-size: 0.86rem;
    font-weight: 700;
}

.plf12-barra {
    width: 100%;
    height: 10px;
    margin-top: 0.3rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e6e8f2;
}

.plf12-barra span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            var(--plf12-primario),
            var(--plf12-secundario)
        );
    transition:
        width 0.35s ease;
}

/* Identificación */

.plf12-identificacion {
    display: grid;
    grid-template-columns:
        minmax(0, 2fr)
        minmax(180px, 1fr);
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding: 1.2rem;
    border: 1px solid var(--plf12-borde);
    border-radius: 18px;
    background: var(--plf12-panel);
}

.plf12-identificacion label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: var(--plf12-texto);
    font-size: 0.86rem;
    font-weight: 800;
}

.plf12-identificacion input,
.plf12-identificacion select {
    width: 100%;
    min-height: 46px;
    padding: 0.75rem 0.9rem;
    border: 1px solid #cfd5e2;
    border-radius: 12px;
    outline: none;
    background: #ffffff;
    color: var(--plf12-texto);
    font: inherit;
    font-weight: 500;
}

.plf12-identificacion input:focus,
.plf12-identificacion select:focus {
    border-color: var(--plf12-primario);
    box-shadow:
        0 0 0 4px
        rgba(101, 88, 232, 0.13);
}

/* Navegación por etapas */

.plf12-navegacion {
    display: grid;
    grid-template-columns:
        repeat(
            6,
            minmax(145px, 1fr)
        );
    gap: 0.7rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.35rem;
    overflow-x: auto;
}

.plf12-navegacion button {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 68px;
    padding: 0.75rem;
    border: 1px solid var(--plf12-borde);
    border-radius: 14px;
    background: var(--plf12-panel);
    color: var(--plf12-texto-suave);
    text-align: left;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.plf12-navegacion button:hover {
    transform: translateY(-2px);
    border-color: var(--plf12-primario);
    box-shadow:
        0 9px 20px
        rgba(31, 41, 55, 0.08);
}

.plf12-navegacion button.activo {
    border-color: var(--plf12-primario);
    background:
        linear-gradient(
            135deg,
            #f1efff,
            #ffffff
        );
    color: var(--plf12-primario-oscuro);
    box-shadow:
        0 8px 22px
        rgba(101, 88, 232, 0.15);
}

.plf12-navegacion button.superada {
    border-color: #86d5a1;
    background: var(--plf12-verde-claro);
}

.plf12-navegacion button.superada.activo {
    border-color: var(--plf12-verde);
    background:
        linear-gradient(
            135deg,
            #dcfce7,
            #ffffff
        );
}

.plf12-numero-etapa {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    background: #edeffc;
    color: var(--plf12-primario);
    font-weight: 900;
}

.plf12-navegacion button.activo
.plf12-numero-etapa {
    background: var(--plf12-primario);
    color: #ffffff;
}

.plf12-navegacion button.superada
.plf12-numero-etapa {
    background: var(--plf12-verde);
    color: #ffffff;
}

.plf12-nombre-etapa {
    display: block;
    min-width: 0;
    font-size: 0.77rem;
    font-weight: 800;
    line-height: 1.25;
}

/* Área de trabajo */

.plf12-area-trabajo {
    display: grid;
    grid-template-columns:
        minmax(250px, 0.82fr)
        minmax(0, 1.55fr);
    gap: 1.2rem;
    align-items: stretch;
}

.plf12-instrucciones,
.plf12-programador {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--plf12-borde);
    border-radius: 20px;
    background: var(--plf12-panel);
    box-shadow: var(--plf12-sombra);
}

.plf12-instrucciones {
    padding: 1.5rem;
}

.plf12-tema {
    display: inline-block;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #eeecff;
    color: var(--plf12-primario-oscuro);
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.plf12-instrucciones h2 {
    margin:
        0
        0
        0.7rem;
    color: var(--plf12-texto);
    font-size: 1.5rem;
    line-height: 1.2;
}

.plf12-instrucciones > p {
    color: var(--plf12-texto-suave);
    line-height: 1.65;
}

.plf12-instrucciones ol {
    margin:
        1.2rem
        0;
    padding-left: 1.4rem;
}

.plf12-instrucciones li {
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
    color: #3f495c;
    line-height: 1.5;
}

.plf12-instrucciones li::marker {
    color: var(--plf12-primario);
    font-weight: 900;
}

/* Botones secundarios */

.plf12-boton-secundario {
    min-height: 42px;
    padding: 0.65rem 1rem;
    border: 1px solid #cfd5e2;
    border-radius: 11px;
    background: #ffffff;
    color: #40495d;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.plf12-boton-secundario:hover {
    transform: translateY(-1px);
    border-color: var(--plf12-primario);
    background: #f4f2ff;
    color: var(--plf12-primario-oscuro);
}

.plf12-boton-secundario:disabled,
#practicaPLF12 button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.plf12-pista {
    margin-top: 1rem;
    padding: 1rem;
    border-left: 4px solid var(--plf12-amarillo);
    border-radius: 0 12px 12px 0;
    background: #fffbeb;
    color: #785812 !important;
    line-height: 1.55;
}

/* Editor */

.plf12-programador {
    display: flex;
    flex-direction: column;
    background: var(--plf12-editor);
    border-color: var(--plf12-editor-borde);
}

.plf12-editor-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--plf12-editor-borde);
    background: #182235;
    color: #cbd5e1;
    font-family:
        Consolas,
        "Courier New",
        monospace;
    font-size: 0.85rem;
}

.plf12-editor-cabecera span::before {
    content: "●";
    margin-right: 0.55rem;
    color: var(--plf12-secundario);
}

.plf12-editor-cabecera button {
    padding: 0.4rem 0.7rem;
    border: 1px solid #40506a;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    font: inherit;
    cursor: pointer;
}

.plf12-editor-cabecera button:hover {
    border-color: #f59e0b;
    color: #fbbf24;
}

.plf12-label-editor {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

#codigoPLF12 {
    display: block;
    flex: 1;
    width: 100%;
    min-height: 470px;
    resize: vertical;
    padding: 1.2rem;
    border: 0;
    outline: none;
    background: var(--plf12-editor);
    color: #e5e7eb;
    caret-color: #5eead4;
    font-family:
        Consolas,
        Monaco,
        "Courier New",
        monospace;
    font-size: 0.92rem;
    line-height: 1.62;
    tab-size: 4;
    white-space: pre;
}

#codigoPLF12:focus {
    box-shadow:
        inset 0 0 0 2px
        rgba(94, 234, 212, 0.35);
}

.plf12-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    padding: 1rem;
    border-top: 1px solid var(--plf12-editor-borde);
    background: #182235;
}

.plf12-acciones
.plf12-boton-secundario {
    border-color: #475569;
    background: #202c40;
    color: #e2e8f0;
}

.plf12-acciones
.plf12-boton-secundario:hover {
    border-color: var(--plf12-secundario);
    background: #26364c;
    color: #5eead4;
}

#practicaPLF12 .boton-principal {
    border: 0;
    border-radius: 11px;
    background:
        linear-gradient(
            135deg,
            var(--plf12-primario),
            var(--plf12-primario-oscuro)
        );
    color: #ffffff;
    font-weight: 850;
    box-shadow:
        0 8px 18px
        rgba(101, 88, 232, 0.22);
}

#practicaPLF12 .boton-principal:hover {
    transform: translateY(-1px);
    box-shadow:
        0 11px 23px
        rgba(101, 88, 232, 0.3);
}

/* Consola y pruebas */

.plf12-resultados-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.plf12-consola,
.plf12-pruebas {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--plf12-borde);
    border-radius: 18px;
    background: var(--plf12-panel);
    box-shadow: var(--plf12-sombra);
}

.plf12-consola h3,
.plf12-pruebas h3 {
    margin: 0;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--plf12-borde);
    color: var(--plf12-texto);
    font-size: 0.95rem;
}

#consolaPLF12 {
    min-height: 190px;
    max-height: 350px;
    margin: 0;
    padding: 1rem;
    overflow: auto;
    background: #0b1220;
    color: #b9f6df;
    font-family:
        Consolas,
        Monaco,
        monospace;
    font-size: 0.83rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#pruebasPLF12 {
    min-height: 190px;
    max-height: 350px;
    padding: 1rem;
    overflow: auto;
    color: var(--plf12-texto-suave);
    line-height: 1.5;
}

.plf12-lista-pruebas {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.plf12-lista-pruebas li {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.75rem;
    border: 1px solid transparent;
    border-radius: 11px;
}

.plf12-lista-pruebas
li.correcta {
    border-color: #bbf7d0;
    background: var(--plf12-verde-claro);
    color: #166534;
}

.plf12-lista-pruebas
li.incorrecta {
    border-color: #fecaca;
    background: var(--plf12-rojo-claro);
    color: #991b1b;
}

.plf12-lista-pruebas strong {
    font-size: 0.87rem;
}

.plf12-lista-pruebas span {
    font-family:
        Consolas,
        Monaco,
        monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Pie de la práctica */

.plf12-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 1.2rem;
    padding: 1rem;
    border: 1px solid var(--plf12-borde);
    border-radius: 16px;
    background: var(--plf12-panel);
}

.plf12-nota {
    margin:
        1rem
        0
        0;
    padding: 0.8rem;
    color: var(--plf12-texto-suave);
    font-size: 0.8rem;
    text-align: center;
}

/* Accesibilidad */

#practicaPLF12 button:focus-visible,
#practicaPLF12 input:focus-visible,
#practicaPLF12 select:focus-visible,
#codigoPLF12:focus-visible {
    outline:
        3px solid
        rgba(20, 184, 166, 0.45);
    outline-offset: 2px;
}

/* Tabletas */

@media (max-width: 980px) {
    .plf12-encabezado {
        grid-template-columns: 1fr;
    }

    .plf12-area-trabajo {
        grid-template-columns: 1fr;
    }

    .plf12-instrucciones {
        order: 1;
    }

    .plf12-programador {
        order: 2;
    }

    #codigoPLF12 {
        min-height: 430px;
    }
}

/* Teléfonos */

@media (max-width: 700px) {
    .plf12-encabezado {
        gap: 1.2rem;
        padding: 1.2rem;
        border-radius: 18px;
    }

    .plf12-identificacion {
        grid-template-columns: 1fr;
    }

    .plf12-resultados-grid {
        grid-template-columns: 1fr;
    }

    .plf12-acciones {
        flex-direction: column;
    }

    .plf12-acciones button {
        width: 100%;
    }

    .plf12-pie {
        display: grid;
        grid-template-columns:
            1fr
            1fr;
    }

    #descargarEvidenciaPLF12 {
        grid-column:
            1
            / -1;
        grid-row: 2;
    }

    #codigoPLF12 {
        min-height: 390px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .plf12-pie {
        grid-template-columns: 1fr;
    }

    #descargarEvidenciaPLF12 {
        grid-column: auto;
        grid-row: auto;
    }

    .plf12-pie button {
        width: 100%;
    }

    .plf12-navegacion {
        grid-template-columns:
            repeat(
                6,
                minmax(135px, 1fr)
            );
    }
}