/* ==================================================
   RESET & BOX MODEL
   ================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Classe utility per testo visibile solo agli screen reader */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================================================
   BASE LAYOUT
   ================================================== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
}

/* ==================================================
   HEADER
   ================================================== */
#headerBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: bold;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e0e0e0;
  color: #333;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.divider {
  width: 1px;
  height: 22px;
  background: #cfcfcf;
}

/* ==================================================
   VIEWPORT PIANTINA
   ================================================== */
#svgContainer {
  width: 100%;
  height: calc(100vh - 180px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  margin: 0;
  touch-action: none;
  user-select: none;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (min-width: 1024px) {
  #svgContainer {
    height: calc(100vh - 140px);
  }
}

#svgContainer svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
}

/* ==================================================
   CONTROLLI ZOOM
   ================================================== */
#zoomControls.zoom-compact {
  display: flex;
  align-items: center;
  gap: 6px;
}

#zoomControls.zoom-compact button {
  background: #c8cbd0;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  /* reset della regola button{} globale non più necessario
     perché quella regola è stata rimossa */
}

#zoomControls.zoom-compact button:hover {
  background: #bbb;
}

/* ==================================================
   STATI POSTI (SVG)
   ================================================== */
.posto {
  fill: #dddddd;
  cursor: pointer;
}

.posto:hover {
  fill: #3ccc15;
}

/* I fill SVG hanno specificità bassa: !important necessario
   per battere gli attributi fill inline dell'SVG */
.posto.selected {
  fill: #007bff !important;
}

.posto.occupied {
  fill: #dc3545 !important;
  cursor: not-allowed;
  pointer-events: none;
}

.posto.bloccato {
  fill: #ff8888 !important;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

/* 🟠 Posto con ordine pending di un altro utente (checkout in corso):
   colore arancione, non cliccabile ma con eventi (per il toast esplicativo) */
.posto.pending-payment {
  fill: #fd7e14 !important;
  cursor: not-allowed;
}
.posto.pending-payment:hover {
  fill: #e8700f !important;
}

/* ==================================================
   BOTTONI — regola base minimale
   ================================================== */

/* Regola base: solo le proprietà comuni a TUTTI i button.
   Ogni componente specifica le proprie dimensioni e colori. */
button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* Pulsante principale (prenota) */
.prenota-button {
  display: block;
  background-color: #007bff;
  color: #fff;
  font-size: 1.3rem;
  padding: 14px 32px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  margin: 0 auto;
}

.prenota-button:hover:enabled {
  background-color: #0056b3;
}

.prenota-button:disabled {
  background-color: #bdbdbd;
  color: #f7f7f7;
}

/* ==================================================
   GRUPPI DI BOTTONI NELLE MODALI
   ================================================== */
.button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1rem;
}

.button-group button {
  flex: 1;
  background-color: #007bff;
  color: #fff;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.button-group button:hover:enabled {
  background-color: #0056b3;
}

.button-group button:disabled {
  background-color: #aaa;
}

/* Variante annulla */
.button-group button.annulla,
button.annulla {
  background-color: #e0e0e0;
  color: #333;
}

.button-group button.annulla:hover:enabled,
button.annulla:hover:enabled {
  background-color: #cfcfcf;
}

/* ==================================================
   MODALI
   ================================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  padding: 0;
  width: min(90vw, 480px);
  max-height: 92vh;
  overflow: hidden;
  flex-direction: column;
  font-family: "Helvetica Neue", sans-serif;
  animation: fadeIn 0.3s ease-out;
}

/* Modale completata: nascosta con classe .hidden (toglie hidden via JS) */
.modal.hidden {
  display: none !important;
}

/* ── Header modale con bordo inferiore ── */
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eee;
  position: relative;
  flex-shrink: 0;
}

.modal-content {
  display: flex;
  flex-direction: column;
  position: relative;
  max-height: 92vh;
  overflow: hidden;
  padding: 0;
}

/* Titolo h2 dentro modal-content (senza modal-header) */
.modal-content > h2 {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0;
  color: #222;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

/* Titolo h2 dentro modal-header */
.modal-header h2,
.modal h2 {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0;
  color: #222;
}

/* Corpo scrollabile */
.modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 24px;
}

/* Form interno: scorre liberamente */
.modal-content form {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  padding: 20px 24px 0;
  min-height: 0;
}

/* Bottoni: sticky in fondo */
.modal-content .button-group {
  flex-shrink: 0;
  background: #fff;
  padding: 12px 24px 20px;
  border-top: 1px solid #eee;
  margin-top: 4px;
  gap: 10px;
}

/* Pulsante di chiusura (×) */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: bold;
  color: #777;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.modal-close:hover {
  background: #222;
  color: #fff;
  border-color: #222;
}

.modal-close:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* ── Etichetta step numero (es. "1️⃣") ── */
.modal h2 {
  padding-right: 36px; /* spazio per la X */
}

@media (min-width: 1024px) {
  .modal {
    width: min(75vw, 680px);
  }

  .modal-content > h2,
  .modal-header {
    padding: 24px 32px 18px;
  }

  .modal-content form {
    padding: 20px 32px 0;
  }

  .modal-content .button-group {
    padding: 14px 32px 24px;
  }

  .modal-body {
    padding: 20px 32px;
  }

  .modal-close {
    top: 20px;
    right: 24px;
  }
}

/* ==================================================
   FORM
   ================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: #444;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  font-family: inherit;
}

/* ==================================================
   VALIDAZIONE CAMPI
   ================================================== */
.field-error {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #b91c1c;
  min-height: 1em;
}

.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.is-valid {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* ==================================================
   PRIVACY CHECKBOX
   ================================================== */
.privacy-row {
  margin-bottom: 16px;
}

.privacy-text {
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #333;
}

.privacy-accept {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #222;
  cursor: pointer;
}

.privacy-accept input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #007bff;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  cursor: pointer;
  background: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  margin: 0;
  flex-shrink: 0;
}

.privacy-accept input[type="checkbox"]:checked {
  background-color: #007bff;
  border-color: #007bff;
}

.privacy-accept input[type="checkbox"]:checked::after {
  content: "✔";
  color: #fff;
  font-size: 13px;
  position: absolute;
  top: -1px;
  left: 2px;
}

.privacy-accept input[type="checkbox"]:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Evidenziazione riga privacy quando manca il consenso */
.privacy-row {
  border: 2px solid transparent;   /* spazio riservato: evita il salto layout */
  border-radius: 8px;
  padding: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.privacy-row.invalid {
  border-color: #ef4444;
  background-color: #fff5f5;
}

/* ==================================================
   RIEPILOGO
   ================================================== */
.riepilogo-info-spettacolo {
  margin-top: 4px;
}

.riepilogo-info-spettacolo h3 {
  font-weight: bold;
  color: #222;
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.riepilogo-info-spettacolo p {
  color: #555;
  font-style: italic;
  margin: 0;
  font-size: 0.88rem;
}

.riepilogo-sezione {
  margin-bottom: 16px;
}

.riepilogo-label {
  font-size: 0.68rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 6px;
}

.riepilogo-prenotatore {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
}

.riepilogo-ospiti {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.riepilogo-ospite {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #222;
}

.riepilogo-ospite-num {
  font-size: 0.8rem;
  font-weight: bold;
  color: #007bff;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.riepilogo-totale-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0 4px;
  border-top: 1px solid #eee;
  margin-top: 4px;
  gap: 12px;
}

.riepilogo-totale-label {
  font-size: 0.88rem;
  color: #555;
}

.riepilogo-totale-valore {
  font-size: 1.5rem;
  font-weight: bold;
  color: #111;
  white-space: nowrap;
}

.riepilogo-nota {
  font-size: 0.75rem;
  color: #999;
  margin-top: 3px;
}

/* ==================================================
   MODALE SPETTATORI — layout a due colonne
   ================================================== */

/* Riga intestazione colonne */
.spett-header-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  gap: 8px;
  padding: 0 0 6px;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}

.spett-col-label {
  font-size: 0.8rem;
  font-weight: bold;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Riga singolo spettatore */
.spett-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}

.spett-index {
  font-size: 0.85rem;
  font-weight: bold;
  color: #007bff;
  text-align: center;
  padding-top: 10px; /* allinea con l'input */
}

.spett-field {
  display: flex;
  flex-direction: column;
}

.spett-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: bold;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.spett-field input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.spett-field .field-error {
  font-size: 0.75rem;
  min-height: 1em;
}

@media (max-width: 600px) {
  .spett-header-row,
  .spett-row {
    grid-template-columns: 22px 1fr 1fr;
    gap: 6px;
  }
}
#intestazioneSpettacolo .cal-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#intestazioneSpettacolo .cal-icon {
  width: 48px;
  height: 48px;
  display: inline-block;
  vertical-align: middle;
}

#intestazioneSpettacolo .ora-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #efefef;
  font-size: 14px;
  line-height: 1.2;
  color: #333;
  vertical-align: middle;
}

/* ==================================================
   BARRA PRENOTAZIONE (fissa in basso)
   ================================================== */
#infoPrenotazione {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  z-index: 1000;
}

/* ==================================================
   OVERLAY CODA (blocca visivamente gli utenti in attesa)
   ================================================== */
#overlayBloccaCoda {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(200, 200, 200, 0.85);
  justify-content: center;
  align-items: center;
  text-align: center;
}

#overlayBloccaCoda h2 {
  color: #444;
}

#overlayBloccaCoda p {
  font-size: 18px;
}

/* ==================================================
   OVERLAY INTERAZIONI (sfondo scuro sotto le modali)
   ================================================== */
#overlayBloccaInterazioni {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 800;
}

/* ==================================================
   BARRA DI AVANZAMENTO
   ================================================== */
/* Overlay scuro dedicato alla barra attesa */
#barraAttesaOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
}
#barraAttesaOverlay.attivo { display: block; }

#barraAttesa {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 460px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  font-family: "Helvetica Neue", sans-serif;
  animation: fadeIn 0.3s ease-out;
}
#barraAttesa.attiva { display: block; }

/* Header barra con bordo inferiore */
#barraAttesaHeader {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eee;
  text-align: center;
}

#barraMessaggio {
  font-size: 1rem;
  font-weight: bold;
  color: #222;
  line-height: 1.4;
  margin: 0;
  text-align: center;
}

/* Corpo con progress bar */
#barraAttesaBody {
  padding: 20px 24px 24px;
}

.barra-track {
  width: 100%;
  background-color: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

#barraInterna {
  width: 0%;
  height: 16px;
  background-color: #007bff;
  border-radius: 8px;
  transition: width 1s ease-in-out;
}

/* ==================================================
   TOAST (notifiche centrate) — stile modale
   ================================================== */
.toast-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  width: min(90vw, 520px);
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
  font-family: "Helvetica Neue", sans-serif;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.97);
  /* posizionamento assoluto come le modali */
  position: fixed;
  left: 50%;
  top: 50%;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast.hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.97);
}

/* Header del toast con titolo e bordo */
.toast-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid #eee;
  font-size: 1.1rem;
  font-weight: bold;
  color: #222;
  line-height: 1.3;
}

/* Corpo del toast */
.toast-body {
  padding: 16px 24px;
  font-size: 0.92rem;
  color: #444;
  line-height: 1.6;
}

.toast-body a {
  color: #007bff;
  text-decoration: underline;
}

/* Bottone CHIUDI — stile button-group */
.toast-footer {
  padding: 0 24px 20px;
}

.toast button {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  background-color: #007bff;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

.toast button:hover { background-color: #0056b3; }

/* Varianti colore — solo il bordo superiore dell'header */
.toast.is-success .toast-header { border-top: 4px solid #22c55e; border-radius: 12px 12px 0 0; }
.toast.is-error   .toast-header { border-top: 4px solid #ef4444; border-radius: 12px 12px 0 0; }
.toast.is-info    .toast-header { border-top: 4px solid #3b82f6; border-radius: 12px 12px 0 0; }

/* Sezione PDF links */
.toast-pdf-section {
  padding: 12px 0 4px;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

.toast-pdf-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toast-pdf-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast-pdf-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #007bff;
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.toast-pdf-link:hover { background: #0056b3; }

.toast-pdf-nota {
  font-size: 0.75rem;
  color: #888;
  margin-top: 8px;
  line-height: 1.4;
}

/* Overlay di sfondo per i toast */
.toast-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.toast-overlay.show { opacity: 1; }
.toast-overlay.hide { opacity: 0; }

/* ==================================================
   RECUPERO PDF (input email in header)
   ================================================== */
.pdf-recover {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 3px 6px;
}

.pdf-recover input {
  width: 220px;
  max-width: 34vw;
  border: none;
  outline: none;
  font-size: 0.92rem;
  padding: 6px 8px;
  font-family: inherit;
}

.pdf-recover button {
  margin: 0;
  padding: 6px 10px;
  font-size: 0.95rem;
  color: #fff;
  background: #007bff;
  border-radius: 8px;
}

.pdf-recover button:hover {
  background: #0056b3;
}

/* ==================================================
   MODALE RECUPERO PDF (lista prenotazioni)
   ================================================== */
.pdf-access-hint {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #555;
}

.pdf-access-welcome {
  margin: 6px 0 10px;
  font-size: 0.95rem;
  color: #333;
}

.pdf-access-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 6px;
}

.pdf-access-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fafafa;
}

.pdf-access-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #111;
}

.pdf-access-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

a.pdf-access-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: #fff;
  border: 1px solid #dbe1ea;
  border-radius: 10px;
  padding: 10px 12px;
  color: #0b4dbb;
}

a.pdf-access-link:hover {
  border-color: #9fb7e6;
  background: #f6faff;
}

.pdf-access-link .meta {
  color: #333;
  font-weight: 600;
}

.pdf-access-link .icon {
  color: #b91c1c;
  font-size: 1.1rem;
}

/* Intestazione spettacolo nella lista biglietti personali */
.pdf-access-show-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.pdf-access-show-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #1e3a8a;
  font-weight: 700;
}

.pdf-access-show-date {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 400;
}

/* Biglietto senza PDF ancora disponibile */
.pdf-access-no-pdf {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

/* ── Accordion biglietti per spettacolo ── */
.pdf-accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
}
.pdf-accordion-trigger:hover .pdf-accordion-title {
  text-decoration: underline;
}
.pdf-accordion-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.pdf-accordion-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-accordion-date {
  font-size: 0.82rem;
  color: #6b7280;
}
.pdf-accordion-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pdf-accordion-count {
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
}
.pdf-accordion-arrow {
  font-size: 0.7rem;
  color: #9ca3af;
}
.pdf-accordion-body {
  margin-top: 10px;
}

/* ==================================================
   POPUP ISTRUZIONI (PNG scorrevoli)
   ================================================== */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 16px;
}

.tutorial-modal {
  position: relative;
  width: min(980px, 96vw);
  height: min(90vh, 720px);
  background: transparent;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* X — angolo in alto a destra della modale, sempre */
.tutorial-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.tutorial-close:focus-visible,
.tutorial-arrow:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.tutorial-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* spazio per frecce laterali */
  padding: 0 60px;
}

.tutorial-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* Frecce — centrate verticalmente sui lati del modal */
.tutorial-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-arrow:hover {
  background: rgba(255, 255, 255, 0.25);
}

.tutorial-arrow--prev { left: 10px; }
.tutorial-arrow--next { right: 10px; }

/* Pallini — in fondo alla modale, sempre */
.tutorial-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.tutorial-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.tutorial-dot.is-active {
  background: rgba(255, 255, 255, 0.95);
}

/* ==================================================
   ANIMAZIONE FADE-IN MODALI
   ================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ==================================================
   RESPONSIVE — MOBILE (≤ 600px)
   ================================================== */
@media (max-width: 600px) {
  #headerBar {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  #intestazioneSpettacolo,
  .header-title {
    width: 100%;
    justify-content: center;
    font-size: 1.4rem;
  }

  #headerBar .toolbar {
    display: inline-flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 auto;
  }

  .toolbar > * {
    display: flex;
    align-items: center;
  }

  .divider {
    display: inline-block;
    align-self: center;
    width: 1px;
    height: 24px;
    background: #cfcfcf;
  }

  .badge {
    font-size: 0.9rem;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
  }

  #zoomControls.zoom-compact button {
    padding: 4px 8px;
    font-size: 14px;
  }

  #svgContainer {
    height: calc(100vh - 260px);
  }

  .modal {
    width: 92vw;
    padding: 0;                 /* gestito da modal-content */
    border-radius: 14px;
    max-height: 90vh;
    z-index: 1100;              /* sopra #infoPrenotazione (z-index: 1000) */
  }

  .modal-content {
    padding: 1.25rem;
    max-height: 90vh;
  }

  .pdf-recover {
    width: 100%;
    justify-content: center;
  }

  .pdf-recover input {
    width: min(320px, 70vw);
    max-width: 70vw;
  }

  .tutorial-modal {
    height: min(92vh, 680px);
  }

}

/* ── Riga biglietto con pulsante condivisione ── */
.pdf-access-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdf-access-row .pdf-access-link {
  flex: 1;
  min-width: 0;
}

.pdf-share-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #dbe1ea;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1rem;
  color: #6b7280;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.pdf-share-btn:hover {
  background: #f0f4ff;
  border-color: #9fb7e6;
}
