/* Reset some styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Hacer que el body y html ocupen toda la pantalla y tengan fondo azul */
html, body {
    height: 100%;
    background-color: rgb(14, 57, 110);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Evitar scroll */
    overflow: hidden;
    padding: 20px;
}

/* Contenedor principal para centrar todo con flex column */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

/* Título centrado */
h1 {
    color: white;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 2.4rem;
    user-select: none;
    text-align: center;
}

/* La tarjeta blanca del login o registro */
.login-card {
    background-color: white;
    width: 100%;
    padding: 30px 25px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    margin: 2px;
    box-sizing: border-box;
}

/* Formulario */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #0e396e;
    font-size: 1rem;
    user-select: none;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.8px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: rgb(14, 57, 110);
    box-shadow: 0 0 6px rgb(14, 57, 110);
}

button {
    width: 100%;
    padding: 12px;
    background-color: rgb(14, 57, 110);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
}

button:hover {
    background-color: rgb(10, 45, 88);
}

/* Mensajes de error o éxito */
.message {
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    color: #d8000c; /* Rojo para error */
}

/* Texto para cambiar entre login y registro */
.switch-link {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    color: #0e396e;
    user-select: none;
}

.switch-link a {
    color: rgb(14, 57, 110);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.switch-link a:hover {
    color: rgb(10, 45, 88);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 380px) {
    .login-card {
        width: 90vw;
        padding: 20px 15px;
    }
    h1 {
        font-size: 1.7rem;
    }
}

/* Estilos para mensajes de error */
.error {
    color: #d8000c; /* Rojo para error */
    font-size: 14px;
    margin-top: 5px;
    display: none; /* Ocultos por defecto */
}

/* Estilos para resaltar campos con error */
.input-error {
    border: 2px solid #d8000c;
    box-shadow: 0 0 6px rgba(216, 0, 12, 0.5);
}