body {
    font-family: 'Nunito', sans-serif;
    color: #fff;
    font-size: 16px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.main_container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Changed from space-between to allow natural flow */
    align-items: center;
    width: 100%;
    min-height: 100vh;
    /* Changed to min-height for mobile screens */
    background-color: #0f172a;
    /* Midnight Blue fallback */
    background-image: url('../images/bg_login.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    /* Cover is better for responsiveness */
    background-position: center;
    /* Center the background */
    background-attachment: fixed;
    /* Keep background fixed on scroll */
}

.header_container {
    display: flex;
    justify-content: center;
    /* Center logo on mobile */
    align-items: center;
    width: 100%;
    min-height: 6rem;
    background-color: transparent;
    /* Changed to transparent, let background show */
    padding: 1rem;
    margin-bottom: 2rem;
}

.menu_container {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 90%;
    /* Mobile width */
    max-width: 450px;
    /* Constrain max width for larger phones/tablets */
    height: auto;
    background-color: rgba(15, 23, 42, 0.95);
    /* Midnight Blue with opacity */
    border-radius: 20px;
    padding: 2rem 1rem;
    margin-bottom: 3rem;
    /* Added margin-bottom to separate from footer */
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    /* Add subtle shadow */
}

.menu_container h1 {
    text-align: center;
    font-weight: bold;
    font-size: 1.8rem;
    /* Scaled down for mobile */
    margin-bottom: 0.5rem;
}

.divisor_rojo {
    display: flex;
    width: 3rem;
    height: 0.4rem;
    background-color: #991b1b;
    /* Blood Red */
    border-radius: 25px;
    margin-bottom: 1rem;
}

.white_container {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* Take full width of parent on mobile */
    height: auto;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    color: #000000;
}

form {
    width: 100%;
    /* Forms should take full width inside white container */
    display: flex;
    flex-direction: column;
    align-items: center;
}

form input,
select {
    width: 100%;
    /* Mobile first inputs */
    height: 3rem;
    /* Fixed height for touch targets */
    border-radius: 8px;
    /* Modern border radius */
    border: 1px solid #dfe0e0;
    padding: 0.5rem 1rem;
    font-size: 16px;
    /* Prevent iOS zoom */
    margin-bottom: 0.5rem;
    /* Space between inputs */
}

form input:focus,
select:focus {
    outline: none;
    border-color: #991b1b;
    /* Blood Red focus */
    box-shadow: 0 0 0 2px rgba(153, 27, 27, 0.2);
}

.form-group {
    width: 100%;
    margin-bottom: 1rem;
}

form button,
.button_submit {
    width: 100%;
    /* Full width button on mobile */
    height: 3rem;
    border-radius: 8px;
    background-color: #991b1b;
    /* Blood Red */
    color: #ffffff;
    font-weight: bold;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 1rem;
}

form button:hover,
.button_submit:hover {
    background-color: #7f1d1d;
    /* Darker Blood Red */
}

.button_registrarse {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* Full width mobile */
    height: 3rem;
    margin: 1rem 0;
    border-radius: 8px;
    background-color: transparent;
    border: 2px solid #991b1b;
    /* Blood Red Border */
    color: #ffffff;
    font-weight: bold;
    font-size: 15px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button_registrarse:hover {
    text-decoration: none;
    color: #ffffff;
    background-color: #991b1b;
    /* Solid Blood Red */
}

.login-text {
    color: #64748b;
    /* Sleeker gray */
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
}

.olvide_clave {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.olvide_clave a {
    text-decoration: none;
    color: #991b1b;
    /* Blood Red for links instead of yellow */
    font-weight: bold;
}

.olvide_clave a:visited {
    color: #7f1d1d;
    /* Darker Blood Red */
}

.error_login {
    border-radius: 8px;
    color: white;
    background: #991b1b;
    /* Blood red error */
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.boton_container {
    display: flex;
    width: 100%;
    justify-content: center;
    /* Center back button on mobile */
    margin-top: 1rem;
}

.boton_atras {
    background-color: #ffffff;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    color: #0f172a;
    /* Midnight blue text */
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.boton_atras:hover {
    text-decoration: none;
    color: #991b1b;
    /* Red hover */
}

.footer_container {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    /* Stack on mobile */
    align-items: center;
    width: 100%;
    min-height: 6rem;
    background-color: #ffffff;
    margin-top: auto;
    /* Push to bottom */
    padding: 1.5rem 1rem;
    color: #0f172a;
    /* Midnight Blue */
    text-align: center;
    font-size: 14px;
}

.footer_container .card {
    border: none;
    box-shadow: none;
}

.footer_container .card-title {
    color: #0f172a !important;
    /* Midnight blue font */
    font-weight: bold;
}

.footer_container a {
    color: #991b1b !important;
    /* Blood red phone link */
}

/* Tablet and Desktop Adjustments (Mobile First) */
@media (min-width: 768px) {
    .header_container {
        justify-content: space-between;
        /* Space out header on larger screens */
        padding: 1rem 4rem;
    }

    .menu_container {
        width: 35rem;
        /* Fixed width on larger screens */
        max-width: 100%;
        padding: 3rem 2.5rem;
    }

    .menu_container h1 {
        font-size: 2rem;
    }

    .white_container {
        width: 25rem;
        padding: 2rem;
    }

    .footer_container {
        flex-direction: row;
        /* Horizontal footer on larger screens */
        justify-content: center;
    }
}