body {
    font-family: 'Poppins', sans-serif;
    background-color: #FFEB3B;
    background-image: url('../../img/front/fondo.jpeg'); /* Asegúrate que la ruta sea correcta desde el CSS */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    position: relative;
    box-sizing: border-box;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.auth-container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 50px 60px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    width: 450px;
    text-align: center;
    margin: 20px;
    position: relative;
    box-sizing: border-box;
}

.cerrar-formulario {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: red;
    font-size: 2.5em;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.3s ease, color 0.3s ease, transform 0.2s ease-in-out;
    z-index: 10;
}

.cerrar-formulario:hover {
    opacity: 1;
    color: #4d1f1f;
    transform: rotate(90deg);
}

.cerrar-formulario span {
    display: block;
}

#logo-container {
    margin-bottom: 20px;
}

#logo-container img {
    max-width: 160px;
    height: auto;
}

.form-header {
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
    font-weight: 700;
}

.form-group {
    margin-bottom: 12px; /* Mantenemos este margen para el espaciado general */
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: #555;
    font-weight: 600;
    font-size: 0.9em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: calc(100% - 18px);
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease; /* Transiciones para los nuevos estilos */
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: #F5EE1F;
    outline: none;
    box-shadow: 0 0 5px rgba(245, 238, 31, 0.5);
}

/* --- ESTILOS PARA MENSAJES DE ERROR --- */
.error-message {
    color: #e3342f; /* Rojo vibrante para errores */
    font-size: 0.8em; /* Tamaño de fuente ligeramente más pequeño */
    margin-top: 4px; /* Espacio superior para separarlo del input */
    margin-bottom: 8px; /* Más espacio debajo para no pegarse al siguiente campo */
    display: block; /* Asegura que cada error ocupe su propia línea */
    text-align: left; /* Alineado con el texto del input */
    padding-left: 2px; /* Pequeño padding para que no se pegue al borde izquierdo */
    font-weight: 500; /* Ligeramente más grueso para visibilidad */
    opacity: 0.95; /* Ligera transparencia */
    animation: fadeIn 0.3s ease-out; /* Animación para que aparezcan suavemente */
}

/* Animación de desvanecimiento para mensajes de error */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px); /* Desliza ligeramente hacia arriba al aparecer */
    }
    to {
        opacity: 0.95;
        transform: translateY(0);
    }
}

/* --- ESTILOS PARA INPUTS CON ERROR (cuando tienen la clase 'is-invalid') --- */
.form-group input.is-invalid {
    border-color: #e3342f; /* Borde rojo que coincide con el color del texto del error */
    box-shadow: 0 0 0 0.2rem rgba(227, 52, 47, 0.25); /* Un suave "glow" rojo */
    background-color: rgba(227, 52, 47, 0.05); /* Un fondo muy sutilmente rosado */
}


button[type="submit"] {
    background-color: #F5EE1F;
    color: #222;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

button[type="submit"]:hover {
    background-color: #e0d91c;
    transform: translateY(-2px);
}

.auth-links {
    margin-top: 15px;
    color: #777;
    font-size: 0.9em;
}

.auth-links a {
    color: #F5EE1F;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #e0d91c;
    text-decoration: underline;
}

/* Media Queries para hacerlo responsive */
@media (max-width: 600px) {
    body {
        align-items: center;
        padding-top: 20px;
        padding-bottom: 20px;
        background-size: cover;
        background-position: top center;
    }

    .auth-container {
        width: 85%;
        margin: 30px auto;
        padding: 25px;
    }

    #logo-container {
        margin-bottom: 15px;
    }

    #logo-container img {
        max-width: 120px;
    }

    .form-header {
        font-size: 1.6em;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        font-size: 0.85em;
    }

    .form-group input {
        padding: 8px;
        font-size: 0.85em;
    }

    button[type="submit"] {
        font-size: 0.9em;
        padding: 12px 18px;
    }

    .auth-links {
        font-size: 0.75em;
        margin-top: 10px;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .auth-container {
        width: 65%;
    }
}