/* Modulo di iscrizione (index.php): una colonna pensata per l'iframe. Le regole responsive usano le container query, così lo stesso index
   si adatta sia alla pagina sia al widget stretto in colonna laterale (~300px).
   Colori: blu #192f59 (base) e magenta #e00a7f con testo bianco; tema chiaro voluto come il sito ospite. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --grigio: #f3f5f9;
  --grigio-bordo: #e3e7ef;
  --ink: #1b2438;
  --muted: #5d6780;
  --line: #d6dce8;
  --blu: #192f59;
  --blu-scuro: #0f1f3d;
  --blu-medio: #3a5488;
  --blu-chiaro: #e9eef7;
  --magenta: #e00a7f;
  --magenta-scuro: #b5066a;
  --magenta-chiaro: #fde6f2;
  --danger: #b3261e;
  --danger-soft: #fbeceb;
  --font: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font);
  /* incorporato in iframe: solo un leggero respiro dai bordi del riquadro del sito */
  padding-left: 8px;
  padding-right: 8px;
  padding-block: 8px 24px;
}
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.25; font-weight: 700; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.shell { width: 100%; container-type: inline-size; display: grid; gap: 20px; }

/* Intestazione personalizzata dell'evento (da IsPay → custom_header) */
.custom-header { display: block; width: 100%; max-width: 100%; height: auto; border-radius: var(--radius); }

/* Scheda evento */
.evento { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--blu); border-radius: var(--radius); padding: 20px 24px; display: grid; gap: 16px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.event-picker { display: grid; gap: 8px; }
.event-picker input {
  width: 100%; min-height: 50px; padding: 10px 44px 10px 14px; border: 2px solid var(--blu); border-radius: 10px; font-weight: 700; font-size: 17px; color: var(--blu);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23192f59' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center;
  appearance: none; cursor: pointer; text-overflow: ellipsis; transition: box-shadow .15s;
}
.event-picker input:hover, .event-picker input:focus { box-shadow: 0 0 0 3px var(--blu-chiaro); outline: none; }
.event-picker input:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%23192f59' stroke-width='2.4'/%3E%3Cpath d='M20 20l-4-4' stroke='%23192f59' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); cursor: text; }
.event-picker input::placeholder { color: var(--muted); font-weight: 600; }
.event-picker input:disabled { opacity: .6; cursor: progress; }
.event-picker .combo li { font-weight: 600; color: var(--blu); }
.event-picker .combo ul { max-height: 320px; }
.event-picker .combo li.vuoto { color: var(--muted); font-weight: 400; cursor: default; }
.event-picker .combo li.vuoto:hover { background: none; }
.event-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 28px; align-items: center; }
.event-title { font-size: 22px; color: var(--blu); }
.facts { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.facts li { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; min-width: 0; }
.facts .ico { color: var(--blu-medio); }
.paid { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--magenta); color: #fff; white-space: nowrap; }
.ecm-box { text-align: center; padding: 6px 4px 6px 24px; border-left: 1px solid var(--grigio-bordo); }
.ecm { font-size: 38px; font-weight: 700; line-height: 1; color: var(--blu); display: block; }
.ecm-box small { color: var(--muted); font-size: 13px; }
@container (max-width: 640px) {
  .event-body { grid-template-columns: minmax(0, 1fr); }
  .ecm-box { border-left: 0; border-top: 1px solid var(--grigio-bordo); text-align: left; padding: 10px 0 0; display: flex; align-items: baseline; gap: 8px; }
  .ecm { display: inline; font-size: 30px; }
}
@container (max-width: 420px) {
  .evento { padding: 16px; }
  .event-title { font-size: 18px; }
  .facts { flex-direction: column; gap: 6px; }
  .facts li { align-items: flex-start; font-size: 14px; }
  .event-picker input { font-size: 15px; }
}

/* Scelta del percorso */
.path { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.path button { border: 0; background: transparent; padding: 16px 20px; text-align: left; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; min-height: 80px; align-content: start; }
.path button .ico { width: 24px; height: 24px; grid-row: span 2; margin-top: 2px; color: var(--blu-medio); }
.path button + button { border-left: 1px solid var(--line); }
.path button[aria-pressed="true"] { background: var(--blu-chiaro); box-shadow: inset 0 -4px 0 var(--blu); }
.path button[aria-pressed="true"] .ico { color: var(--blu); }
.path b { font-size: 17px; color: var(--blu); }
.path span { font-size: 14px; color: var(--muted); }
@container (max-width: 560px) { .path { grid-template-columns: 1fr; } .path button + button { border-left: 0; border-top: 1px solid var(--line); } .path button { padding: 14px 16px; min-height: 0; } .path b { font-size: 16px; } }

/* Passaggi orizzontali */
.steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; flex: 1 1 0; min-width: 0; }
.steps li:last-child { flex: 0 0 auto; }
.steps li::after { content: ""; flex: 1; height: 2px; background: var(--line); margin: 0 12px; min-width: 12px; }
.steps li:last-child::after { display: none; }
.steps li.done::after { background: var(--blu); }
.steps .dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; background: var(--surface); }
.steps .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li.current { color: var(--blu); font-weight: 700; }
.steps li.current .dot { border-color: var(--magenta); color: var(--magenta); }
.steps li.done .dot { background: var(--blu); border-color: var(--blu); color: #fff; }
@container (max-width: 640px) {
  .steps li:not(.current) .txt { display: none; }
  .steps li.current { flex: 1 0 auto; }
  .steps li::after { margin: 0 8px; }
}

/* Modulo */
.card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--blu); border-radius: var(--radius); padding: 24px; display: grid; gap: 20px; }
.card h2 { font-size: 22px; color: var(--blu); }
.card .lead { margin: 4px 0 0; color: var(--muted); }
.fatt-head { background: var(--magenta); color: #fff; margin: -24px -24px 0; padding: 14px 24px; border-radius: 8px 8px 0 0; }
.fatt-head h2 { color: #fff; }
#errorBox:not([hidden]) ~ section .fatt-head { margin-top: 0; border-radius: 8px; }
.fatt-head p { margin: 2px 0 0; color: #fff; opacity: .92; font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
@container (max-width: 600px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } .card { padding: 20px 16px; } .fatt-head { margin: -20px -16px 0; padding: 14px 16px; } }
.span-2 { grid-column: 1 / -1; }

.field { display: grid; gap: 6px; position: relative; min-width: 0; }
.field label, .field .label { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="date"], .field select {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.field select { appearance: none; padding-right: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235d6780' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field input:hover, .field select:hover { border-color: var(--blu-medio); }
.field input:focus, .field select:focus { outline: none; border-color: var(--blu); box-shadow: 0 0 0 3px var(--blu-chiaro); }
.field.invalid input { border-color: var(--danger); background: var(--danger-soft); }
.field .error { display: none; color: var(--danger); font-size: 14px; font-weight: 600; }
.field.invalid .error { display: block; }
.cf { letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }

.autofill { font-size: 14px; color: var(--blu-medio); font-weight: 600; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: max-content; max-width: 100%; }
.seg label { padding: 10px 18px; cursor: pointer; min-height: 46px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.seg label + label { border-left: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--blu); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--magenta); outline-offset: -3px; }

.combo { position: relative; }
.combo ul { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--blu-medio); border-radius: 8px; box-shadow: 0 8px 24px rgba(25,47,89,.16); max-height: 240px; overflow: auto; }
.combo li { padding: 10px 12px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.combo li small { color: var(--muted); }
.combo li[aria-selected="true"], .combo li:hover { background: var(--blu-chiaro); }
.derived { font-size: 14px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--blu-chiaro); color: var(--blu); border: 1px solid var(--blu-medio); font-size: 14px; max-width: 100%; }
.chip button { border: 0; background: transparent; color: var(--blu); cursor: pointer; width: 26px; height: 26px; border-radius: 50%; font-size: 16px; line-height: 1; flex: none; }
.chip button:hover { background: var(--surface); }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--blu); flex: none; }
.check a { color: var(--magenta-scuro); }
.privacy { padding: 14px 16px; background: var(--blu-chiaro); border-radius: 8px; }

.summary { display: grid; border: 1px solid var(--grigio-bordo); border-radius: 8px; overflow: hidden; margin: 0; }
.summary div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 10px 14px; font-size: 15px; }
.summary div:nth-child(odd) { background: var(--grigio); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; overflow-wrap: anywhere; }
@container (max-width: 520px) { .summary div { grid-template-columns: minmax(0, 1fr); gap: 0; } }

.error-box { border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 12px 16px; font-weight: 600; }
.error-box ul { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }

.actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.btn { min-height: 50px; padding: 12px 26px; border-radius: 8px; border: 1px solid var(--blu); background: var(--surface); color: var(--blu); cursor: pointer; font-weight: 700; }
.btn:hover { background: var(--blu-chiaro); }
.btn.primary { background: var(--blu); color: #fff; letter-spacing: .03em; }
.btn.primary:hover { background: var(--blu-scuro); }
.btn[disabled] { opacity: .7; cursor: progress; }
@container (max-width: 420px) { .actions { flex-direction: column-reverse; } .actions .btn { width: 100%; } }

.result { display: grid; gap: 12px; }
.result .big { font-size: 24px; font-weight: 700; margin: 0; color: var(--blu); display: flex; align-items: center; gap: 10px; }
.result .big .ico { width: 28px; height: 28px; }
.result.ko .big { color: var(--danger); }
.result.ko .msg { background: var(--danger-soft); border-left: 4px solid var(--danger); border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 0; }
.result .row { display: flex; gap: 12px; flex-wrap: wrap; }
@container (max-width: 420px) { .result .row .btn { width: 100%; } }
.result ol { padding-left: 20px; display: grid; gap: 6px; margin: 0; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; vertical-align: -4px; margin-right: 8px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scena di invio: banco accoglienza con operatore e partecipante.
   Riuscita: l'operatore annuisce e sorride, poi stretta di mano. Errore: scuote la testa e si rattrista. */
.scene-wrap { display: grid; gap: 4px; justify-items: center; }
.scene { width: 100%; max-width: 480px; height: auto; display: block; }
.scene * { transform-box: view-box; }
.s-floor { stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.s-shadow { fill: var(--grigio-bordo); }
.s-desk-top { fill: var(--blu-scuro); }
.s-desk { fill: var(--blu); }
.s-desk-txt { fill: #fff; font: 800 13px var(--font); letter-spacing: .12em; }
.s-desk-line { stroke: var(--magenta); stroke-width: 3; stroke-linecap: round; }
.s-skin { fill: #f6dccb; }
.s-cheek { fill: #f59ac2; opacity: .55; }
.s-eye { fill: var(--blu-scuro); transform-box: fill-box; transform-origin: center; animation: eyeBlink 3.6s infinite; }
.s-guest .s-eye { animation-delay: 1.3s; }
@keyframes eyeBlink { 0%, 93%, 100% { transform: none; } 96% { transform: scaleY(.1); } }
.s-mouth { fill: none; stroke: var(--blu-scuro); stroke-width: 2; stroke-linecap: round; transition: opacity .25s; }
.s-smile, .s-sad { opacity: 0; }
.success .s-neutral, .fail .s-neutral { opacity: 0; }
.success .s-smile, .fail .s-sad { opacity: 1; }
.s-op-body { fill: var(--blu-medio); }
.s-op-hair { fill: var(--blu-scuro); }
.s-headset { fill: none; stroke: var(--blu-scuro); stroke-width: 2.5; stroke-linecap: round; }
.s-mic { fill: var(--magenta); }
.s-collar { fill: #fff; }
.s-tie { fill: var(--magenta); }
.s-guest-body { fill: var(--magenta); }
.s-guest-hair { fill: var(--magenta-scuro); }
.s-lanyard { fill: none; stroke: #fff; stroke-width: 2; }
.s-card { fill: #fff; }
.s-card-line { stroke: var(--blu-medio); stroke-width: 1.4; stroke-linecap: round; }
.s-op-arm line { stroke: var(--blu-medio); stroke-width: 9; stroke-linecap: round; }
.s-guest-arm line { stroke: var(--magenta); stroke-width: 9; stroke-linecap: round; }
.s-leg line { stroke: var(--blu-scuro); stroke-width: 7; stroke-linecap: round; }
.s-doc rect { fill: #fff; stroke: var(--blu); stroke-width: 1.5; }
.s-doc path { stroke: var(--blu-medio); stroke-width: 1.4; stroke-linecap: round; }
.s-badge circle { fill: var(--blu); }
.s-badge path { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.s-spark path { stroke: var(--magenta); stroke-width: 3; stroke-linecap: round; }

/* Pose di riposo: braccia lungo il corpo, conferma nascosta */
.s-guest-arm { transform-origin: 164px 106px; transform: rotate(78deg); transition: transform .5s cubic-bezier(.3, 1.3, .6, 1); }
.s-op-arm { transform-origin: 238px 92px; transform: rotate(-68deg); transition: transform .5s cubic-bezier(.3, 1.3, .6, 1); }
.s-op-head { transform-origin: 255px 78px; }
.s-guest-head { transform-origin: 150px 96px; transition: transform .4s ease; }
.s-doc { opacity: 0; }
.s-badge { opacity: 0; transform-origin: 197px 44px; transform: scale(.4); }
.s-spark { opacity: 0; }

/* Invio in corso: arriva al banco e consegna il foglio */
.sending .s-guest { animation: walkIn 1.1s ease-out both; }
.sending .s-leg-a { transform-origin: 144px 150px; animation: legA .28s 4 alternate ease-in-out; }
.sending .s-leg-b { transform-origin: 156px 150px; animation: legB .28s 4 alternate ease-in-out; }
.sending .s-doc { animation: docGive 1.4s 1.1s ease-in-out forwards; }
@keyframes walkIn { from { transform: translateX(-150px); } to { transform: none; } }
@keyframes legA { from { transform: rotate(16deg); } to { transform: rotate(-16deg); } }
@keyframes legB { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes docGive { 0% { opacity: 0; transform: none; } 15% { opacity: 1; } 65% { opacity: 1; transform: translate(50px, 4px); } 100% { opacity: 0; transform: translate(50px, 4px); } }

/* Riuscita: annuisce e sorride, poi stretta di mano e bollino */
.success .s-op-head { animation: nodYes .38s 2 ease-in-out; }
@keyframes nodYes { 50% { transform: translateY(4px) rotate(5deg); } }
.success .s-guest-arm, .success .s-op-arm { transform: rotate(0deg); transition-delay: .8s; }
.success .s-guest-arm { animation: shakeG .26s 1.35s 3 ease-in-out; }
.success .s-op-arm { animation: shakeO .26s 1.35s 3 ease-in-out; }
.success .s-badge { animation: pop .45s 1.6s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.success .s-spark { animation: spark .7s 1.75s forwards; }
@keyframes shakeG { 50% { transform: rotate(-7deg); } }
@keyframes shakeO { 50% { transform: rotate(7deg); } }
@keyframes pop { to { opacity: 1; transform: none; } }
@keyframes spark { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }

/* Porta: dopo la stretta di mano l'operatore indica la porta, si apre e il partecipante entra */
.s-door-frame { fill: var(--blu-scuro); }
.s-door-inside { fill: #0a1630; }
.s-door-leaf { fill: var(--blu-chiaro); stroke: var(--blu); stroke-width: 1.5; }
.s-door-glass { fill: #fff; stroke: var(--blu-medio); stroke-width: 1.2; }
.s-door-knob { fill: var(--magenta); }
.s-door-lower { fill: none; }
.s-door-panel { transform-origin: 355px 110px; }
.s-op-point line { stroke: var(--blu-medio); stroke-width: 9; stroke-linecap: round; }
.s-op-point { transform-origin: 272px 92px; transform: rotate(120deg); }
/* Si apre mentre arriva (0,6–1,3 s), resta aperta finché è sparito (2,8 s), poi si richiude (3,1–3,7 s) */
.pass .s-door-panel { animation: doorOpenClose 4s ease-in-out forwards; }
@keyframes doorOpenClose { 0%, 15% { transform: none; } 32%, 78% { transform: scaleX(.16); } 92%, 100% { transform: none; } }
.pass .s-op-point { animation: pointDoor 3s ease-in-out forwards; }
@keyframes pointDoor { 0% { transform: rotate(120deg); } 15%, 72% { transform: rotate(0deg); } 80% { transform: rotate(-10deg); } 86% { transform: rotate(0deg); } 100% { transform: rotate(120deg); } }
.pass .s-guest-arm { transform: rotate(78deg); transition-delay: 0s; animation: none; }
.pass .s-op-arm { transform: rotate(-68deg); transition-delay: 0s; animation: none; }
.pass .s-guest { animation: walkOut 2.1s .7s ease-in-out forwards; }
.pass .s-leg-a { transform-origin: 144px 150px; animation: legA .28s .7s 7 alternate ease-in-out; }
.pass .s-leg-b { transform-origin: 156px 150px; animation: legB .28s .7s 7 alternate ease-in-out; }
@keyframes walkOut { 0% { transform: none; opacity: 1; } 78% { opacity: 1; transform: translateX(214px); } 100% { transform: translateX(231px) scale(.96); opacity: 0; } }

/* Computer sul banco: righe di compilazione dopo la consegna del foglietto */
.s-pc-frame { fill: var(--blu-scuro); }
.s-pc-screen { fill: #fff; }
.s-pc-stand { fill: var(--blu-scuro); }
.s-screen-lines line { stroke: var(--blu-medio); stroke-width: 2.4; stroke-linecap: round; transform-box: fill-box; transform-origin: left center; transform: scaleX(0); }
.typed .s-screen-lines line { animation: typeLine .3s ease-out forwards; }
.typed .s-screen-lines line:nth-child(2) { animation-delay: .3s; }
.typed .s-screen-lines line:nth-child(3) { animation-delay: .6s; }
.typed .s-screen-lines line:nth-child(4) { animation-delay: .9s; }
@keyframes typeLine { to { transform: none; } }
.s-mail { opacity: 0; }
.s-mail-body { fill: var(--blu-chiaro); stroke: var(--blu); stroke-width: 1.5; }
.s-mail-flap { fill: none; stroke: var(--blu); stroke-width: 1.5; stroke-linejoin: round; }
.s-mail-dot { fill: var(--magenta); transform-box: fill-box; transform-origin: center; }

/* Già iscritto: l'operatore sorride e indica la mail sullo schermo, all'infinito */
.s-op-point { transition: transform .5s ease-out; }
.already .s-screen-lines { opacity: 0; }
.already .s-mail { opacity: 1; animation: mailBlink 1.2s ease-in-out infinite; }
.already .s-mail-dot { animation: dotPulse 1.2s ease-in-out infinite; }
.already .s-op-point { transform: rotate(36deg); animation: tapScreen 1.2s .5s ease-in-out infinite; }
.already .s-op-head .s-neutral { opacity: 0; }
.already .s-op-head .s-smile { opacity: 1; }
.already .dots { display: none; }
@keyframes mailBlink { 50% { opacity: .35; } }
@keyframes dotPulse { 50% { transform: scale(1.45); } }
@keyframes tapScreen { 50% { transform: rotate(27deg); } }

/* Errore: "no no" con la testa, entrambi tristi */
.fail .s-op-head { animation: shakeNo .9s .1s 2 ease-in-out; }
@keyframes shakeNo { 25% { transform: rotate(-11deg); } 75% { transform: rotate(11deg); } }
.fail .s-guest-head { transform: translateY(2px) rotate(-7deg); }

.scene-caption { margin: 0; font-weight: 700; color: var(--blu); font-size: 17px; text-align: center; }
.fail .scene-caption { color: var(--danger); }
.dots i { font-style: normal; animation: blink 1.2s infinite; opacity: .2; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 40% { opacity: 1; } }
.success .dots, .fail .dots { display: none; }
@container (max-width: 420px) { .scene-caption { font-size: 15px; } }

/* Errore: faccina triste */
.sad { display: grid; place-items: center; }
.sad svg { width: 96px; height: 96px; animation: sadIn .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.sad-face { fill: var(--danger-soft); stroke: var(--danger); stroke-width: 3; }
.sad-eye { fill: var(--danger); }
.sad-mouth { fill: none; stroke: var(--danger); stroke-width: 3.5; stroke-linecap: round; }
.sad-tear { fill: #8fb8e6; opacity: 0; animation: tear 1.8s .7s ease-in infinite; }
@keyframes sadIn { from { opacity: 0; transform: translateY(-14px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes tear { 0% { opacity: 0; transform: none; } 20% { opacity: 1; } 80% { opacity: 1; transform: translateY(14px); } 100% { opacity: 0; transform: translateY(18px); } }
.result.ko { justify-items: center; text-align: center; }
.result.ko .msg { border-left: 0; border-radius: 8px; }
.result.ko .row { justify-content: center; }
.result.info { justify-items: center; text-align: center; }
.result.info .big { color: var(--blu); }
.result.info .msg { background: var(--blu-chiaro); border-radius: 8px; padding: 12px 16px; margin: 0; }
.result.info .row { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .success .s-badge { opacity: 1; transform: none; }
  .typed .s-screen-lines line { transform: none; }
  .sad-tear { opacity: 1; }
}

/* Transizioni morbide: cambio passaggio, esito e cambio evento */
.fade-in { animation: fadeIn .25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.footer { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; justify-content: center; }


@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
