/* Terrazza Iris — Aperilungo · 29.07.2026
   Tema: l'ora del tramonto sull'iris — notte indaco, viola iris, oro ambrato. */

:root {
  --notte: #14102b;
  --indaco: #241c49;
  --iris: #8b7be0;
  --iris-chiaro: #b3a7f0;
  --oro: #d9a659;
  --oro-chiaro: #ecc98f;
  --crema: #f3ede2;
  --crema-40: rgba(243, 237, 226, 0.4);
  --crema-70: rgba(243, 237, 226, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  background: var(--notte);
  color: var(--crema);
  font-family: 'Jost', system-ui, sans-serif;
  font-weight: 300;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--oro-chiaro); }

.iris-logo { color: var(--oro); }
.logo-link { color: var(--oro); display: inline-flex; }

.wordmark {
  font-family: 'Italiana', serif;
  font-size: 1.35rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--crema);
}
.wordmark.small { font-size: 0.95rem; letter-spacing: 0.38em; }

.event-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--iris-chiaro);
  font-size: clamp(4rem, 14vw, 8.5rem);
  line-height: 1;
  letter-spacing: 0.01em;
}
.event-name.small { font-size: clamp(2rem, 8vw, 2.8rem); }

.event-date {
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--crema-70);
}
.event-date.small { font-size: 0.78rem; }
/* Data e orario: mai spezzati a metà; su schermi stretti vanno su due righe senza puntino */
.dr { white-space: nowrap; }
@media (max-width: 480px) {
  .sep { display: none; }
  .event-date .dr, .wordmark .dr { display: block; }
}

.rule {
  width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--oro), transparent);
  margin: 1.6rem auto;
}

/* ——— Orizzonte al tramonto: la firma della pagina ——— */
.horizon {
  position: fixed;
  inset: auto 0 0 0;
  height: 34vh;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 108%, rgba(217, 166, 89, 0.28) 0%, rgba(180, 100, 120, 0.16) 34%, rgba(139, 123, 224, 0.10) 58%, transparent 78%);
  animation: respiro 9s ease-in-out infinite alternate;
}
@keyframes respiro {
  from { opacity: 0.75; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .horizon { animation: none; }
}

/* ——— Home: manifesto/invito ——— */
.page-landing .poster {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.1rem;
  padding: 2rem 1.5rem 18vh;
}
.poster-top { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.event-note { color: var(--crema-70); line-height: 1.8; letter-spacing: 0.04em; }

/* Navigazione discreta in fondo alla home: per host, organizzazione e staff */
.footer-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--crema-40);
}
.footer-nav a {
  color: var(--crema-40);
  text-decoration: none;
  padding: 0.4rem 0.2rem; /* area tocco comoda al telefono */
}
.footer-nav a:hover, .footer-nav a:focus-visible { color: var(--oro-chiaro); }

/* ——— Pagine a scheda (invito, biglietto, login) ——— */
.card-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem 16vh;
}
.card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  background: linear-gradient(175deg, var(--indaco), rgba(36, 28, 73, 0.35));
  border: 1px solid rgba(217, 166, 89, 0.28);
  border-radius: 4px;
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.card .rule { margin: 0.5rem auto; }
.card-head { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; }
.card-intro { color: var(--crema-70); line-height: 1.7; }

.reg-form { width: 100%; display: flex; flex-direction: column; gap: 1rem; margin-top: 0.4rem; }
.reg-form label {
  display: flex; flex-direction: column; gap: 0.35rem;
  text-align: left;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--crema-70);
}
.reg-form input {
  background: rgba(20, 16, 43, 0.6);
  border: 1px solid rgba(243, 237, 226, 0.22);
  border-radius: 3px;
  padding: 0.7rem 0.85rem;
  color: var(--crema);
  font-family: inherit;
  font-size: 1rem;
}
.reg-form input:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 1px;
  border-color: transparent;
}

.btn-gold {
  display: inline-block;
  background: linear-gradient(120deg, var(--oro), var(--oro-chiaro));
  color: var(--notte);
  border: none;
  border-radius: 3px;
  padding: 0.8rem 1.6rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn-gold:hover { filter: brightness(1.07); }
.btn-gold:focus-visible { outline: 2px solid var(--crema); outline-offset: 2px; }

.btn-ghost {
  display: inline-block;
  border: 1px solid rgba(243, 237, 226, 0.25);
  border-radius: 3px;
  padding: 0.8rem 1.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crema-70);
}
.btn-ghost.disabled { opacity: 0.55; cursor: default; }

.form-error {
  color: #f0a3a3;
  font-size: 0.9rem;
}

/* ——— Biglietto ——— */
.ticket-guest {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--crema);
}
.qr-frame {
  background: var(--crema);
  padding: 14px;
  border-radius: 6px;
  line-height: 0;
}
.ticket-code {
  font-family: monospace;
  font-size: 1.05rem;
  letter-spacing: 0.3em;
  color: var(--oro-chiaro);
}
.ticket-hint { color: var(--crema-70); font-size: 0.9rem; line-height: 1.7; }
.ticket-actions { display: flex; flex-direction: column; gap: 0.7rem; width: 100%; margin-top: 0.4rem; align-items: center; }
.ticket-actions .btn-gold { width: 100%; }
.link-quieto {
  color: var(--crema-40);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}
.link-quieto:hover { color: var(--oro-chiaro); }

/* ——— Admin ——— */
.page-admin { background: #171233; }
.admin { max-width: 1000px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.admin-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 2rem; }
.admin-head h1 { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 1.9rem; }
.admin-head nav { margin-left: auto; font-size: 0.9rem; letter-spacing: 0.06em; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; margin-bottom: 2rem; }
.stat {
  background: var(--indaco);
  border: 1px solid rgba(139, 123, 224, 0.25);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.stat-n { font-family: 'Cormorant Garamond', serif; font-size: 2.1rem; color: var(--oro-chiaro); line-height: 1; }
.stat-l { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--crema-70); }

.panel { margin-bottom: 2.2rem; }
.panel h2 {
  font-size: 0.82rem; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 400; color: var(--crema-70);
  margin-bottom: 0.8rem;
}
.inline-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.inline-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--crema-70); }
.inline-form input {
  background: rgba(20, 16, 43, 0.6);
  border: 1px solid rgba(243, 237, 226, 0.22);
  border-radius: 3px; padding: 0.55rem 0.75rem;
  color: var(--crema); font-family: inherit;
}
.inline-form input[name="n"] { width: 5.5rem; }
.inline-form input[name="label"] { width: min(320px, 70vw); }

.table-wrap { overflow-x: auto; border: 1px solid rgba(139, 123, 224, 0.25); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th {
  text-align: left; padding: 0.6rem 0.9rem;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 400; color: var(--crema-70);
  background: var(--indaco);
}
td { padding: 0.6rem 0.9rem; border-top: 1px solid rgba(243, 237, 226, 0.08); }
td.empty { color: var(--crema-40); text-align: center; padding: 1.4rem; }
.mono { font-family: monospace; font-size: 0.85rem; }
.stato-libero { color: var(--crema-40); }
.stato-registrato { color: var(--iris-chiaro); }
.stato-entrato { color: #9fd9a3; }

.btn-mini {
  display: inline-block;
  background: none;
  border: 1px solid rgba(217, 166, 89, 0.5);
  border-radius: 3px;
  color: var(--oro-chiaro);
  padding: 0.3rem 0.7rem;
  font-family: inherit; font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn-mini:hover { background: rgba(217, 166, 89, 0.12); }
.btn-rosso { border-color: rgba(224, 122, 122, 0.5); color: #e8a3a3; }
.btn-rosso:hover { background: rgba(224, 122, 122, 0.12); }

.celle-azioni { white-space: nowrap; }
.celle-azioni form { display: inline-block; }
.celle-azioni .btn-mini { margin-right: 0.35rem; }
.quota-form { display: flex; gap: 0.4rem; align-items: center; }
.quota-form input {
  width: 4.2rem;
  background: rgba(20, 16, 43, 0.6);
  border: 1px solid rgba(243, 237, 226, 0.22);
  border-radius: 3px; padding: 0.3rem 0.45rem;
  color: var(--crema); font-family: inherit;
}
.riga-spenta td { opacity: 0.45; }
.panel-note { font-size: 0.82rem; color: var(--crema-40); margin-top: 0.6rem; line-height: 1.6; }

/* Su smartphone le tabelle diventano schede impilate: niente scorrimento laterale */
@media (max-width: 640px) {
  .table-wrap { border: none; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    border: 1px solid rgba(139, 123, 224, 0.25);
    border-radius: 4px;
    background: rgba(36, 28, 73, 0.35);
    padding: 0.45rem 0.9rem;
    margin-bottom: 0.7rem;
  }
  .table-wrap td {
    border-top: none;
    padding: 0.4rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    text-align: right;
  }
  .table-wrap td::before {
    content: attr(data-label);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--crema-40);
    text-align: left;
    flex-shrink: 0;
  }
  .table-wrap td:empty { display: none; }
  .table-wrap td.celle-azioni { justify-content: flex-start; }
  .table-wrap td.celle-azioni::before { display: none; }
  .table-wrap td.empty { text-align: center; display: block; }
  .table-wrap td.empty::before { display: none; }
  .table-wrap td .quota-form { margin-left: auto; }
}

/* L'area invitatori ha 3 statistiche: sempre su una riga, anche al telefono */
.promoter .stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 480px) {
  .stats { gap: 0.5rem; }
  .stat { padding: 0.7rem 0.8rem; }
  .stat-n { font-size: 1.7rem; }
  .stat-l { font-size: 0.63rem; letter-spacing: 0.1em; }
}

/* ——— Scanner ——— */
.page-scan { background: #0d0a1e; }
.scan { max-width: 520px; margin: 0 auto; padding: 1.2rem 1rem 3rem; display: flex; flex-direction: column; gap: 1.2rem; }
.scan-head {
  display: flex; align-items: center; gap: 0.7rem;
  letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.8rem;
  color: var(--crema-70);
  padding: 0.4rem 0;
}
.scan-gate { display: flex; flex-direction: column; gap: 0.9rem; text-align: center; margin-top: 18vh; }
.scan-gate input {
  background: var(--indaco);
  border: 1px solid rgba(243, 237, 226, 0.25);
  border-radius: 3px;
  padding: 0.8rem; text-align: center;
  color: var(--crema); font-size: 1.3rem; letter-spacing: 0.4em;
}
#reader { border-radius: 6px; overflow: hidden; border: 1px solid rgba(139, 123, 224, 0.35); }

.scan-result {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.8rem; text-align: center; padding: 2rem;
  z-index: 10;
}
.scan-result.ok    { background: #10391c; }
.scan-result.warn  { background: #4a3a10; }
.scan-result.bad   { background: #4a1414; }
#result-title { font-size: 0.95rem; letter-spacing: 0.28em; text-transform: uppercase; opacity: 0.85; }
#result-name { font-family: 'Cormorant Garamond', serif; font-size: 2.6rem; font-weight: 500; line-height: 1.1; }
#result-detail { opacity: 0.8; margin-bottom: 1rem; }
