.login-page, .register-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 2rem 1rem;
}

:root {
    --bg-file-light: url("/assets/images/bg-login.light.jpg");
    --bg-file-dark: url("/assets/images/bg-login.dark.jpg");
}

.login-page, .register-page {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: inherit;
}

.login-page::before, .login-page::after,
.register-page::before, .register-page::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    transition: opacity 1s ease-in-out; /* Durata della transizione */
    z-index: -1;
}

.login-page::before, .register-page::before {
    background-image: var(--bg-file-light);
    opacity: 1; /* Immagine di sfondo predefinita visibile */
}

.login-page::after, .register-page::after {
    background-image: var(--bg-file-dark);
    opacity: 0; /* Immagine di sfondo in dark mode nascosta */
}

[data-bs-theme="dark"] .login-page::before,
[data-bs-theme="dark"] .register-page::before {
    opacity: 0;
}

[data-bs-theme="dark"] .login-page::after,
[data-bs-theme="dark"] .register-page::after {
    opacity: 1;
}

/* set min-width only if not mobile view */
@media only screen and (min-width: 768px) {
    .login-page .card {
        min-width: 30rem;
    }
}

@media only screen and (max-width: 768px) {
    .login-page .card {
        min-width: 90%;
    }
}

/* Stili specifici per la pagina di registrazione */
.register-page {
    justify-content: flex-start;
    padding-top: 1rem;
}

.register-page .card {
    max-width: 800px;
    width: 100%;
    margin-bottom: 2rem;
}

@media only screen and (max-width: 768px) {
    .register-page .card {
        margin: 1rem;
        max-width: none;
    }
}

/* Fix per Select2 con input-group */
.select2-container {
    width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    min-height: 38px;
}

.select2-container--bootstrap-5 .select2-selection--single {
    height: 38px;
    line-height: 36px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding-left: 12px;
    padding-right: 20px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 8px;
}

/* Fix per input-group con Select2 */
.input-group .select2-container {
    flex: 1 1 auto;
    width: 1% !important;
}

.input-group .select2-container .select2-selection {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0;
}

.input-group .select2-container .select2-selection:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}