*{
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body{
    background: linear-gradient(135deg, #1c92d2, #f2fcfe);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* Evita que el contenedor pegue de los bordes en el tlf */
}

.contenedor{
    display: flex;
    gap: 30px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 850px;
}

.imagen img{
    width: 350px;
    max-width: 100%; /* Para que en tlf no se desborde */
    height: auto;
    border-radius: 15px;
}

.form{
    width: 400px;
    max-width: 100%;
}

.form h2{
    text-align: center;
    margin-bottom: 20px;
    color: #1c92d2;
}

.form label{
    font-weight: bold;
    font-size: 14px;
    display: block;
    margin-top: 10px;
}

.form input{
    width: 100%;
    height: 38px;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.form input:focus{
    outline: none;
    border-color: #1c92d2;
}

.form input[type=submit]{
    margin-top: 20px;
    background: #1c92d2;
    color: white;
    border: none;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
}

.form input[type=submit]:hover{
    background: #0d6efd;
}

.mensaje{
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.mensaje.ok{
    background: #d1e7dd;
    color: #0f5132;
}

.mensaje.error{
    background: #f8d7da;
    color: #842029;
}

/* ==========================================
   RESPONSIVE: DISPOSITIVOS MÓVILES
   ========================================== */
@media (max-width: 768px) {
    .contenedor {
        flex-direction: column; /* Pone la imagen arriba y el formulario abajo */
        gap: 15px;
        padding: 20px;
    }
    .imagen {
        text-align: center;
    }
    .imagen img {
        width: 100%;
        max-width: 280px; /* Tamaño controlado en teléfonos */
    }
    .form {
        width: 100%;
    }
}