/* ==========================================================================
   Autenticación y privacidad - Responsive institucional V5
   ========================================================================== */
html {
    min-height: 100%;
}

body.auth-page {
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-text-size-adjust: 100%;
}

.auth-page img,
.auth-page svg {
    max-width: 100%;
}

.auth-page .login-wrapper {
    max-width: 900px;
    min-height: min(520px, calc(100dvh - 32px));
}

.auth-page .brand-section {
    min-width: 0;
}

.auth-page .brand-section h2,
.auth-page .brand-section p,
.auth-page .form-card,
.auth-page .form-card p,
.auth-page label,
.auth-page .alert {
    overflow-wrap: anywhere;
}

.auth-page .logo-img {
    width: 138px;
    height: 172px;
    object-fit: contain !important;
    object-position: center;
}

.auth-page .form-card h3 {
    letter-spacing: -.025em;
}

.auth-page .input-group {
    flex-wrap: nowrap;
}

.auth-page .input-group > .form-control {
    min-width: 0;
}

.auth-page .password-input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100%;
}

.auth-page .password-input-group > .form-control {
    width: 1% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.auth-page .password-input-group > .btn,
.auth-page .password-input-group > .input-group-text {
    width: auto !important;
    min-width: 44px;
    flex: 0 0 auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: .75rem;
}

.auth-page .register-card,
.auth-page .privacy-shell,
.auth-page .policy {
    width: calc(100% - 24px);
}

.auth-register-page {
    align-items: flex-start !important;
    padding: 20px 0 !important;
}

.auth-register-page .register-card {
    margin-block: auto;
}

.privacy-consent-page,
.privacy-policy-page {
    padding: 18px 0;
}

@media (max-width: 768px) {
    body.auth-page {
        align-items: flex-start !important;
        justify-content: center !important;
        padding: 10px !important;
    }

    .auth-page .login-wrapper {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
        max-width: 432px !important;
        min-height: auto !important;
        margin: 0 auto;
        border-radius: 18px !important;
    }

    .auth-page .brand-section {
        padding: 15px 18px 16px !important;
    }

    .auth-page .brand-section::after {
        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 5px !important;
    }

    .auth-page .logo-img {
        width: 76px !important;
        height: 94px !important;
        margin-bottom: 8px !important;
        padding: 3px !important;
        border-width: 2px !important;
        border-radius: 11px !important;
        box-shadow: 0 5px 12px rgba(0, 0, 0, .18) !important;
    }

    .auth-page .brand-section h2 {
        max-width: 100%;
        margin: 0 0 4px !important;
        font-size: 1rem !important;
        line-height: 1.12 !important;
    }

    .auth-page .brand-section p {
        margin: 0 !important;
        font-size: .82rem !important;
        line-height: 1.28 !important;
    }

    .auth-page .form-section {
        padding: 20px 14px 18px !important;
        align-items: flex-start !important;
    }

    .auth-page .form-card {
        max-width: none !important;
    }

    .auth-page .form-card h3 {
        font-size: 1.5rem !important;
        line-height: 1.16 !important;
    }

    .auth-page .form-card > p,
    .auth-page .form-card .subtitle {
        font-size: .9rem;
        line-height: 1.4;
    }

    .auth-page .form-control,
    .auth-page .input-group-text,
    .auth-page .input-group .btn {
        min-height: 54px !important;
    }

    .auth-page .btn-login {
        min-height: 54px !important;
    }

    .auth-page .login-options {
        font-size: .86rem;
    }

    .auth-register-page {
        padding: 10px 0 !important;
    }

    .auth-register-page .container {
        padding-inline: 0;
    }

    .auth-register-page .register-card {
        width: 100%;
        border-radius: 17px;
    }

    .auth-register-page .register-header {
        padding: 20px 17px !important;
    }

    .auth-register-page .register-header h2 {
        font-size: 1.42rem;
    }

    .auth-register-page .register-card > .card-body {
        padding: 18px 16px !important;
    }

    .auth-register-page .consent-box {
        padding: 14px;
    }

    .auth-register-page form > .col-12:last-child {
        align-items: stretch !important;
        flex-direction: column-reverse;
    }

    .auth-register-page form > .col-12:last-child .btn {
        width: 100%;
    }

    .privacy-consent-page,
    .privacy-policy-page {
        padding: 0 !important;
    }

    .privacy-consent-page .privacy-shell,
    .privacy-policy-page .policy {
        width: 100%;
        max-width: none;
        margin: 0;
        min-height: 100dvh;
        border-radius: 0 !important;
    }

    .privacy-consent-page .privacy-brand {
        padding: 20px 16px !important;
        align-items: center !important;
        gap: 14px;
    }

    .privacy-consent-page .privacy-brand img {
        width: 58px !important;
        height: 72px !important;
        flex: 0 0 58px;
    }

    .privacy-consent-page .privacy-brand h1 {
        font-size: 1.28rem;
    }

    .privacy-consent-page .privacy-content {
        padding: 20px 16px !important;
    }

    .privacy-consent-page .privacy-text {
        padding: 16px !important;
    }

    .privacy-consent-page form > .d-flex:last-child,
    .privacy-consent-page form > .d-flex:last-child > .d-flex {
        width: 100%;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .privacy-consent-page form > .d-flex:last-child .btn {
        width: 100%;
    }

    .privacy-policy-page .policy-header {
        padding: 22px 17px !important;
    }

    .privacy-policy-page .policy-header h1 {
        font-size: 1.55rem;
        line-height: 1.18;
    }

    .privacy-policy-page .policy-body {
        padding: 22px 17px !important;
    }

    .privacy-policy-page .policy-footer {
        padding: 17px !important;
        align-items: stretch !important;
        flex-direction: column;
    }

    .privacy-policy-page .policy-footer .btn {
        width: 100%;
    }
}

@media (max-width: 380px) {
    body.auth-page {
        padding: 7px !important;
    }

    .auth-page .logo-img {
        width: 68px !important;
        height: 84px !important;
    }

    .auth-page .brand-section {
        padding: 12px 14px 14px !important;
    }

    .auth-page .brand-section h2 {
        font-size: .92rem !important;
    }

    .auth-page .form-section {
        padding: 17px 12px 15px !important;
    }

    .auth-page .form-card h3 {
        font-size: 1.38rem !important;
    }

    .auth-page .login-options {
        align-items: flex-start !important;
        flex-direction: column;
    }
}

@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
    body.auth-page {
        padding: 8px !important;
    }

    .auth-page .login-wrapper {
        grid-template-columns: 36% 64% !important;
        max-width: 900px !important;
    }

    .auth-page .brand-section {
        padding: 12px !important;
    }

    .auth-page .brand-section::after {
        top: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 5px !important;
        height: 100% !important;
    }

    .auth-page .logo-img {
        width: 70px !important;
        height: 86px !important;
    }

    .auth-page .form-section {
        padding: 16px 22px !important;
    }
}

/* Ajuste fino del acceso para igualar la proporción del sistema Biblioteca */
@media (min-width: 769px) {
    .auth-login-page .login-wrapper {
        min-height: min(500px, calc(100dvh - 24px));
    }

    .auth-login-page .brand-section {
        padding: 28px 26px;
    }

    .auth-login-page .logo-img {
        width: 124px;
        height: 154px;
        margin-bottom: 16px;
    }

    .auth-login-page .brand-section h2 {
        margin-bottom: 10px;
        font-size: 1.32rem;
    }

    .auth-login-page .brand-section p {
        font-size: 1rem;
    }

    .auth-login-page .form-section {
        padding: 32px 50px;
    }

    .auth-login-page .form-card h3 {
        font-size: 1.9rem;
    }

    .auth-login-page .form-card > p.mb-4 {
        margin-bottom: 1.25rem !important;
    }

    .auth-login-page .input-group.mb-3 {
        margin-bottom: .85rem !important;
    }

    .auth-login-page .login-options.mb-4 {
        margin-bottom: 1.15rem !important;
    }

    .auth-login-page .form-card > .text-center.mt-4 {
        margin-top: 1.15rem !important;
    }
}

@media (max-width: 768px) {
    .auth-login-page .brand-section {
        padding: 12px 16px 14px !important;
    }

    .auth-login-page .logo-img {
        width: 70px !important;
        height: 86px !important;
        margin-bottom: 6px !important;
    }

    .auth-login-page .brand-section h2 {
        font-size: .96rem !important;
        margin-bottom: 3px !important;
    }

    .auth-login-page .brand-section p {
        font-size: .8rem !important;
    }

    .auth-login-page .form-section {
        padding: 17px 14px 14px !important;
    }

    .auth-login-page .form-card > p.mb-4 {
        margin-bottom: 1rem !important;
    }

    .auth-login-page .input-group.mb-3 {
        margin-bottom: .75rem !important;
    }

    .auth-login-page .login-options.mb-4 {
        margin-bottom: .85rem !important;
    }

    .auth-login-page form .text-center.mt-3 {
        margin-top: .65rem !important;
    }

    .auth-login-page .form-card > .text-center.mt-4 {
        margin-top: .85rem !important;
    }
}

@media (max-width: 380px) {
    .auth-login-page .login-options {
        flex-direction: row !important;
        align-items: center !important;
        gap: .4rem !important;
    }

    .auth-login-page .login-options a,
    .auth-login-page .login-options label {
        font-size: .72rem !important;
    }
}

/* Ajuste final para evitar barras de desplazamiento residuales en escritorio. */
@media (min-width: 769px) {
    body.auth-login-page {
        box-sizing: border-box;
        padding: 12px !important;
    }
}


/* ==========================================================
   V1.8 - Carga prioritaria del escudo de autenticación
   ========================================================== */
.auth-logo-picture {
    display: contents;
}

.auth-page .auth-logo-picture .logo-img {
    aspect-ratio: 320 / 409;
}

/* Refuerzo final para campos de clave con botones en una sola linea. */
.auth-page .password-input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
}

.auth-page .password-input-group > .form-control {
    width: 1% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.auth-page .password-input-group > .btn,
.auth-page .password-input-group > .input-group-text {
    width: auto !important;
    min-width: 44px;
    flex: 0 0 auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: .75rem;
}
