/* Stile coerente con simonecastellan.com — minimale, monocromatico, luce.
   Le classi ricalcano quelle degli altri strumenti: .btn, .seg, .dropzone,
   .site-footer, .toast, .hidden. */
:root {
  --bg: #ffffff;
  --text: #3c4043;
  --ink: #1a1a1a;
  --muted: #5f6368;
  --muted-2: #68716d;
  --faint: #68716d;
  --pill: #f1f3f4;
  --pill-hover: #e6e8ea;
  --line: #c2c6cc;
  --line-soft: #dadce0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

button, input, summary { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  /* In orizzontale il notch mangia un lato: senza «env(safe-area-inset-left)»
     e «-right» la prima colonna di testo finisce sotto la tacca o sotto
     l'angolo tondo. Il «max()» tiene i 20px di sempre quando l'incavo non
     c'è — cioè su tutto quello che non è un iPhone ruotato (15/08/2026). */
  padding: 44px max(20px, env(safe-area-inset-right)) calc(60px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  text-align: center;
}

.card { width: 100%; max-width: 560px; }

header { margin-bottom: 26px; }
h1 { font-size: 27px; font-weight: 500; color: var(--ink); letter-spacing: -0.3px; }
.subtitle { font-size: 16px; color: var(--muted); margin-top: 9px; }

/* Drop zone */
.dropzone {
  border: 1.5px dashed var(--line-soft);
  border-radius: 22px;
  padding: 38px 20px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  background: #fafbfc;
}
.dropzone:hover { background: var(--pill); }
.dropzone.dragover { background: var(--pill); border-color: var(--muted-2); }
.dz-title { font-size: 16px; font-weight: 500; color: var(--ink); }
.dz-or { color: var(--faint); margin: 6px 0 16px; font-size: 13px; }

.claims { margin-top: 16px; font-size: 12px; color: var(--faint); }

/* Bottoni */
.btn {
  appearance: none; border: none; border-radius: 999px;
  padding: 12px 22px; font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s ease, opacity .15s ease;
}
.btn-primary { background: var(--ink); color: #fff; width: 100%; }
.btn-primary:hover { background: #000; }
.btn-secondary { background: var(--pill); color: var(--ink); width: 100%; }
.btn-secondary:hover { background: var(--pill-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost {
  background: transparent; color: var(--muted); font-weight: 500; font-size: 13px;
  margin-top: 12px; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 0 1px;
}
.btn-ghost:hover { color: var(--ink); }
.dropzone .btn { width: auto; min-width: 170px; }

.link-piccolo {
  appearance: none; border: none; background: none; font-family: inherit;
  font-size: 12px; color: var(--muted); cursor: pointer; padding: 0 0 1px;
  border-bottom: 1px solid var(--line-soft);
}
.link-piccolo:hover { color: var(--ink); border-color: var(--line); }

/* Stato ed errore */
.status { padding: 24px 0; }
.status-text { color: var(--muted); font-size: 15px; }
.errore { margin-top: 18px; padding: 16px 18px; background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 16px; }
.errore-msg { font-size: 14px; line-height: 1.55; color: var(--ink); }

/* Riga della foto caricata */
.riga-foto {
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 26px;
}
.nome-foto { font-size: 13px; color: var(--muted-2); word-break: break-all; }

.domanda { font-size: 14px; color: var(--ink); font-weight: 500; margin-bottom: 12px; }

/* Chip delle piattaforme */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  appearance: none; border: 1px solid var(--line-soft); background: #fff;
  color: var(--muted); font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { border-color: var(--line); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Esito del controllo */
.riga-file {
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin: 26px 0 22px;
}
.scheda { font-size: 13px; color: var(--muted-2); word-break: break-all; font-variant-numeric: tabular-nums; }

.elenco { text-align: left; }
.piattaforma + .piattaforma { margin-top: 22px; }
.piattaforma-nome {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted-2); margin-bottom: 8px;
}
.uso {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 2px; border-top: 1px solid #eef0f2; font-size: 14px; line-height: 1.5;
}
.piattaforma .uso:first-of-type { border-top: none; }
.segno {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; align-self: flex-start; margin-top: 1px;
}
.uso.ok .segno { background: var(--pill); color: var(--ink); }
.uso.attenzione .segno { background: #fdf1dc; color: #b06000; }
.uso.no .segno { background: #fdeceb; color: #c5221f; }
.uso-testo { flex: 1; color: var(--muted); }
.uso-testo b { color: var(--ink); font-weight: 600; }
.uso.ok .uso-testo { color: var(--muted-2); }
.aggiusta {
  flex: 0 0 auto; align-self: center;
  background: var(--ink); color: #fff; text-decoration: none;
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600;
}
.aggiusta:hover { background: #000; }
.nota-finale { margin-top: 20px; font-size: 12.5px; line-height: 1.6; color: var(--faint); text-align: left; }

/* Risultati */
.risultati { margin-top: 26px; text-align: left; }
.gruppo + .gruppo { margin-top: 26px; }
.gruppo-nome {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted-2); margin-bottom: 10px;
}
.formati { display: flex; flex-direction: column; gap: 10px; }

.formato {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; border: 1px solid #eef0f2; border-radius: 16px; background: #fff;
}
.anteprima {
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--pill);
  cursor: grab;
  touch-action: none;               /* il trascinamento è nostro, non della pagina */
  box-shadow: 0 0 0 1px rgba(0,0,0,.06) inset;
  max-height: 132px;
}
.anteprima:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.anteprima.in-mano { cursor: grabbing; }
.anteprima.staccata { box-shadow: 0 0 0 2px var(--ink) inset; }

.formato-testo { min-width: 0; flex: 1; }
.formato-nome { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.formato-nota { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.formato-misura {
  font-size: 12px; color: var(--muted-2); margin-top: 4px;
  font-variant-numeric: tabular-nums; line-height: 1.4;
}
.formato-misura.scarsa { color: #b06000; }
.formato-azioni { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.f-dl {
  appearance: none; border: none; background: var(--pill); color: var(--ink);
  border-radius: 999px; padding: 6px 15px; font-size: 12.5px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background .15s ease;
}
.f-dl:hover { background: var(--pill-hover); }

.aiuto { margin-top: 18px; font-size: 12px; line-height: 1.6; color: var(--faint); }

/* Zoom */
.riga-zoom { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.riga-zoom label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-2); }
.range {
  appearance: none; -webkit-appearance: none; flex: 1;
  height: 4px; border-radius: 999px; background: var(--line-soft); cursor: pointer; outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); cursor: pointer;
}
.range::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--ink); }

.azioni { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

/* Opzioni avanzate */
.avanzate { margin-top: 18px; text-align: left; }
.avanzate summary {
  font-size: 13px; color: var(--muted); cursor: pointer; list-style: none;
  border-bottom: 1px solid var(--line-soft); display: inline-block; padding-bottom: 1px;
}
.avanzate summary::-webkit-details-marker { display: none; }
.avanzate summary:hover { color: var(--ink); }
.avanzate .seg { margin-top: 12px; }
.avanzate-nota { font-size: 12px; color: var(--faint); margin-top: 10px; line-height: 1.5; }

.seg { display: inline-flex; gap: 3px; background: var(--pill); border-radius: 999px; padding: 4px; }
.seg-btn {
  appearance: none; border: none; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.privacy { margin-top: 26px; font-size: 12px; color: var(--faint); }

/* Spiegazione e domande */
.spiega { margin-top: 48px; padding-top: 30px; border-top: 1px solid #eef0f2; text-align: left; }
.spiega h2 { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.spiega h2 + p { margin-bottom: 12px; }
.spiega h3 { font-size: 14.5px; font-weight: 600; color: var(--ink); margin: 20px 0 6px; }
.spiega p { font-size: 14px; line-height: 1.65; color: var(--muted); }
.spiega h2:not(:first-child) { margin-top: 34px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500;
  padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; z-index: 20; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
.site-footer {
  margin-top: 44px; text-align: center; font-size: 12px; color: #6b7075; letter-spacing: .2px;
}
.site-footer a { color: #6b7075; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.site-footer a:hover { color: var(--ink); }

.hidden { display: none !important; }

@media (max-width: 460px) {
  body { padding-top: 32px; }
  h1 { font-size: 23px; }
  .subtitle { font-size: 15px; }
  .formato { gap: 12px; padding: 10px; }
  .formato-nome { font-size: 14px; }
  .chip { font-size: 13px; padding: 9px 14px; }
}

/* ---- Estrai un fotogramma ------------------------------------------------- */
.video {
  width: 100%; max-height: 46vh; display: block;
  background: #111; border-radius: 14px; margin-top: 4px;
}
.riga-tempo { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.tempo {
  font-size: 13px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; min-width: 44px; text-align: right;
}
.passi { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.step {
  appearance: none; border: none; background: var(--pill); color: var(--ink);
  width: 44px; height: 44px; border-radius: 999px; font-size: 17px; line-height: 1;
  cursor: pointer; flex: 0 0 auto; transition: background .15s ease;
}
.step:hover { background: var(--pill-hover); }
.step:active { background: var(--line-soft); }
.step.play { background: var(--ink); color: #fff; font-size: 15px; }
.step.play:hover { background: #000; }

.strisciaTitolo {
  margin-top: 22px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted-2); text-align: left;
}
.striscia {
  display: flex; gap: 6px; margin-top: 8px; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: thin;
}
.mini {
  height: 74px; border-radius: 8px; cursor: pointer; flex: 0 0 auto;
  background: var(--pill); transition: outline-color .15s ease;
  outline: 2px solid transparent; outline-offset: -2px;
}
.mini:hover { outline-color: var(--ink); }

@media (max-width: 460px) {
  .video { max-height: 38vh; }
  .step { width: 40px; height: 40px; }
}


/* ————— La voce comune (12/08/2026) —————
   L'intestazione va a sinistra: la seconda riga del titolo finisce la frase
   della prima, e quella figura centrata si legge peggio. Il resto della
   pagina resta com'era. */
header { text-align: left; margin-bottom: 30px; }

/* Il pulsante che porta dentro il video è il gesto principale. */
.dropzone .btn-secondary { background: var(--teal-l); color: var(--teal-scuro); }
.dropzone .btn-secondary:hover { background: var(--teal); }
.btn-primary { background: var(--teal-l); color: var(--teal-scuro); }
.btn-primary:hover { background: var(--teal); }
