/* =========================
   LOGIN CONTAINER - VERSIONE CORRETTA
========================= */
.t-PageBody--login .t-Login-container {
    width: 90%; /* Allargato dal 60% */
    min-width: 520px;
    max-width: 850px; /* Aumentato da 720px */
    min-height: 600px;
    max-height: 95vh;
    margin: 0 auto; /* RIMOSSO margine top - fissato in alto */
    background: white;
    padding: 25px 35px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
    border-left: 5px solid #033c6a;
    border-right: 5px solid #033c6a;
    border-bottom: 5px solid #033c6a;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

/* =========================
   HEADER LOGIN - SEMPRE CENTRATO
========================= */
.W1Q_LOGIN_HEADER {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.W1Q_LOGIN_LOGO_WRAP {
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

.W1Q_LOGIN_LOGO {
    width: 50%; /* RIDOTTO dall'80% */
    max-width: 220px; /* RIDOTTO da 260px */
    height: auto;
    margin: 0 auto 1rem auto; /* Centrato con auto */
    display: block; /* IMPORTANTE per centrare con margin auto */
}

.W1Q_LOGIN_HINT {
    color: #033c6a;
    font-size: .95rem;
    line-height: 1.4;
    text-align: center; /* SEMPRE centrato */
    margin: 0 auto;
    max-width: 90%; /* Limita larghezza testo */
}

/* Messaggio di servizio centrato */
.W1Q_LOGIN_HEADER > div:first-child {
    text-align: center;
}

/* =========================
   BODY E HTML - CORRETTO
========================= */
html, body {
    height: 100%;
    overflow: hidden;
}

.t-PageBody--login {
    min-height: 100vh;
    display: flex;
    align-items: flex-start; /* CAMBIATO da center a flex-start per fissare in alto */
    justify-content: center;
    padding: 0;
    overflow-y: auto;
}

/* =========================
   RESPONSIVE TABLET
========================= */
@media (max-width: 1110px) {
    .t-PageBody--login .t-Login-container {
        width: 80%; /* Ristretto dal 90% */
        min-width: unset;
        max-width: unset;
        padding: 25px 30px;
        min-height: 500px;
    }
    
    .W1Q_LOGIN_LOGO {
        width: 55%;
        max-width: 200px;
    }
}

/* =========================
   RESPONSIVE MOBILE
========================= */
@media (max-width: 768px) {
    .t-PageBody--login .t-Login-container {
        width: 88%; /* Ristretto dal 95% */
        margin: 0 auto;
        padding: 20px 18px;
        min-height: unset;
        max-height: 98vh;
        border-radius: 0 0 15px 15px;
        border-left-width: 4px; /* Bordi leggermente ridotti */
        border-right-width: 4px;
    }
    
    .W1Q_LOGIN_LOGO {
        width: 60%; /* Ridotto dal 70% */
        max-width: 180px; /* Ridotto da 200px */
        margin-bottom: 0.5rem;
    }
    
    .W1Q_LOGIN_HINT {
        font-size: 0.85rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        max-width: 95%;
    }
    
    .W1Q_LOGIN_HEADER {
        margin-bottom: 1rem;
    }
    
    .t-Form-fieldContainer {
        margin-bottom: 1rem !important;
    }
    
    .W1Q_FOOTER_LOGIN {
        padding: 8px 5px;
        font-size: 0.7rem;
    }
    
    .W1Q_FOOTER_LOGIN_CONTAINER {
        margin-bottom: 2px;
    }
    
    .W1Q_FOOTER_LOGIN img {
        height: 16px !important;
    }
}

/* =========================
   RESPONSIVE SMARTPHONE (< 480px)
========================= */
@media (max-width: 480px) {
    .t-PageBody--login .t-Login-container {
        width: 85%; /* Ridotto da 96% */
        padding: 18px 15px;
        border-left-width: 3px;
        border-right-width: 3px;
        border-bottom-width: 3px;
    }
    
    .W1Q_LOGIN_LOGO {
        width: 58%;
        max-width: 170px;
    }
    
    .W1Q_LOGIN_HINT {
        font-size: 0.82rem;
    }
}

/* =========================
   RESPONSIVE SCHERMI MOLTO PICCOLI (< 375px)
   iPhone SE, iPhone 5/5S, Galaxy Fold
========================= */
@media (max-width: 375px) {
    .t-PageBody--login .t-Login-container {
        width: 85%; /* Pił largo per evitare tagli */
        padding: 15px 12px; /* Padding ridotto */
        border-left-width: 2px; /* Bordi pił sottili */
        border-right-width: 2px;
        border-bottom-width: 3px;
    }
    
    .W1Q_LOGIN_LOGO {
        width: 55%;
        max-width: 150px;
    }
    
    .W1Q_LOGIN_HINT {
        font-size: 0.78rem;
        line-height: 1.25;
    }
    
    .W1Q_FOOTER_LOGIN {
        font-size: 0.62rem;
        padding: 6px 2px;
    }
    
    .W1Q_FOOTER_LOGIN img {
        height: 14px !important;
    }
    
    /* Form pił compatto */
    .t-Form-labelContainer,
    .t-Form-inputContainer {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* =========================
   RESPONSIVE SCHERMI ESTREMI (< 320px)
   iPhone SE (1a gen), dispositivi molto vecchi
========================= */
@media (max-width: 350px) {
    .t-PageBody--login .t-Login-container {
        width: 75%; /* Quasi full width */
        padding: 12px 10px;
        border-left-width: 2px;
        border-right-width: 2px;
        border-bottom-width: 2px;
        border-radius: 0 0 10px 10px;
    }
    
    .W1Q_LOGIN_LOGO {
        width: 52%;
        max-width: 130px;
    }
    
    .W1Q_LOGIN_HINT {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .W1Q_FOOTER_LOGIN {
        font-size: 0.6rem;
        padding: 5px 2px;
    }
    
    .W1Q_FOOTER_LOGIN img {
        height: 12px !important;
    }
    
    .t-Form-fieldContainer {
        margin-bottom: 0.8rem !important;
    }
}

/* =========================
   ALTEZZA VIEWPORT RIDOTTA
========================= */
@media (max-height: 700px) {
    .t-PageBody--login .t-Login-container {
        margin: 0 auto; /* RIMOSSO margine verticale */
        max-height: 98vh;
        min-height: unset;
    }
    
    .W1Q_LOGIN_LOGO {
        margin-bottom: 0.5rem;
        max-width: 180px;
    }
    
    .W1Q_LOGIN_HEADER {
        margin-bottom: 0.8rem;
    }
    
    .t-Form-fieldContainer {
        margin-bottom: 0.8rem !important;
    }
}

@media (max-height: 600px) {
    .t-PageBody--login .t-Login-container {
        padding: 15px 30px;
    }
    
    .W1Q_LOGIN_LOGO {
        max-width: 160px; /* Ridotto da 180px */
        width: 45%;
    }
    
    .W1Q_LOGIN_HINT {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .W1Q_FOOTER_LOGIN {
        padding: 6px;
        font-size: 0.7rem;
    }
}

/* =========================
   LANDSCAPE MOBILE
========================= */
@media (max-height: 500px) and (orientation: landscape) {
    .t-PageBody--login .t-Login-container {
        max-height: 96vh;
        padding: 10px 25px;
        width: 85%; /* Pił stretto in landscape */
    }
    
    .W1Q_LOGIN_LOGO {
        max-width: 140px; /* Ridotto da 150px */
        width: 40%;
        margin-bottom: 0.3rem;
    }
    
    .W1Q_LOGIN_HINT {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }
    
    .W1Q_LOGIN_HEADER {
        margin-bottom: 0.5rem;
    }
    
    .t-Form-fieldContainer {
        margin-bottom: 0.5rem !important;
    }
    
    .W1Q_ADDITIONAL_INFO {
        margin-top: 0.3rem;
        font-size: 0.85rem;
    }
}

/* Container body deve essere scrollabile se necessario */
.t-Login-containerBody {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Footer sempre in fondo */
.t-Login-containerFooter {
    flex-shrink: 0;
}

/* =========================
   BACKGROUND / CAROUSEL
========================= */
#W1Q_CAROUSEL {
    position: fixed;
    width: 100%;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 0;
}

.W1Q_CAROUSEL_IMG {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.W1Q_CAROUSEL_IMG_1 { background-image: url('/i/w1q_2026/img/login_carousel/1.jpg'); }
.W1Q_CAROUSEL_IMG_2 { background-image: url('/i/w1q_2026/img/login_carousel/2.jpg'); }
.W1Q_CAROUSEL_IMG_3 { background-image: url('/i/w1q_2026/img/login_carousel/3.jpg'); }
.W1Q_CAROUSEL_IMG_4 { background-image: url('/i/w1q_2026/img/login_carousel/4.jpg'); }
.W1Q_CAROUSEL_IMG_5 { background-image: url('/i/w1q_2026/img/login_carousel/5.jpg'); }

#W1Q_CAROUSEL_MASK {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1;
    height: 100vh;
}

.active { 
    display: block;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.not_active { 
    display: none;
    opacity: 0;
}

/* =========================
   FORM FIELDS
========================= */
.W1Q_LOGIN_LABEL .t-Form-label {
    color: #033c6a !important;
    font-size: 1.0em !important;
}

.t-Button--stretch {
    margin: 0;
}

/* =========================
   LOGIN BUTTON
========================= */
#P101_LOGIN {
    background-color: #1e85d8;
    color: #ffffff;
    transition: all .2s ease;
}

#P101_LOGIN:hover {
    background-color: #4fb0ff;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0,0,0,.2);
}

/* =========================
   ADDITIONAL INFO / RESET PASSWORD
========================= */
.W1Q_ADDITIONAL_INFO {
    margin-top: .7rem;
    font-size: 1rem;
    text-align: center;
}

.W1Q_LINK_RESET {
    color: #1e85d8;
    text-decoration: none;
}

.W1Q_LINK_RESET:hover {
    text-decoration: underline;
}

/* =========================
   FOOTER LOGIN
========================= */
.W1Q_FOOTER_LOGIN {
    border-top: 1px solid #00000014;
    padding: 10px;
    text-align: center;
    font-size: .8rem;
}

.W1Q_FOOTER_LOGIN_CONTAINER {
    margin-bottom: 3px;
}

.W1Q_FOOTER_LOGIN a {
    color: inherit;
    text-decoration: none;
}

.W1Q_FOOTER_LOGIN a:hover {
    text-decoration: underline;
}

/* =========================
   ALERT / ERROR MESSAGE
========================= */
.t-Body-alert .t-Alert {
    margin-bottom: 1rem;
}

/* =========================
   SCROLLBAR PERSONALIZZATA
========================= */
.t-Login-containerBody::-webkit-scrollbar {
    width: 8px;
}

.t-Login-containerBody::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.t-Login-containerBody::-webkit-scrollbar-thumb {
    background: #1e85d8;
    border-radius: 10px;
}

.t-Login-containerBody::-webkit-scrollbar-thumb:hover {
    background: #033c6a;
}