/************************************************************************/
/* VARIABILI GLOBALI                                                     */
/************************************************************************/
:root {
    --W1Q_GREEN: #83ff83;
    --W1Q_ORANGE: #fbce4a;
    --W1Q_RED: #ff8383;
}

/************************************************************************/
/* UTILITY                                                              */
/************************************************************************/
.W1Q_HEIGHT_800PX {
    height: 800px;
    overflow: auto;
}

/************************************************************************/
/* HEADER UTENTE RESPONSIVE - VERSIONE STABILE DEFINITIVA              */
/************************************************************************/

/* HERO BASE */
.W1Q_HEADER {
    background-color: #d7e9f869;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.W1Q_HEADER.t-HeroRegion {
    padding: 0.6rem 0.75rem !important;
}

/* WRAP PRINCIPALE */
.W1Q_HEADER .t-HeroRegion-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/************************************************************************/
/* BLOCCO SINISTRO: AVATAR + NOME                                      */
/************************************************************************/

.W1Q_USER_INFO_WRAPPER {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2;
}

/* Avatar */
.W1Q_AVATAR {
    width: 5em;
    height: 5em;
    position: relative;
    flex-shrink: 0;
}

.W1Q_AVATAR_IMG {
    width: 100%;
    height: auto;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 1.5px #00000078;
}

/* Overlay switch avatar (come prima) */
.W1Q_AVATAR_SWITCH_OVERLAY {
    display:none;
    position: absolute;
    top: calc(100% - 2em);
    left: calc(100% - 2em);
    width: 2em;
    height: 2em;
    background-color: #043f6e;
    border-radius: 50%;
    padding: 8px;
}

.W1Q_AVATAR_SWITCH_OVERLAY span {
    color: white;
}

.W1Q_AVATAR_SWITCH_OVERLAY:hover {
    background-color: #1e85d8;
}

/* Nome utente (dimensioni originali) */
.W1Q_CURRENT_USER_NOMINATIVO {
    pointer-events: none;
    color: inherit;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 10;
}

/* quando diventa cliccabile */
.W1Q_CURRENT_USER_NOMINATIVO:hover {
    cursor: pointer;
    text-decoration: underline;
}

/************************************************************************/
/* BLOCCO DESTRO: CREDITI                                               */
/************************************************************************/

.W1Q_HEADER .t-HeroRegion-col--right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.t-HeroRegion-col--right {
    position: relative;
    z-index: 1;
}

/* Telegram */
.W1Q_AVATAR_TELEGRAM {
    display: none;
}

/* Tabella crediti */
.W1Q_AVATAR_INFO_TABLE {
    background-color: #ffffff;
    border: 2px solid #1877c4;
    border-radius: 10px; /* come prima */
}

.W1Q_AVATAR_INFO_TABLE td,
.W1Q_AVATAR_INFO_TABLE th {
    padding: 6px 10px;
    text-align: center;
}

.W1Q_AVATAR_INFO_TABLE td {
    font-size: 0.85rem;
}

.W1Q_AVATAR_INFO_TABLE th {
    font-size: 26px;
    line-height: 1.1;
}

.W1Q_CRED_ISTIT {
    color: #418ec7;
}

.W1Q_CRED_COMM {
    color: #1ab2c3;
}

/************************************************************************/
/* TABLET (sotto 900px)                                                 */
/************************************************************************/
@media (max-width: 900px) {

    .W1Q_HEADER .t-HeroRegion-wrap {
        align-items: flex-start;
    }

    .W1Q_HEADER .t-HeroRegion-col--right {
        width: 100%;
        justify-content: flex-start;
    }

    .W1Q_AVATAR_INFO_TABLE {
        width: 100%;
    }
}

/************************************************************************/
/* MOBILE (sotto 600px)                                                 */
/************************************************************************/

@media (max-width: 600px) {

    .W1Q_HEADER .t-HeroRegion-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .W1Q_AVATAR {
        width: 4.5em;
        height: 4.5em;
    }

    .W1Q_AVATAR_SWITCH_OVERLAY {
        width: 1.7em;
        height: 1.7em;
        padding: 5px;
    }

    .W1Q_CURRENT_USER_NOMINATIVO {
        font-size: 1.2rem;
        max-width: 180px;
    }

    .W1Q_AVATAR_INFO_TABLE {
        width: 100%;
    }

    .W1Q_AVATAR_INFO_TABLE th {
        font-size: 22px;
    }

}

/************************************************************************/
/* HEADER NAVBAR / MENU                                                  */
/************************************************************************/
/* branding */
.t-Header-branding {
    padding: 0 !important;
    background-image: linear-gradient(to right, #033c6a, #1e85d8);
}

/* titolo app */
.t-Header-logo-link span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3em;
}

/* =====================================================
   INPUT + POST TEXT: mobile, senza rompere display-only
===================================================== */
@media (max-width: 768px) {

  /* SOLO item con post-text */
  .t-Form-itemWrapper:has(.t-Form-itemText--post) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* input mantiene la sua larghezza */
  .t-Form-itemWrapper:has(.t-Form-itemText--post) > input,
  .t-Form-itemWrapper:has(.t-Form-itemText--post) > select,
  .t-Form-itemWrapper:has(.t-Form-itemText--post) > textarea {
    flex: 0 0 auto;
    max-width: 100%;
  }

  /* post text sotto */
  .t-Form-itemWrapper:has(.t-Form-itemText--post) .t-Form-itemText--post {
    display: block;
    width: 100%;
    margin-top: 6px;
    white-space: normal;
    line-height: 1.4;
  }
}

@media (max-width: 768px) {
  /* display-only: mantieni allineamento UT anche se c'č post-text */
  .t-Form-itemWrapper:has(.t-Form-itemText--post)
  .apex-item-display-only {
    align-self: flex-start;   /* niente centratura */
    text-align: left !important;
    width: auto;
  }

}

/************************************************************************/
/* FOOTER                                                               */
/************************************************************************/
.t-Footer {
    border-top: 8px solid #1e85d8;
    padding: 0.9rem 1rem;
    gap: 0;
}

.t-Footer-body {
    position: relative;
}

.t-Footer-apex {
    display: flex;
    justify-content: center; /* Centra il contenuto */
    align-items: center;
    gap: 1rem;
}

/* Pulsante a destra su desktop */
.t-Footer-top {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.W1Q_FOOTER_CONTAINER {
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Allinea verticalmente l'immagine con il testo */
.W1Q_FOOTER_CONTAINER img {
    vertical-align: middle;
    margin-right: 4px;
}

.W1Q_FOOTER_CONTAINER p {
    margin: 0;
    display: flex;
    align-items: center;
    /*gap: 4px;*/
}

@media (max-width: 639px) {
    .t-Footer {
        padding: 0.3rem 1rem;
    }
    
    .t-Footer-top {
        margin: 0 !important;
    }
}

@media only screen and (max-width: 480px) {
    .t-Footer {
        padding: 0.3rem 1rem;
    }

    .t-Footer-body {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        position: static; /* Rimuove il positioning su mobile */
    }
    
    .t-Footer-apex {
        flex: 1;
        justify-content: center;
        gap: 0.5rem;
    }

    .W1Q_FOOTER_CONTAINER {
        text-align: center;
        font-size: 0.8rem; /* Leggermente pių piccolo su mobile */
    }
    
    /* Mantieni il pulsante "torna su" in riga su mobile */
    .t-Footer-top {
        position: static !important;
        margin: 0 !important;
        order: 2;
        transform: none; /* Rimuove il transform su mobile */
    }
    
    .t-Footer-topButton {
        position: static !important;
    }
}

/* PARTI COMMENTATE - NON PIŲ UTILIZZATE */
/*
.t-Footer-apex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

@media only screen and (max-width: 480px) {
    .t-Footer-top {
        margin: 0 !important;
    }
    
    .t-Footer-apex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .W1Q_FOOTER_CONTAINER {
        text-align: center !important;
    }
}
*/

/************************************************************************/
/* EMAIL VERIFICA                                                        */
/************************************************************************/
.EMAIL_NOT_VER { border-bottom: 3px solid grey !important; }

.EMAIL_OK {
    animation: EMAIL_OK_Animation 1.5s linear;
    border-bottom: 3px solid #83ff83 !important;
}

.EMAIL_ERR {
    animation: EMAIL_ERR_Animation 1.5s linear;
    border-bottom: 3px solid #ff8383 !important;
}

@keyframes EMAIL_OK_Animation {
    from { background: #83ff83; }
    to   { background: none; }
}

@keyframes EMAIL_ERR_Animation {
    from { background: #ff8383; }
    to   { background: none; }
}

/************************************************************************/
/* FIX OVERFLOW MOBILE - CONTENUTO PAGINA                              */
/************************************************************************/
@media only screen and (max-width: 768px) {
    /* Previeni overflow orizzontale su mobile */
    .t-Body-content,
    .t-Body-contentInner {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Forza regioni a non eccedere */
    .t-Region {
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Forza tutti i contenuti a rispettare i limiti */
    .t-Region-body,
    .t-Region-bodyWrap {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
}