/* =====================================================
   VARIABLES DE COLOR
===================================================== */
:root {
    --azul-principal: #0d3b66;
    --azul-oscuro: #092a4a;
    --azul-claro: #e0ecff;
}

/* =====================================================
   BASE
===================================================== */
html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f9;
}

#bodyLogin {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   ANIMACIÓN
===================================================== */
@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   CONTENEDOR LOGIN
===================================================== */
#divLogin {
    background: #ffffff;
    padding: 30px 35px;
    border-radius: 14px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
    animation: loginFadeIn 0.35s ease-out;
    box-sizing: border-box;
}

/* Título */
#divLogin h1 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 22px;
    font-weight: 600;
    color: var(--azul-principal);
}

/* =====================================================
   CONTENIDO
===================================================== */
#divContentPane {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
}

#divLeftPane, #divRightPane {
    flex: 1;
}

#divRightPane {
    display: flex;
    justify-content: center;
}

#divRightPane img {
    max-width: 150px;
    height: auto;
}

/* =====================================================
   FORMULARIO
===================================================== */
.form-group {
    margin-bottom: 15px;
}

label {
    font-size: 13px;
    color: #333;
}

.form-control {
    border-radius: 8px;
    width: 100%;
    padding: 6px 10px;
    box-sizing: border-box;
}

/* =====================================================
   BOTÓN UNIFICADO
===================================================== */
.button.primarybtn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    background-color: var(--azul-principal);
    border: 1px solid var(--azul-principal);
    color: #fff;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.button.primarybtn:hover {
    background-color: var(--azul-oscuro);
    border-color: var(--azul-oscuro);
}

/* =====================================================
   MENSAJES
===================================================== */
#divMensaje {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #666;
}

.errorText {
    display: block;
    margin-top: 10px;
    color: #d9534f;
    font-size: 12px;
    text-align: center;
}

/* =====================================================
   BOTÓN LOADING
===================================================== */
.button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.button.loading::after {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   RESPONSIVE (MÓVIL / TABLET)
===================================================== */
@media (max-width: 768px) {

    #divLogin {
        padding: 20px 15px;
        max-width: 350px;
    }

    #divLogin h1 {
        font-size: 18px;
    }

    #divContentPane {
        flex-direction: column; /* apila logo y formulario */
        align-items: center;
        gap: 20px;
    }

    #divRightPane {
        order: -1; /* mueve logo arriba */
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #divRightPane img {
        max-width: 120px;
    }

    #divLeftPane {
        width: 100%;
    }

    .form-control {
        width: 100% !important;
    }

    .button.primarybtn {
        width: 100%;
    }
}
