/* ========================================
   TRANSICIÓN DESDE MATRIX
======================================== */

#matrix {
    transition: opacity 1.2s ease;
}

#contador {
    transition: opacity 0.4s ease;
}

/* Oscurecer la lluvia cuando aparece la terminal */

body.terminal-activa #matrix {
    opacity: 0.18;
}

/* Ocultar el contador */

body.terminal-activa #contador {
    opacity: 0;
}


/* ========================================
   VENTANA DE TERMINAL
======================================== */

#terminal {

    position: fixed;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -47%);

    width: 85%;
    max-width: 680px;

    background: rgba(8, 8, 11, 0.94);

    border: 1px solid #512c3b;

    color: #c77d95;

    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.8s ease,
        transform 0.8s ease,
        visibility 0.8s;

    z-index: 10;

}


/* ========================================
   MOSTRAR TERMINAL
======================================== */

body.terminal-activa #terminal {

    opacity: 1;
    visibility: visible;

    transform: translate(-50%, -50%);

}


/* ========================================
   CABECERA
======================================== */

.terminal-header {

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 12px 18px;

    border-bottom: 1px solid #512c3b;

    color: #d6a0b1;

    font-size: 12px;
    letter-spacing: 1px;

}

.terminal-version {
    color: #805365;
}


/* ========================================
   CONTENIDO
======================================== */

#terminal-lines {

    padding: 25px;

    min-height: 270px;

    line-height: 2;

}

.terminal-line {
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}


/* ========================================
   CURSOR
======================================== */

#terminal-lines::after {

    content: "█";

    color: #c77d95;

    animation: parpadeo 1s infinite;

}

@keyframes parpadeo {

    0%, 49% {
        opacity: 1;
    }

    50%, 100% {
        opacity: 0;
    }

}


/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 600px) {

    #terminal {
        width: 92%;
        font-size: 12px;
    }

    #terminal-lines {
        padding: 18px;
        min-height: 250px;
    }

    .terminal-header {
        padding: 12px;
    }

}

@media (prefers-reduced-motion: reduce) {

    #matrix,
    #contador,
    #terminal {
        transition: none;
    }

    #terminal-lines::after {
        animation: none;
    }

}
/* ========================================
   FORMULARIO DE VERIFICACIÓN
======================================== */

.terminal-form {

    display: flex;
    align-items: center;
    gap: 12px;

    margin: 15px 0;

    font-family: Consolas, monospace;

}

.terminal-form span {
    color: #c77d95;
}

.terminal-form input {

    flex: 1;
    min-width: 0;

    background: transparent;

    border: none;
    border-bottom: 1px solid #512c3b;

    outline: none;

    color: #d6a0b1;

    font-family: Consolas, monospace;
    font-size: 14px;

    padding: 8px 4px;

}

.terminal-form input:focus {
    border-bottom-color: #c77d95;
}

.terminal-form input::placeholder {
    color: #805365;
}

.terminal-form button {

    background: transparent;

    border: 1px solid #805365;

    color: #c77d95;

    padding: 8px 12px;

    font-family: Consolas, monospace;
    font-size: 12px;

    cursor: pointer;

    transition: background 0.2s ease;

}

.terminal-form button:hover {
    background: rgba(166, 77, 109, 0.15);
}


/* ========================================
   SCROLL DE LA TERMINAL
======================================== */

#terminal {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#terminal-lines {
    min-height: 0;
    max-height: 70vh;
    overflow-y: auto;
}

#terminal-lines::-webkit-scrollbar {
    width: 5px;
}

#terminal-lines::-webkit-scrollbar-thumb {
    background: #512c3b;
}