/* =====================================================================
   Charge — tema "morbido": barra laterale, schede bianche su fondo chiaro,
   ombre leggere e sfumature gialle Partner Solution. Solo grafica:
   si carica dopo app.css e ne rifinisce l'aspetto.
   ===================================================================== */
:root {
    --ps-sfondo-app: #f6f6f3;
    --ps-testo-2: #67748e;
    --ps-ombra: 0 20px 27px rgba(0, 0, 0, .05);
    --ps-ombra-piccola: 0 4px 7px -1px rgba(0, 0, 0, .11), 0 2px 4px -1px rgba(0, 0, 0, .07);
    --ps-sfumatura: linear-gradient(310deg, #f0a800 0%, #ffd23f 100%);
    --ps-sfumatura-scura: linear-gradient(310deg, #141414 0%, #3a3a3a 100%);
    --ps-raggio: 1rem;
    --ps-laterale: 15.5rem;
    --ps-bordo: #ecebe5;
    --ps-superficie: #faf9f6;
}

body {
    background: var(--ps-sfondo-app);
}

/* Struttura: barra laterale fissa + corpo */
.app {
    min-height: 100vh;
}

.app-corpo {
    margin-left: calc(var(--ps-laterale) + 1rem);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.laterale {
    position: fixed;
    top: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: var(--ps-laterale);
    display: flex;
    flex-direction: column;
    padding: 1.25rem .9rem;
    overflow-y: auto;
    z-index: 30;
}

.laterale-marchio {
    padding: 0 .6rem;
}

.laterale-sep {
    border: 0;
    height: 1px;
    margin: 1.1rem 0 .6rem;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .12), transparent);
}

.menu {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.menu-sezione {
    margin: 1rem .75rem .35rem;
    font-family: var(--ps-font-heading);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ps-testo-2);
}

.menu-voce {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: .75rem;
    text-decoration: none;
    font-family: var(--ps-font-heading);
    font-size: .92rem;
    font-weight: 600;
    color: var(--ps-testo-2);
    transition: background-color .2s, box-shadow .2s, color .2s;
}

.menu-voce:hover {
    color: var(--ps-ink);
    background: rgba(255, 255, 255, .6);
}

.menu-voce.active {
    color: var(--ps-ink);
    font-weight: 700;
    background: var(--ps-white);
    box-shadow: var(--ps-ombra-piccola);
}

.menu-icona {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: none;
    border-radius: .55rem;
    background: var(--ps-white);
    box-shadow: var(--ps-ombra-piccola);
    color: var(--ps-ink);
}

.menu-icona svg,
.pulsante-esci svg,
.menu-pulsante svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-voce.active .menu-icona {
    background: var(--ps-sfumatura);
}

.menu-interruttore,
.laterale-velo,
.menu-pulsante {
    display: none;
}

/* Barra in alto: percorso a sinistra; logo, utente ed Esci a destra */
.barra-alta {
    position: sticky;
    top: .75rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: .75rem 1.5rem 0 .5rem;
    padding: .65rem 1rem;
    border-radius: var(--ps-raggio);
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 0 1px rgba(0, 0, 0, .1), var(--ps-ombra);
}

.percorso {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
    font-size: .9rem;
}

.percorso-radice,
.percorso-sep {
    color: var(--ps-testo-2);
}

.percorso-pagina {
    font-family: var(--ps-font-heading);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.barra-utente {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-left: auto;
    min-width: 0;
}

.barra-utente .logo-ps {
    height: 1.9rem;
}

.utente {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    font-size: .85rem;
    color: var(--ps-testo-2);
}

.utente-avatar {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: none;
    border-radius: .6rem;
    background: var(--ps-sfumatura-scura);
    color: var(--ps-yellow);
    font-family: var(--ps-font-heading);
    font-weight: 800;
    box-shadow: var(--ps-ombra-piccola);
}

.utente-nome {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-esci {
    margin: 0;
}

.contenuto {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    padding: 1.75rem 1.5rem 3rem .5rem;
    min-width: 0;
}

/* Titoli di pagina */
.intestazione-pagina h1 {
    margin-bottom: .2rem;
}

.sottotitolo {
    color: var(--ps-testo-2);
}

/* Pulsanti */
button,
.pulsante {
    border-radius: .6rem;
}

.pulsante {
    font-family: var(--ps-font-heading);
    font-weight: 700;
    transition: transform .15s, box-shadow .15s, background-color .15s, border-color .15s;
}

.pulsante-primario {
    background: var(--ps-sfumatura);
    box-shadow: var(--ps-ombra-piccola);
}

.pulsante-primario:hover:not(:disabled) {
    background: var(--ps-sfumatura);
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, .1), 0 3px 6px rgba(0, 0, 0, .08);
}

.pulsante-secondario {
    border: 1px solid #d6d2c6;
    background: var(--ps-white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.pulsante-secondario:hover:not(:disabled) {
    border-color: var(--ps-ink);
}

.pulsante-pericolo {
    background: linear-gradient(310deg, #9a1c12 0%, #d0362a 100%);
    border-color: transparent;
    box-shadow: var(--ps-ombra-piccola);
}

.pulsante-azione {
    border-radius: .5rem;
}

/* Campi */
input,
select,
textarea {
    border: 1px solid #d6d2c6;
    border-radius: .55rem;
    transition: border-color .15s, box-shadow .15s;
}

input:focus,
select:focus,
textarea:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: #e0a800;
    box-shadow: 0 0 0 3px rgba(254, 202, 22, .4);
    outline: none;
}

/* Riquadri, schede, pannelli e avvisi come superfici morbide */
.riquadro {
    border: 0;
    border-radius: var(--ps-raggio);
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: var(--ps-ombra);
}

.pannello {
    border-radius: var(--ps-raggio) 0 0 var(--ps-raggio);
    box-shadow: -20px 0 40px rgba(0, 0, 0, .12);
}

.avviso {
    border-radius: .75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.etichetta {
    font-family: var(--ps-font-heading);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: .2rem .65rem;
    border-radius: .45rem;
}

.tabella-semplice th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ps-testo-2);
    background: transparent;
}

/* Pagina di accesso */
.accesso {
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgba(254, 202, 22, .35), transparent 60%),
        var(--ps-sfondo-app);
}

.accesso-scheda {
    border-radius: 1.25rem;
    box-shadow: var(--ps-ombra), 0 0 1px rgba(0, 0, 0, .08);
}

/* Schermi piccoli: la barra laterale scorre da sinistra */
@media (max-width: 1100px) {
    .app-corpo {
        margin-left: 0;
    }

    .laterale {
        top: 0;
        bottom: 0;
        left: 0;
        width: min(17rem, 85vw);
        background: var(--ps-sfondo-app);
        box-shadow: 10px 0 30px rgba(0, 0, 0, .15);
        transform: translateX(-105%);
        transition: transform .25s ease;
        z-index: 50;
    }

    .menu-interruttore:checked ~ .laterale {
        transform: none;
    }

    .menu-interruttore:checked ~ .laterale-velo {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .3);
        z-index: 45;
    }

    .menu-pulsante {
        display: inline-grid;
        place-items: center;
        width: 2.4rem;
        height: 2.4rem;
        flex: none;
        border-radius: .6rem;
        background: var(--ps-white);
        box-shadow: var(--ps-ombra-piccola);
        cursor: pointer;
    }

    .menu-pulsante svg {
        width: 1.2rem;
        height: 1.2rem;
    }

    .barra-alta {
        top: .5rem;
        margin: .5rem 16px 0;
    }

    .contenuto {
        padding: 1.5rem 16px 3rem;
    }
}

@media (max-width: 760px) {
    .barra-utente .logo-ps,
    .barra-utente .logo-divisore,
    .utente-nome {
        display: none;
    }

    .pulsante-esci {
        padding: .45rem .75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .laterale,
    .pulsante,
    .menu-voce {
        transition: none;
    }
}

/* Schede della bozza: barra con pulsanti morbidi, la scheda attiva è una pillola bianca in rilievo */
.schede {
    gap: .25rem;
    padding: .3rem;
    border: 0;
    border-radius: .85rem;
    background: #ecebe5;
}

.scheda {
    margin: 0;
    border: 0;
    border-radius: .6rem;
    padding: .45rem .9rem;
    color: var(--ps-testo-2);
    font-family: var(--ps-font-heading);
    font-weight: 600;
    transition: background-color .15s, color .15s, box-shadow .15s;
}

.scheda:hover {
    color: var(--ps-ink);
}

.scheda.attiva {
    border: 0;
    background: var(--ps-white);
    color: var(--ps-ink);
    box-shadow: var(--ps-ombra-piccola);
}

.sottoschede {
    border-bottom-color: var(--ps-bordo);
}

.sottoscheda.attiva {
    background: transparent;
    border-bottom-color: #e0a800;
}

.problemi-scheda {
    background: var(--ps-white);
    border-radius: .75rem;
    box-shadow: var(--ps-ombra);
}

.accesso-scheda .marchio {
    display: flex;
    justify-content: center;
}

/* Anteprima dei testi del pacchetto: impaginata come una scheda di catalogo, facile da leggere */
.testo-impaginato {
    max-height: 34rem;
    padding: 1.4rem 1.6rem;
    border: 0;
    border-radius: var(--ps-raggio);
    background: var(--ps-white);
    box-shadow: inset 0 0 0 1px var(--ps-bordo);
    font-size: .98rem;
    line-height: 1.7;
    color: #2b2b2b;
}

.testo-impaginato > :first-child {
    margin-top: 0;
}

.testo-impaginato > :last-child {
    margin-bottom: 0;
}

.testo-impaginato p {
    margin: 0 0 .9rem;
    max-width: 72ch;
}

.testo-impaginato h2,
.testo-impaginato h3,
.testo-impaginato h4 {
    font-family: var(--ps-font-heading);
    font-weight: 800;
    color: var(--ps-ink);
    line-height: 1.3;
}

.testo-impaginato h2 {
    font-size: 1.35rem;
    margin: 0 0 .6rem;
}

.testo-impaginato h3 {
    font-size: 1.08rem;
    margin: 1.4rem 0 .45rem;
}

/* Programma giorno per giorno: i titoli "Giorno N" come tappe di una linea del tempo */
.testo-impaginato h4 {
    position: relative;
    font-size: 1rem;
    margin: 1.1rem 0 .3rem;
    padding-left: 1.4rem;
}

.testo-impaginato h4::before {
    content: "";
    position: absolute;
    left: 0;
    top: .42em;
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: var(--ps-sfumatura);
    box-shadow: 0 0 0 3px rgba(254, 202, 22, .25);
}

.testo-impaginato h4 + p {
    margin-left: .3rem;
    padding-left: 1.1rem;
    border-left: 2px solid #f3e6b3;
}

.testo-impaginato strong {
    font-weight: 700;
    color: var(--ps-ink);
}

.testo-impaginato ul,
.testo-impaginato ol {
    margin: 0 0 1rem;
    padding-left: 0;
    list-style: none;
}

.testo-impaginato li {
    position: relative;
    margin: .35rem 0;
    padding-left: 1.5rem;
}

.testo-impaginato ul > li::before {
    content: "";
    position: absolute;
    left: .2rem;
    top: .62em;
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--ps-yellow);
}

.testo-impaginato ol {
    counter-reset: voce;
}

.testo-impaginato ol > li::before {
    counter-increment: voce;
    content: counter(voce);
    position: absolute;
    left: 0;
    top: .15em;
    width: 1.15rem;
    height: 1.15rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ps-yellow);
    font-family: var(--ps-font-heading);
    font-size: .7rem;
    font-weight: 800;
}

.testo-impaginato blockquote {
    margin: 1rem 0;
    padding: .75rem 1rem;
    border-left: 3px solid var(--ps-yellow);
    border-radius: 0 .6rem .6rem 0;
    background: #fffbea;
}


/* Scelta della miniatura: la foto scelta è ben evidente */
.scelta-miniatura {
    position: relative;
    border: 0 !important;
    border-radius: .85rem !important;
    box-shadow: 0 0 0 1px var(--ps-bordo), var(--ps-ombra-piccola);
    transition: box-shadow .15s, transform .15s;
}

.scelta-miniatura:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px #f0c94a, var(--ps-ombra-piccola);
}

.scelta-miniatura.scelta {
    box-shadow: 0 0 0 4px var(--ps-yellow), 0 8px 18px rgba(0, 0, 0, .15);
}

.scelta-miniatura .scegli-foto {
    position: relative;
}

.miniatura-segno {
    position: absolute;
    left: .4rem;
    bottom: .4rem;
    padding: .15rem .5rem;
    border-radius: .4rem;
    background: rgba(255, 255, 255, .92);
    color: var(--ps-ink);
    font-family: var(--ps-font-heading);
    font-size: .7rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity .15s;
}

.scelta-miniatura:hover .miniatura-segno,
.scegli-foto:focus-visible .miniatura-segno {
    opacity: 1;
}

.scelta-miniatura.scelta .miniatura-segno {
    opacity: 1;
    background: var(--ps-sfumatura);
}

.riquadro-miniatura .galleria-piccola {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: .9rem;
    padding: .3rem;
}

.riquadro-miniatura h3 {
    margin-bottom: .2rem;
}

/* Saldo del wallet al centro della barra in alto */
.wallet {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-left: auto;
    padding: .3rem .85rem .3rem .35rem;
    border-radius: .8rem;
    background: #fffbea;
    box-shadow: inset 0 0 0 1px #f3e2a0;
    white-space: nowrap;
}

.wallet-icona {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    background: var(--ps-sfumatura);
    box-shadow: var(--ps-ombra-piccola);
}

.wallet-icona svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: var(--ps-ink);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wallet-testi {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.wallet-etichetta {
    font-family: var(--ps-font-heading);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ps-testo-2);
}

.wallet-saldo {
    font-family: var(--ps-font-heading);
    font-size: 1.05rem;
    font-weight: 800;
}

.wallet-basso {
    background: var(--ps-errore-sfondo);
    box-shadow: inset 0 0 0 1px #f3b8b1;
}

.wallet-basso .wallet-saldo {
    color: var(--ps-errore);
}

@media (max-width: 760px) {
    .wallet-etichetta {
        display: none;
    }

    .wallet {
        padding-right: .6rem;
    }
}

/* Costo della lettura in cima alla bozza */
.costo-lettura {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem 1rem;
}

a.wallet {
    text-decoration: none;
    color: var(--ps-ink);
}

a.wallet:hover {
    box-shadow: inset 0 0 0 1px #e0b500;
}

/* Pagina Wallet */
.wallet-riepilogo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 1.5rem 2rem;
    align-items: start;
}

.wallet-grande {
    margin: .2rem 0 .3rem;
    font-family: var(--ps-font-heading);
    font-size: 2.4rem;
    font-weight: 800;
}

.wallet-grande-basso,
.importo-negativo {
    color: var(--ps-errore);
}

.importo-positivo {
    color: var(--ps-ok);
}

.titolo-sezione {
    margin-top: 1.5rem;
}

@media (max-width: 760px) {
    .wallet-riepilogo {
        grid-template-columns: 1fr;
    }
}

.chiave-sso {
    display: block;
    margin: .5rem 0;
    padding: .5rem .7rem;
    border-radius: .5rem;
    background: var(--ps-white);
    font-family: Consolas, "Courier New", monospace;
    font-size: .95rem;
    word-break: break-all;
    user-select: all;
}
