/* Pixtival: stile comune delle pagine per ospiti e staff */
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-variabile.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Big Shoulders Display';
  src: url('../fonts/big-shoulders-display-900.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

/* Colori del sito: viola come colore principale (brand/README.md).
   Il viola dei pulsanti è un filo più scuro di quello del logo, così il testo bianco
   ha il contrasto minimo per la lettura. */
:root {
  --sfondo: #fbf8f3;
  --superficie: #ffffff;
  --testo: #17142b;
  --tenue: #6c6880;
  --linea: #e6e0d6;
  --accento: #6b4bf0;
  --accento-testo: #ffffff;
  --accento-forte: #5a3be0;
  --accento-tenue: #eeeaff;
  --sole: #ffc23d;
  --ok: #1d7a4f;
  --attesa: #a15c00;
  --errore: #b3261e;
  --raggio: 14px;
  --ombra: 0 1px 2px rgba(23, 20, 43, .06), 0 4px 16px rgba(23, 20, 43, .06);
  --font: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-titoli: 'Big Shoulders Display', 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sfondo: #0d0b18;
    --superficie: #1b1830;
    --testo: #fbf8f3;
    --tenue: #a39fb3;
    --linea: #2d2944;
    --accento-forte: #a08bff;
    --accento-tenue: #2a2150;
    --ok: #5fd39a;
    --attesa: #ffb54d;
    --errore: #ff8a80;
    --ombra: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sfondo: #0d0b18;
  --superficie: #1b1830;
  --testo: #fbf8f3;
  --tenue: #a39fb3;
  --linea: #2d2944;
  --accento-forte: #a08bff;
  --accento-tenue: #2a2150;
  --ok: #5fd39a;
  --attesa: #ffb54d;
  --errore: #ff8a80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sfondo);
  color: var(--testo);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accento-forte); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-family: var(--font-titoli); font-weight: 900; font-size: 2.35rem; line-height: 1.02; letter-spacing: .01em; text-transform: uppercase; }
h2 { font-weight: 800; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.contenitore { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.contenitore.largo { max-width: 1180px; }

.marchio { display: inline-block; line-height: 0; text-decoration: none; }
.marchio img { height: 25px; width: auto; }

.tenue { color: var(--tenue); }
.piccolo { font-size: .875rem; }
.centro { text-align: center; }

.scheda {
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: var(--raggio);
  padding: 20px;
  box-shadow: var(--ombra);
}
.scheda + .scheda { margin-top: 16px; }

.pulsante {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 0;
  background: var(--accento);
  color: var(--accento-testo);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease;
}
.pulsante:active { transform: scale(.98); }
.pulsante:disabled { opacity: .5; cursor: default; }
.pulsante.pieno { width: 100%; }
.pulsante.secondario { background: transparent; color: var(--testo); border: 1.5px solid var(--linea); }
.pulsante.leggero { background: var(--accento-tenue); color: var(--accento-forte); }
.pulsante.pericolo { background: var(--errore); color: #fff; }
.pulsante.piccolo { min-height: 36px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.pulsanti { display: flex; gap: 10px; flex-wrap: wrap; }
.pulsanti.colonna { flex-direction: column; }

label.campo { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="datetime-local"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--testo);
  background: var(--superficie);
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  padding: 12px 14px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .pulsante:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accento) 45%, transparent);
  outline-offset: 2px;
}
.scelta { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.scelta input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accento); flex: none; }

/* Schede di navigazione (solo testo) */
.schede {
  display: flex;
  gap: 2px;
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 4px;
  margin: 16px 0;
  overflow-x: auto;
}
.schede button {
  flex: 1 1 auto;
  min-width: max-content;   /* mai testi sovrapposti: se non c'è spazio, le schede scorrono */
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--tenue);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}
.schede button[aria-selected="true"] { background: var(--accento-tenue); color: var(--accento-forte); }

/* Griglia di foto */
.griglia {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
@media (min-width: 700px) { .griglia { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; } }
.tessera {
  position: relative;
  aspect-ratio: 1;
  background: var(--linea);
  border-radius: 8px;
  overflow: hidden;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.tessera img { width: 100%; height: 100%; object-fit: cover; }
.etichetta {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
}
.etichetta.attesa { background: var(--attesa); }
.etichetta.nascosta { background: #444; }
.etichetta.errore { background: var(--errore); }
.etichetta.ok { background: var(--ok); }

/* Visore a tutto schermo */
.visore {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 8, 20, .94);
  display: flex;
  flex-direction: column;
  color: #fff;
}
.visore .immagine { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px; }
.visore .immagine img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; }
.visore .barra { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.visore .didascalia { font-size: .9rem; color: #d8d4e6; }
.visore .pulsante.secondario { color: #fff; border-color: rgba(255, 255, 255, .3); }

/* Finestra di dialogo */
dialog {
  border: 0;
  border-radius: var(--raggio);
  padding: 22px;
  width: min(460px, calc(100vw - 32px));
  background: var(--superficie);
  color: var(--testo);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
dialog::backdrop { background: rgba(10, 8, 20, .6); }

/* Avvisi brevi */
.avviso {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  background: var(--testo);
  color: var(--sfondo);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  max-width: calc(100vw - 32px);
  box-shadow: var(--ombra);
}
.avviso.errore { background: var(--errore); color: #fff; }

.barra-avanzamento { height: 8px; background: var(--linea); border-radius: 999px; overflow: hidden; }
.barra-avanzamento div { height: 100%; width: 0; background: var(--accento); transition: width .3s ease; }

.nota {
  background: var(--accento-tenue);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: .925rem;
}
/* Stampa delle foto (pagina dei partecipanti) */
#notaStampa { margin: 0 0 14px; }
.stampe-mie { margin-bottom: 16px; }
.stampe-mie h2 { margin: 0 0 8px; }
.stampa-mia { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--linea); }
.stampa-mia:last-child { border-bottom: 0; }
.stampa-mia img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; background: var(--linea); }
.stampa-mia > div { flex: 1; min-width: 0; }
.stampa-mia .pronta { color: var(--ok); font-weight: 700; }

.piede { margin-top: 32px; font-size: .8rem; color: var(--tenue); text-align: center; }
.piede a { color: inherit; }
