/* Carta delle Feste — pagina del cliente. Colori e caratteri DA FELICE: navy del logo, ottone,
   crema; Playfair Display per i titoli, Jost per i testi (file nel server, niente Google). */

@font-face { font-family: 'Playfair Display'; font-weight: 600; font-display: swap; src: url(/carta/fonts/playfair-display-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-weight: 700; font-display: swap; src: url(/carta/fonts/playfair-display-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url(/carta/fonts/jost-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url(/carta/fonts/jost-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 600; font-display: swap; src: url(/carta/fonts/jost-latin-600-normal.woff2) format('woff2'); }

:root {
  --navy: #0e1e3a; /* blu ufficiale del logo DA FELICE */
  --navy-2: #1d3157;
  --ottone: #b8924a;
  --ottone-scuro: #876a2f;
  --crema: #f5eede;
  --crema-chiara: #fbf7ef;
  --grigio: #5b6c8a;
  --linea: #e3dccb;
  --verde: #1f7a4d;
  --ambra: #9a6200;
  --rosso: #b42318;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--crema-chiara);
  color: var(--navy);
  font-family: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}

.testata { text-align: center; padding: 18px 16px 4px; }
.logo { width: 132px; height: auto; }
.testata-negozio { margin: 2px 0 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ottone-scuro); font-weight: 600; }

main { max-width: 460px; margin: 0 auto; padding: 8px 16px 32px; }
.schermata { animation: entra .25s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; margin: 8px 0 10px; line-height: 1.15; }
h1 { font-size: 36px; text-align: center; }
h2 { font-size: 26px; }
h3 { font-size: 20px; margin-top: 28px; }
.sottotitolo { text-align: center; font-size: 19px; margin: 0 0 18px; }
.centro { text-align: center; }
.grigio { color: var(--grigio); }
.piccolo { font-size: 15px; }
[hidden] { display: none !important; }

.passi { list-style: none; padding: 0; margin: 0 0 22px; }
.passi li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.passi li:last-child { border-bottom: 0; }
.passi span {
  flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--crema); font-weight: 600;
}

.bottone {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 56px; padding: 12px 18px; margin: 12px 0 4px;
  border: 0; border-radius: 14px; background: var(--navy); color: #fff;
  font: 600 19px/1.2 'Jost', system-ui, sans-serif; cursor: pointer; text-align: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.bottone:active { transform: translateY(1px); }
.bottone[disabled], .bottone.spento { background: #a9b2c3; box-shadow: none; pointer-events: none; }
.bottone-grande { min-height: 68px; font-size: 21px; background: var(--ottone-scuro); }
.link {
  display: block; width: 100%; margin: 6px 0; padding: 12px; background: none; border: 0;
  color: var(--navy-2); font: 500 17px 'Jost', system-ui, sans-serif; text-decoration: underline; text-align: center; cursor: pointer;
}
.link-in-linea { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.nascosto { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

form label { display: block; margin: 14px 0; font-weight: 500; }
form input[type=text], form input[type=tel], form input:not([type]) {
  display: block; width: 100%; margin-top: 6px; padding: 14px 14px;
  border: 1.5px solid #cfc6b0; border-radius: 12px; background: #fff;
  font: 400 19px 'Jost', system-ui, sans-serif; color: var(--navy);
}
form input:focus { outline: 3px solid rgba(184, 146, 74, .35); border-color: var(--ottone); }
form small { display: block; margin-top: 4px; color: var(--grigio); font-size: 14px; font-weight: 400; }
input.pin { letter-spacing: .5em; font-size: 24px; text-align: center; max-width: 220px; }
input.importo { font-size: 30px; text-align: center; font-weight: 600; }
.spunta { display: flex; gap: 12px; align-items: flex-start; font-weight: 400 !important; font-size: 16px; }
.spunta input { flex: 0 0 auto; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--navy); }
.errore { background: #fdecea; color: var(--rosso); padding: 10px 12px; border-radius: 10px; font-size: 16px; }
.avviso { background: #fff7e6; color: var(--ambra); padding: 12px 14px; border-radius: 12px; font-size: 16px; }

/* La carta */
.carta {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--crema); border-radius: 20px; padding: 18px 18px 16px; margin-top: 6px;
  border: 2px solid var(--ottone); box-shadow: 0 10px 24px rgba(22, 28, 43, .25);
}
.carta-titolo { margin: 0; font: 700 24px 'Playfair Display', Georgia, serif; color: #fff; }
.carta-nome { margin: 2px 0 0; font-size: 18px; }
.carta-numero { margin: 0 0 12px; font-size: 13px; letter-spacing: .14em; color: var(--ottone); text-transform: uppercase; }
.timbri { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0 10px; }
.timbro {
  flex: 1 1 0; aspect-ratio: 1; max-width: 58px; border-radius: 50%;
  border: 2px dashed rgba(245, 238, 222, .45); display: grid; place-items: center;
  font: 700 20px 'Playfair Display', Georgia, serif; color: rgba(245, 238, 222, .5);
}
.timbro.pieno { border: 2px solid var(--ottone); background: var(--ottone); color: var(--navy); }
.timbro.nuovo { animation: timbra .6s ease-out; }
@keyframes timbra { 0% { transform: scale(1.6) rotate(-12deg); opacity: 0; } 60% { transform: scale(.92); opacity: 1; } 100% { transform: none; } }
.carta-conteggio { margin: 0; font-size: 16px; }

.premio { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 2px solid var(--ottone); }
.premio-titolo { margin: 0; font: 700 21px 'Playfair Display', Georgia, serif; }
.premio-testo { margin: 4px 0 0; font-size: 16px; color: var(--grigio); }

.scontrini { list-style: none; padding: 0; margin: 0; }
.scontrini li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--linea); font-size: 16px; }
.scontrini .quando { flex: 1; color: var(--grigio); }
.scontrini .quanto { font-weight: 600; }
.chip { font-size: 13px; padding: 3px 9px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.chip.valido { background: #e6f4ec; color: var(--verde); }
.chip.in_verifica { background: #fff3db; color: var(--ambra); }
.chip.rifiutato { background: #fdecea; color: var(--rosso); }
.scontrini .motivo { display: block; font-size: 13px; color: var(--grigio); }

.regole { margin-top: 24px; background: #fff; border-radius: 12px; padding: 4px 14px; border: 1px solid var(--linea); }
.regole summary { padding: 10px 0; font-weight: 600; cursor: pointer; }
.regole ul, .testo-lungo ul { padding-left: 20px; margin: 4px 0 12px; font-size: 16px; }
.regole li, .testo-lungo li { margin: 6px 0; }
.piede { text-align: center; color: var(--grigio); font-size: 14px; margin-top: 22px; }

.anteprima { display: block; width: 100%; max-height: 38vh; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--linea); }

.fatto { text-align: center; padding: 26px 0 6px; }
.fatto-cerchio {
  width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center;
  background: var(--verde); color: #fff; font-size: 52px; animation: timbra .7s ease-out;
}
.fatto.attesa .fatto-cerchio { background: var(--ambra); }

dialog.foglio {
  width: min(560px, 100vw); max-width: 100vw; max-height: 88vh; margin: auto auto 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border: 0; border-radius: 18px 18px 0 0; color: var(--navy); background: var(--crema-chiara);
}
dialog.foglio h2:focus { outline: none; }
dialog.foglio::backdrop { background: rgba(22, 28, 43, .55); }
.testo-lungo { font-size: 16px; overflow-y: auto; }
.testo-lungo p { margin: 0 0 10px; }
