* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fafafa;
    color: #1c1c1c;
    padding-bottom: 90px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #1c1c1c;
    color: #fff;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
}
.topbar h1 { margin: 0; font-size: 1.3rem; font-weight: 600; }
.sottotitolo { margin: 4px 0 0; font-size: 0.9rem; opacity: 0.75; }
.link-esci { color: #fff; text-decoration: underline; font-size: 0.9rem; }

.topbar-copertina {
    background-size: cover;
    background-position: center;
    padding: 70px 24px 34px;
}
.topbar-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.75));
}
.topbar-testo { position: relative; z-index: 1; }
.topbar-copertina .sottotitolo { opacity: 0.9; }

.vuoto { text-align: center; padding: 60px 20px; color: #777; }

.barra-progresso-contenitore {
    height: 6px;
    background: #eee;
    margin: 0 16px;
    border-radius: 3px;
    overflow: hidden;
}
.barra-progresso-riempimento {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #2ecc71, #27ae60);
    transition: width 0.25s ease;
}
.testo-progresso {
    margin: 6px 16px 0;
    font-size: 0.78rem;
    color: #888;
}

.area-nota {
    margin: 18px 16px 90px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
}
.area-nota label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}
.area-nota textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.guida-cliente {
    margin: 12px 16px 0;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eee;
    border-left: 4px solid #2b2b2b;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #333;
    line-height: 1.5;
}
.guida-cliente p { margin: 0 0 8px; }
.guida-legenda { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 !important; font-size: 0.82rem; color: #555; }
.legenda-voce { display: inline-flex; align-items: center; gap: 6px; }
.legenda-stelle { color: #e6a919; letter-spacing: 1px; }
.legenda-stelle.facolt { opacity: 0.7; }
.suggerimento-installa {
    margin: 10px 0 0 !important;
    font-size: 0.78rem;
    color: #888;
    border-top: 1px dashed #eee;
    padding-top: 10px;
}

.breadcrumb {
    padding: 12px 16px 0;
    font-size: 0.85rem;
    color: #666;
}
.breadcrumb a { color: #1c1c1c; text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: #bbb; }

.barra-indietro {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px 0;
}
.barra-indietro .breadcrumb { padding: 0; }
.btn-indietro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 9px 16px;
    background: #1c1c1c;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    flex-shrink: 0;
}
.btn-indietro:active { background: #3a3a3a; }

.elenco-cartelle {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    padding: 14px 16px;
}
.cartella-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 14px;
    min-height: 120px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    text-decoration: none;
    color: #1c1c1c;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.cartella-tile:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.cartella-tile:active { background: #f2f2f2; transform: scale(0.98); }
.icona-cartella { font-size: 2.8rem; }

.griglia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
    padding: 12px;
}
.cella {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: #eee;
    cursor: pointer;
}
.cella img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stelle-mini {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 2px;
    padding: 5px 2px 4px;
    background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
    z-index: 2;
}
.stella-mini {
    color: rgba(255,255,255,0.55);
    font-size: 15px;
    line-height: 1;
    padding: 3px 2px;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.stella-mini.attiva { color: #e6a919; }
.stella-mini.attiva.obbligatoria { color: #ffd23f; }

.cella.obbligatoria::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid #2ecc71;
    border-radius: 6px;
    pointer-events: none;
}
.cella.facoltativa::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid #e6a919;
    border-radius: 6px;
    pointer-events: none;
}

.cella-vista { cursor: default; }
.nome-file {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.65rem;
    padding: 3px 5px;
    word-break: break-all;
}

.barra-inferiore {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #1c1c1c;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
.barra-inferiore button {
    background: #2ecc71;
    color: #fff;
    border: 0;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}
.barra-inferiore button:disabled { opacity: 0.6; }

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.lightbox.aperta { display: flex; }
.lightbox img { max-width: 92%; max-height: 92%; object-fit: contain; }
.lightbox .chiudi {
    position: absolute;
    top: 16px; right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2;
}
.azioni-download {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
    z-index: 2;
}
.btn-icona-download {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
.btn-icona-download svg { display: block; }
.btn-icona-download:hover { background: rgba(255,255,255,0.28); }
.btn-icona-download:active { background: rgba(255,255,255,0.3); transform: scale(0.93); }

/* Quando il fotografo non permette il download: scoraggia il salvataggio
   rapido dell'immagine ingrandita (non è una protezione perfetta). */
.no-download .lightbox img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.lightbox .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 2.6rem;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
.lightbox .nav:hover { background: rgba(255,255,255,0.28); }
.lightbox .nav:active { background: rgba(255,255,255,0.4); transform: translateY(-50%) scale(0.94); }
.nav-prev { left: 16px; }
.nav-next { right: 16px; }

.lightbox-azioni {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 2;
}
.lightbox-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(28,28,28,0.55);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255,255,255,0.5);
    color: #fff;
    padding: 14px 22px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 500;
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.lightbox-btn:hover { transform: scale(1.03); }
.lightbox-btn:active { transform: scale(0.97); }
.lightbox-btn .pallino {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.lightbox-btn.select.attivo { background: #2ecc71; border-color: #2ecc71; }
.lightbox-btn.select.attivo .pallino { background: #fff; color: #2ecc71; }
.lightbox-btn.scorta.attivo { background: #e6a919; border-color: #e6a919; }
.lightbox-btn.scorta.attivo .pallino { background: #fff; color: #e6a919; }

.stelle-lightbox {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(28,28,28,0.55);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255,255,255,0.4);
    padding: 14px 24px;
    border-radius: 40px;
    z-index: 2;
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}
.stella-grande {
    color: rgba(255,255,255,0.4);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    transition: color 0.1s, transform 0.1s;
}
.stella-grande:hover { transform: scale(1.15); }
.stella-grande.attiva { color: #e6a919; }
.stella-grande.attiva.obbligatoria { color: #ffd23f; }
.etichetta-voto {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.85rem;
    background: rgba(28,28,28,0.55);
    padding: 6px 16px;
    border-radius: 20px;
    white-space: nowrap;
    z-index: 2;
}

@media (max-width: 600px) {
    .lightbox .nav { width: 52px; height: 52px; font-size: 2.1rem; }
    .nav-prev { left: 6px; }
    .nav-next { right: 6px; }
    .lightbox-azioni { bottom: 18px; gap: 8px; }
    .lightbox-btn { padding: 11px 16px; font-size: 0.85rem; }
    .lightbox-btn .testo-select { display: none; }
    .stelle-lightbox { bottom: 62px; padding: 10px 14px; gap: 6px; }
    .stella-grande { font-size: 1.6rem; padding: 3px; }
    .etichetta-voto { bottom: 18px; font-size: 0.75rem; padding: 5px 12px; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }
}

.overlay-conferma {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.overlay-conferma.aperta { display: flex; }
.overlay-conferma .riquadro {
    background: #fff;
    padding: 28px;
    border-radius: 10px;
    max-width: 360px;
    text-align: center;
}
.overlay-conferma button {
    margin-top: 16px;
    padding: 10px 20px;
    background: #1c1c1c;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

/* --- Area admin --- */
.pagina-admin { padding-bottom: 20px; }
.box-login {
    max-width: 340px;
    margin: 90px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}
.box-login input {
    width: 100%;
    padding: 10px;
    margin: 14px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.box-login button {
    width: 100%;
    padding: 10px;
    background: #1c1c1c;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.errore { color: #c0392b; }
.box-login-galleria { margin: 90px auto; background: #fff; }
.box-login-galleria h1 { font-size: 1.2rem; }
.sottotitolo-login { font-size: 0.85rem; color: #777; margin: 8px 0 0; }

.pannello {
    background: #fff;
    margin: 16px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.pannello h2 { margin-top: 0; font-size: 1.1rem; }
.nascosto { display: none !important; }
.intestazione-pannello {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.intestazione-pannello h2 { margin: 0; }
.btn-crea-toggle {
    padding: 10px 20px;
    background: #2ecc71;
    color: #fff;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(46,204,113,0.3);
    transition: transform 0.1s, box-shadow 0.15s;
}
.btn-crea-toggle:hover { box-shadow: 0 5px 16px rgba(46,204,113,0.4); transform: translateY(-1px); }
#contenitore-nuova-galleria { margin-top: 20px; }

.form-nuova { display: flex; gap: 8px; flex-wrap: wrap; }
.form-nuova input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.form-nuova button, .pannello > form button {
    padding: 10px 18px;
    background: #2ecc71;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.form-nuova-completa {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.form-nuova-completa .campo {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-nuova-completa .campo-largo { grid-column: 1 / -1; }
.form-nuova-completa label {
    font-size: 0.82rem;
    color: #555;
    font-weight: 600;
}
.form-nuova-completa input,
.form-nuova-completa textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
}
.form-nuova-completa textarea { resize: vertical; }

/* --- Form galleria: versione curata, a sezioni --- */
.form-galleria { display: flex; flex-direction: column; gap: 30px; }
.sezione-form {
    padding: 24px 26px;
    background: #fbfbfa;
    border: 1px solid #ececea;
    border-radius: 12px;
}
.sezione-form h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sezione-desc {
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: #888;
}
.sezione-form h3 + .sezione-desc { margin-top: 2px; }
.sezione-form h3 ~ .griglia-campi,
.sezione-form h3 ~ .campo { margin-top: 18px; }
.tag-privato {
    font-size: 0.7rem;
    font-weight: 500;
    color: #b8860b;
    background: #fdf3d9;
    padding: 3px 10px;
    border-radius: 20px;
}
.griglia-campi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px 24px;
    margin-top: 18px;
}
.form-galleria .campo {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.form-galleria .campo-largo { grid-column: 1 / -1; margin-top: 18px; }
.sezione-form > .campo-largo:first-of-type { margin-top: 18px; }
.form-galleria label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.form-galleria input,
.form-galleria textarea {
    padding: 13px 14px;
    border: 1.5px solid #e2e2e0;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.96rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-galleria input:focus,
.form-galleria textarea:focus {
    outline: none;
    border-color: #2b2b2b;
    box-shadow: 0 0 0 3px rgba(43,43,43,0.08);
}
.form-galleria textarea { resize: vertical; min-height: 46px; }
.form-galleria input[type="file"] {
    padding: 9px;
    font-size: 0.88rem;
}
.campo-checkbox { margin-top: 4px; }
.label-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}
.label-checkbox input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.label-checkbox-inline { font-size: 0.8rem; font-weight: 500; color: #666; margin-top: 6px; }
.nota-campo { font-size: 0.78rem; color: #888; margin: 4px 0 0; }
.anteprima-copertina {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.anteprima-copertina img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}
.tag-opzionale {
    font-size: 0.7rem;
    font-weight: 500;
    color: #666;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 20px;
}
.tabella-limiti {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}
.riga-limite {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    flex-wrap: wrap;
}
.nome-cartella-limite { flex: 1; min-width: 140px; font-size: 0.9rem; font-weight: 500; }
.campo-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #666;
    font-weight: 600;
}
.campo-mini input {
    width: 64px;
    padding: 7px 8px;
    border: 1.5px solid #e2e2e0;
    border-radius: 6px;
    font-size: 0.9rem;
}
.btn-crea {
    align-self: flex-start;
    padding: 14px 30px;
    background: #2ecc71;
    color: #fff;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(46,204,113,0.3);
    transition: transform 0.1s, box-shadow 0.15s;
}
.btn-crea:hover { box-shadow: 0 5px 16px rgba(46,204,113,0.4); transform: translateY(-1px); }
.btn-crea:active { transform: translateY(0); }
.msg-ok {
    background: #d9f7e4;
    color: #1a7a3f;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.riga-secondaria {
    font-size: 0.78rem;
    color: #888;
    margin-top: 2px;
}
.testo-scaduto { color: #c0392b !important; font-weight: 600; }
.overlay-qr {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
}
.overlay-qr.aperta { display: flex; }
.riquadro-qr {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    position: relative;
}
.riquadro-qr #qr-canvas { display: flex; justify-content: center; margin: 10px 0; }
.qr-nome-galleria { font-weight: 600; margin: 10px 0 4px; }
.qr-nota { font-size: 0.78rem; color: #888; margin: 0; }
.chiudi-qr {
    position: absolute;
    top: 10px; right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
}
.riquadro-nota-cliente {
    background: #eef6ff;
    border: 1px solid #d3e6fb;
    border-left: 4px solid #3d8bfd;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.etichetta-nota-cliente { font-weight: 600; margin: 0 0 6px; font-size: 0.82rem; color: #2664c7; }
.riquadro-nota-cliente p:last-child { margin: 0; }

.riquadro-link {
    margin-top: 16px;
    padding: 14px;
    background: #f2fbf5;
    border: 1px solid #cdeed9;
    border-radius: 8px;
}
.riga-link { display: flex; gap: 8px; margin: 8px 0; }
.riga-link input { flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 6px; }
.riga-link button {
    padding: 8px 14px;
    background: #1c1c1c;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.nota { font-size: 0.85rem; color: #666; }
.nota code { background: #eee; padding: 1px 5px; border-radius: 4px; }

.barra-ricerca { margin-top: 10px; }
.barra-ricerca input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e2e0;
    border-radius: 9px;
    font-size: 0.92rem;
    font-family: inherit;
}
.barra-ricerca input:focus {
    outline: none;
    border-color: #2b2b2b;
    box-shadow: 0 0 0 3px rgba(43,43,43,0.08);
}

.tabella-gallerie { width: 100%; border-collapse: collapse; margin-top: 10px; }
.tabella-gallerie th, .tabella-gallerie td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}
.badge { padding: 3px 9px; border-radius: 20px; font-size: 0.78rem; }
.badge-ok { background: #d9f7e4; color: #1a7a3f; }
.badge-attesa { background: #f2f2f2; color: #888; }

.btn-piccolo {
    display: inline-block;
    padding: 6px 10px;
    background: #f2f2f2;
    border: 0;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    color: #1c1c1c;
    margin: 2px;
}
.btn-elimina { background: #fbe4e4; color: #b02a2a; }
.inline { display: inline; }

.azioni-selezione { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.azioni-selezione button, .btn-link {
    padding: 9px 16px;
    background: #1c1c1c;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}
.elenco-testo {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.titolo-sezione {
    font-size: 1rem;
    margin: 22px 0 10px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}
.titolo-scorta { color: #b8860b; }

/* --- Scelta tipo di galleria (admin) --- */
.scelta-tipo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.opzione-tipo {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background: #fff;
    border: 2px solid #e2e2e0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.opzione-tipo:has(input:checked) { border-color: #2b2b2b; background: #f7f7f6; }
.opzione-tipo input[type="radio"] { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.opzione-tipo-testo { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; }
.opzione-tipo-testo strong { font-size: 0.95rem; }
.opzione-tipo-testo span:last-child { color: #777; font-size: 0.82rem; line-height: 1.4; }
.badge-vista {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    background: #ede4fb;
    color: #6c3fbf;
    vertical-align: middle;
}

/* --- Galleria di tipo "visualizzazione" --- */
.corpo-vista { padding-bottom: 40px; }
.hero-vista {
    position: relative;
    min-height: 46vh;
    background: #1c1c1c linear-gradient(135deg, #2b2b2b, #1c1c1c);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 40px;
}
.hero-vista-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0.05) 60%);
}
.hero-vista-testo {
    position: relative;
    z-index: 1;
    color: #fff;
}
.hero-vista-testo h1 {
    margin: 0 0 6px;
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.hero-vista-testo p { margin: 0; font-size: 1rem; opacity: 0.9; }

.barra-vista {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 24px;
    border-bottom: 1px solid #eee;
}
.breadcrumb-vista { font-size: 0.85rem; color: #666; }
.breadcrumb-vista a { color: #1c1c1c; text-decoration: none; font-weight: 500; }
.breadcrumb-vista .sep { margin: 0 6px; color: #bbb; }
.btn-scarica-tutto {
    padding: 9px 18px;
    background: #1c1c1c;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.elenco-cartelle-vista { padding: 20px 24px 0; }

.masonry {
    columns: 4 220px;
    column-gap: 12px;
    padding: 20px 24px 40px;
}
.masonry-cella {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #eee;
}
.masonry-cella img {
    width: 100%;
    display: block;
    transition: transform 0.2s;
}
.masonry-cella:hover img { transform: scale(1.03); }

@media (max-width: 700px) {
    .hero-vista { min-height: 34vh; padding: 24px; }
    .hero-vista-testo h1 { font-size: 1.5rem; }
    .masonry { columns: 2 140px; padding: 14px 14px 30px; }
    .barra-vista { padding: 12px 14px; }
}
.opzione-tipo.selezionata { border-color: #2b2b2b; background: #f7f7f6; }

/* --- Pagina Carica foto --- */
.form-nuova-cartella { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.form-nuova-cartella input {
    flex: 1; min-width: 200px; padding: 10px; border: 1px solid #ddd; border-radius: 6px;
}
.form-nuova-cartella button {
    padding: 10px 16px; background: #1c1c1c; color: #fff; border: 0; border-radius: 6px; cursor: pointer;
}

.zona-trascina {
    border: 2.5px dashed #cfcfcc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    color: #777;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 16px;
}
.zona-trascina:hover, .zona-trascina.trascinamento-attivo {
    border-color: #2ecc71;
    background: #f4fbf6;
    color: #333;
}

.elenco-caricamento { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.riga-caricamento {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f7f7f6;
    border-radius: 6px;
    font-size: 0.85rem;
}
.nome-riga-caricamento { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.stato-riga-caricamento { flex-shrink: 0; color: #888; font-weight: 600; }
.riga-caricamento.riga-ok .stato-riga-caricamento { color: #1a7a3f; }
.riga-caricamento.riga-errore .stato-riga-caricamento { color: #c0392b; }
