/* Foto auto — le regole proprie dello strumento. Il foglio comune è stile-fth.css (copia identica
   di projects/fth-stile/stile.css, controllata da ops/controlla-stile.sh): qui solo ciò che serve
   a questa pagina. */

.nascosto { display: none !important; }

/* ---------- Pagina di accesso (come Tracciati) ---------- */
body.accesso { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: var(--s-4); background: var(--fondo-2); }
.accesso .box { background: var(--superficie); border: var(--bordo); border-radius: var(--r-3); padding: var(--s-8) var(--s-8) var(--s-6);
  width: min(400px, 100%); text-align: center; box-shadow: var(--ombra-fin); }
.accesso .logo svg { height: 30px; width: auto; }
.accesso .logo path { fill: var(--marca); }
.accesso .divisorio { display: none; }
.accesso h1.fs-titolo { margin: var(--s-4) 0 var(--s-2); font-size: var(--t-xl); }
.accesso .sotto { color: var(--testo-2); font-size: var(--t-s); margin: 0 0 var(--s-5); }
.accesso label { display: block; text-align: left; font-size: var(--t-xs); font-weight: var(--peso-medio); color: var(--testo-3); margin-bottom: var(--s-1); }
.accesso select { width: 100%; height: 40px; font-size: 16px; margin-bottom: var(--s-3); }
.accesso .fs-btn { width: 100%; height: 40px; justify-content: center; }
.accesso .g svg { background: #fff; border-radius: 99px; padding: 3px; flex: none; }
.accesso .nota { color: var(--testo-3); font-size: var(--t-xs); margin-top: var(--s-4); line-height: 1.55; }
.accesso .err { background: var(--critico-tenue); color: var(--critico); font-size: var(--t-s); border-radius: var(--r-1); padding: var(--s-2) var(--s-3); margin: 0 0 var(--s-3); }
.accesso .piede { margin-top: var(--s-5); padding-top: var(--s-3); border-top: var(--bordo); font-size: var(--t-xs); color: var(--testo-3); }
.accesso .fs-titolo::after { display: none; }

/* ---------- Guscio ---------- */
.fs-icone svg { stroke: currentColor; fill: none; }
.fs-top .logo-top { height: 18px; }
.fs-top .nome-utente { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-top .fs-avatar { width: 28px; height: 28px; font-size: 11px; }
[data-densita="comoda"] .fs-pagina { max-width: calc(1180px + 2 * var(--margine)); }

/* ---------- Testa e scelta del modello ---------- */
.testa-foto { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.testa-foto .fs-sotto { max-width: 620px; line-height: 1.5; }
.modello { display: grid; gap: var(--s-2); justify-items: start; }
.modello .etichetta { font-size: var(--t-xs); color: var(--testo-3); font-weight: var(--peso-medio); }
.modello .fs-seg button[disabled] { opacity: .45; cursor: not-allowed; }
.modello .spenti { font-size: var(--t-xs); color: var(--testo-3); max-width: 420px; line-height: 1.45; }

/* ---------- Zona di caricamento ---------- */
.zona { display: grid; place-items: center; gap: var(--s-2); text-align: center; padding: var(--s-10) var(--s-5);
  border: 1.5px dashed var(--linea-forte); border-radius: var(--r-3); background: var(--superficie); cursor: pointer;
  transition: border-color var(--veloce), background var(--veloce); }
.zona:hover, .zona.sopra { border-color: var(--marca); background: color-mix(in srgb, var(--marca) 4%, var(--superficie)); }
.zona .icona { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--marca-tenue); color: var(--marca); }
.zona .icona svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.zona .grande { font-size: var(--t-l); font-weight: var(--peso-titolo); }
.zona .piccolo { font-size: var(--t-s); color: var(--testo-2); max-width: 440px; line-height: 1.5; }
.zona .fs-btn { margin-top: var(--s-2); }
.zona.compatta { padding: var(--s-4) var(--s-5); grid-auto-flow: column; justify-content: start; text-align: left; gap: var(--s-4); }
.zona.compatta .icona { width: 36px; height: 36px; }
.zona.compatta .piccolo, .zona.compatta .fs-btn { display: none; }
.zona.compatta .grande { font-size: var(--t-m); }

/* ---------- Riepilogo del caricamento ---------- */
.riepilogo { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-4) var(--s-5);
  border: var(--bordo); border-radius: var(--r-2); background: var(--superficie); margin: var(--s-5) 0 var(--s-4); }
.riepilogo .conti { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: var(--t-s); color: var(--testo-2); flex: 1; min-width: 220px; }
.riepilogo .conti b { color: var(--testo); font-weight: var(--peso-titolo); font-variant-numeric: tabular-nums; }
.riepilogo .barra { flex-basis: 100%; height: 4px; border-radius: 2px; background: var(--fondo-3); overflow: hidden; }
.riepilogo .barra span { display: block; height: 100%; width: 0; background: var(--marca); transition: width .4s ease; }
.riepilogo .fs-btn svg { width: 14px; height: 14px; }

/* ---------- Griglia delle foto ---------- */
.griglia-foto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); }
.foto { background: var(--superficie); border: var(--bordo); border-radius: var(--r-2); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.foto .immagine { position: relative; aspect-ratio: 3 / 2; background: var(--fondo-3); overflow: hidden; cursor: zoom-in; border: 0; padding: 0; display: block; width: 100%; }
.foto .immagine img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto .immagine .attesa { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--fondo) 55%, transparent); backdrop-filter: blur(1px); }
.foto .immagine .attesa span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--superficie); font-size: var(--t-xs); font-weight: var(--peso-medio); color: var(--testo-2); box-shadow: var(--ombra-fin); }
.rotella { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--linea-forte); border-top-color: var(--marca); animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.foto .immagine .etichetta-dopo { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: var(--peso-medio); }
.foto .corpo { padding: var(--s-3) var(--s-4) var(--s-4); display: grid; gap: 6px; }
.foto .nome { font-size: var(--t-xs); color: var(--testo-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto .esito { font-size: var(--t-s); font-weight: var(--peso-titolo); display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.foto .esito::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: currentColor; }
.foto .esito.bene { color: var(--bene); }
.foto .esito.critico { color: var(--critico); }
.foto .esito.attenzione { color: var(--attenzione); }
.foto .esito.nonso { color: var(--nonso); }
.foto .esito.nonso::before { background: none; border: 1.5px dashed currentColor; }
.foto .esito.attesa { color: var(--testo-2); }
.foto .esito.attesa::before { background: var(--linea-forte); }
.foto .targa { font-size: var(--t-xs); color: var(--testo-2); line-height: 1.45; }
.foto .targa.avviso { color: var(--attenzione); }
.foto .azioni { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: 4px; }
.foto.cambiata .immagine img { filter: saturate(.6); }

/* ---------- Prima e dopo ---------- */
.fs-finestra.larga { width: min(1080px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.fs-finestra.larga .fs-finestra-corpo { overflow-y: auto; }
.confronto { position: relative; width: 100%; border-radius: var(--r-2); overflow: hidden; background: var(--fondo-3); user-select: none; touch-action: pan-y; }
.confronto img { display: block; width: 100%; height: auto; }
.confronto .sopra { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.confronto .sopra img { width: 100%; height: 100%; object-fit: contain; }
.confronto .linea { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); pointer-events: none; }
.confronto .linea::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-size: 15px; font-weight: 600; box-shadow: var(--ombra-pop); }
.confronto .tag { position: absolute; top: 10px; padding: 2px 8px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: var(--peso-medio); pointer-events: none; }
.confronto .tag.prima { left: 10px; } .confronto .tag.dopo { right: 10px; }
.confronto input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.dettaglio-esito { display: grid; gap: var(--s-2); }
.dettaglio-esito .riga { display: flex; gap: var(--s-3); font-size: var(--t-s); }
.dettaglio-esito .riga dt { color: var(--testo-3); min-width: 110px; }
.dettaglio-esito .riga dd { margin: 0; color: var(--testo); }

/* ---------- Caricamenti e impostazioni ---------- */
.elenco-lavori { display: grid; gap: 0; border: var(--bordo); border-radius: var(--r-2); background: var(--superficie); overflow: hidden; }
.elenco-lavori a { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--s-5); border-top: var(--bordo); font-size: var(--t-s); }
.elenco-lavori a:first-child { border-top: 0; }
.elenco-lavori a:hover { background: var(--fondo-2); }
.elenco-lavori .quando { min-width: 140px; color: var(--testo); font-weight: var(--peso-medio); }
.elenco-lavori .cosa { color: var(--testo-2); flex: 1; }
.vuoto { padding: var(--s-8) var(--s-5); text-align: center; color: var(--testo-3); font-size: var(--t-s); border: 1px dashed var(--linea); border-radius: var(--r-2); }
.impostazioni { display: grid; gap: var(--s-5); max-width: 640px; }
.impostazioni .gruppo { display: grid; gap: var(--s-2); }
.impostazioni .gruppo h2 { font-size: var(--t-m); font-weight: var(--peso-titolo); }
.impostazioni .gruppo p { font-size: var(--t-s); color: var(--testo-2); line-height: 1.5; }
.impostazioni .nomi { display: grid; grid-template-columns: 120px 1fr; gap: var(--s-2) var(--s-3); align-items: center; font-size: var(--t-s); }
.impostazioni input[type=text] { height: 36px; padding: 0 10px; border: var(--bordo); border-radius: var(--r-1); background: var(--superficie); font-size: 16px; width: 100%; }
.impostazioni .fs-scelta small.spento { color: var(--attenzione); }

@media (max-width: 900px) {
  .fs-top .logo-top, .fs-top .nome-utente, .fs-top .fs-avatar { display: none; }
  .griglia-foto { grid-template-columns: 1fr; }
  .zona { padding: var(--s-8) var(--s-4); }
  .riepilogo { padding: var(--s-3) var(--s-4); }
  .riepilogo .fs-btn { width: 100%; justify-content: center; }
  .elenco-lavori a { flex-wrap: wrap; gap: 2px var(--s-3); padding: var(--s-3) var(--s-4); }
  .elenco-lavori .quando { min-width: 0; flex-basis: 100%; }
  .modello { width: 100%; }
  .modello .fs-seg { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .fs-finestra.larga { max-height: 94dvh; }
}
