/* RESET BÁSICO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BODY */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* mejor que height */
    padding: 20px;
}

/* CONTENEDOR PRINCIPAL */
.contenedor {
    background-color: #1e293b;
    padding: 25px;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* TITULOS */
h1 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.2rem;
    margin-top: 10px;
    border-top: 1px solid #334155;
    padding-top: 10px;
}

/* LABELS */
label {
    font-size: 0.9rem;
    color: #cbd5f5;
}

/* INPUTS */
input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #334155;
    background-color: #0f172a;
    color: white;
    font-size: 0.95rem;
    transition: 0.3s;
}

input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
}

/* BOTON */
button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #16a34a, #15803d);
}

/* RESULTADOS */
p {
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}

span {
    font-weight: bold;
    color: #22c55e;
}

/* ------------------ RESPONSIVE ------------------ */

/* TABLETS */
@media (max-width: 768px) {
    .contenedor {
        max-width: 90%;
        padding: 20px;
    }

    h1 {
        font-size: 1.4rem;
    }
}

/* CELULARES */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
    }

    .contenedor {
        width: 100%;
        border-radius: 12px;
        padding: 18px;
    }

    h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    input {
        font-size: 0.9rem;
        padding: 9px;
    }

    button {
        font-size: 0.95rem;
        padding: 10px;
    }

    p {
        font-size: 0.9rem;
    }
}

.mensaje-error {
    color: red;
    font-style: italic;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

/* animación tipo "alerta" */
.input-error {
    border: 2px solid red;
    animation: vibrar 0.2s linear 3;
}

@keyframes vibrar {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

::placeholder {
    color: #9ca3af;
    font-style: italic;
}