/* M 3.5 — schermata dell'app (/app): chiara di giorno, scura se il telefono è in tema scuro */
:root { --bg: #eef3f2; --carta: #fff; --testo: #0c1b1c; --tenue: #566a6b; --filo: #dde6e4; --acc: #007a50; --verde: #00d185; --barra: #0c1b1c; --ombra: 0 6px 18px rgba(8, 30, 28, 0.08); color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --bg: #081014; --carta: #111d22; --testo: #eef4f3; --tenue: #a9b9bd; --filo: #20323a; --acc: #00e08f; --barra: #1a2a31; --ombra: none; color-scheme: dark; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--bg); }
.ap { margin: 0; background: var(--bg); color: var(--testo); font: 500 16px/1.35 "Outfit", system-ui, sans-serif; overscroll-behavior-y: none; }
.ap button, .ap a { font: inherit; color: inherit; text-decoration: none; cursor: pointer; }
.ap button { border: 0; background: none; padding: 0; }
.ap :focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.ap-scr { max-width: 520px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(124px + env(safe-area-inset-bottom, 0px)); }
.ap-alto { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 14px; }
.ap-alto > img { border-radius: 14px; }
.ap-alto div { flex: 1; min-width: 0; }
.ap-alto small { display: block; color: var(--tenue); font-size: 14px; }
.ap-alto strong { display: block; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.ap .ap-tondo { position: relative; flex: none; width: 50px; height: 50px; border-radius: 50%; background: var(--carta); box-shadow: var(--ombra); display: grid; place-items: center; }
.ap-tondo svg { width: 32px; height: 32px; }
.ap-punto { position: absolute; top: 5px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: #ff4d6d; border: 2px solid var(--carta); }
.ap-titolo { display: flex; align-items: center; gap: 12px; min-height: 56px; margin-bottom: 12px; }
.ap-titolo h1 { flex: 1; min-width: 0; margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; }
.ap-giostra { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.ap-giostra::-webkit-scrollbar { display: none; }
.ap-promo { position: relative; flex: 0 0 100%; scroll-snap-align: center; min-height: 190px; border-radius: 28px; overflow: hidden; color: #fff; padding: 16px 18px; display: flex; flex-direction: column; align-items: flex-start; }
.ap-promo b { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; background: rgba(255, 255, 255, 0.18); padding: 4px 10px; border-radius: 99px; }
.ap-promo strong { position: relative; z-index: 1; font-size: 25px; line-height: 1.08; font-weight: 800; margin: 10px 0 12px; max-width: 60%; }
.ap .ap-promo a { position: relative; z-index: 1; margin-top: auto; min-height: 48px; padding: 12px 22px; line-height: 24px; border-radius: 99px; background: #fff; color: #0c1b1c; font-weight: 700; }
.ap-promo .ap-fig { position: absolute; right: -8px; bottom: -6px; width: 150px; height: 150px; }
.ap-promo img.ap-fig { width: 112px; height: 112px; right: 16px; bottom: 24px; border-radius: 28px; transform: rotate(8deg); }
.p1 { background: linear-gradient(135deg, #063b32, #00805e); } .p2 { background: linear-gradient(135deg, #2c1a6b, #7c5ce0); } .p3 { background: linear-gradient(135deg, #5c0d22, #c22c4e); } .p4 { background: linear-gradient(135deg, #7a260f, #c9601a); }
.ap-punti { display: flex; justify-content: center; gap: 6px; margin: 10px 0 14px; }
.ap-punti i { width: 8px; height: 8px; border-radius: 9px; background: var(--tenue); opacity: 0.4; transition: width 0.2s; }
.ap-punti i.on { width: 26px; background: var(--acc); opacity: 1; }
.ap-due { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ap .ap-carta { position: relative; min-width: 0; min-height: 126px; padding: 14px; border-radius: 24px; background: var(--carta); box-shadow: var(--ombra); display: flex; flex-direction: column; transition: transform 0.12s; }
.ap-carta small { color: var(--tenue); font-size: 14px; padding-right: 54px; }
.ap-carta strong { font-size: 24px; font-weight: 800; margin-top: 6px; }
.ap-carta em { font-style: normal; color: var(--acc); font-weight: 700; font-size: 15px; margin-top: auto; }
.ap-carta img { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 12px; }
.ap-tre { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ap .ap-tre .ap-carta { min-height: 104px; padding: 12px 10px; justify-content: space-between; }
.ap-tre .ap-carta small { padding: 0; }
.ap h2 { font-size: 19px; font-weight: 700; margin: 20px 0 14px; }
.ap-griglia { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
.ap-griglia.g2 { grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.ap .ap-cas { position: relative; min-width: 0; width: 100%; min-height: 112px; padding: 14px 4px 10px; border-radius: 24px; background: var(--carta); border: 1px solid var(--filo); display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; transition: transform 0.12s; }
.ap-cas:active, .ap-carta:active, .ap-pieno:active { transform: scale(0.96); }
.ap-cas svg, .ap-cas img { width: 56px; height: 56px; border-radius: 16px; }
.ap-cas span { font-size: 14px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.ap .g2 .ap-cas { min-height: 138px; }
.g2 .ap-cas svg, .g2 .ap-cas img { width: 76px; height: 76px; border-radius: 20px; }
.g2 .ap-cas span { font-size: 16px; }
.ap-cas u { position: absolute; top: -9px; right: -2px; text-decoration: none; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; background: var(--verde); color: #04140e; padding: 3px 9px; border-radius: 99px; }
.ap .ap-pieno { display: block; width: 100%; min-height: 52px; padding: 14px 18px; line-height: 24px; border-radius: 99px; background: var(--verde); color: #04140e; font-weight: 700; text-align: center; margin-top: 14px; }
.ap .ap-pieno.ap-linea { background: none; color: var(--testo); box-shadow: inset 0 0 0 2px var(--filo); }
.ap-installa { margin-top: 14px; padding: 16px; border-radius: 24px; background: var(--carta); box-shadow: inset 0 0 0 2px var(--verde); }
.ap-installa strong, .ap-installa span { display: block; }
.ap .ap-riga { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--carta); border-radius: 20px; padding: 8px 14px; margin-top: 8px; }
.ap-riga svg, .ap-riga img { width: 42px; height: 42px; flex: none; border-radius: 12px; }
.ap-riga span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ap-riga small { display: block; color: var(--tenue); font-size: 14px; }
.ap .ap-riga[aria-current] { box-shadow: inset 0 0 0 2px var(--verde); }
.ap-barra { position: fixed; z-index: 5; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); height: 76px; max-width: 520px; margin: 0 auto; border-radius: 38px; background: var(--barra); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 8px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28); }
.ap::after { content: ""; position: fixed; z-index: 4; inset: auto 0 0; height: 110px; pointer-events: none; background: linear-gradient(transparent, var(--bg) 55%); }
.ap .ap-barra a { display: grid; place-content: center; justify-items: center; gap: 3px; font-size: 13px; color: #c9d6d5; }
.ap .ap-barra [aria-current] { color: var(--verde); font-weight: 700; }
.ap-foglio { width: 100%; max-width: 520px; max-height: 90dvh; margin: auto auto 0; border: 0; border-radius: 28px 28px 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--bg); color: inherit; overflow-y: auto; }
.ap-foglio::backdrop { background: rgba(2, 10, 10, 0.6); }
.ap-foglio[open] { animation: ap-su 0.22s ease-out; }
@keyframes ap-su { from { transform: translateY(40px); opacity: 0; } }
.ap-anteprima { display: block; width: 100%; height: auto; border-radius: 20px; margin-bottom: 16px; }
.ap-benvenuto { text-align: center; padding-top: 24px; }
.ap-benvenuto .ap-pira { width: 130px; }
.ap-benvenuto h1 { margin: 8px 0 4px; font-size: 26px; line-height: 1.15; }
.ap-benvenuto p { margin: 0; color: var(--tenue); }
.ap-modulo summary { list-style: none; }
.ap-modulo summary::-webkit-details-marker { display: none; }
.ap-modulo form { display: grid; gap: 12px; padding: 16px 0 4px; }
.ap-modulo label { display: grid; gap: 4px; font-weight: 700; }
.ap-modulo input, .ap-modulo textarea { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid var(--filo); border-radius: 16px; background: var(--carta); color: var(--testo); font: inherit; font-weight: 500; }
.ap-modulo small a { text-decoration: underline; }
.ap-modulo .ap-trappola { position: absolute; left: -9999px; width: 1px; min-height: 0; height: 1px; padding: 0; }
.ap-ok, .ap-errore { margin: 0 0 8px; padding: 14px 16px; border-radius: 18px; background: var(--verde); color: #04140e; font-weight: 700; }
.ap-errore { background: #ffd9df; color: #7a0f26; }
/* Riquadro notifiche condiviso col sito (components/notifiche) */
.ap .m35-notifiche { margin-top: 16px; display: grid; gap: 12px; }
.m35-notifiche-testa { display: flex; gap: 12px; align-items: center; }
.m35-notifiche-testa strong, .m35-notifiche-testa small { display: block; }
.m35-notifiche-testa small, .m35-notifiche-stato { color: var(--tenue); }
.m35-notifiche-scelte { display: grid; gap: 8px; }
.m35-notifiche-scelte label { position: relative; }
.m35-notifiche-scelte input { position: absolute; opacity: 0; }
.m35-notifiche-scelte span { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; border-radius: 16px; background: var(--carta); box-shadow: inset 0 0 0 1px var(--filo); }
.m35-notifiche-scelte input:checked + span::after { content: "✓"; color: var(--acc); font-weight: 800; }
.m35-notifiche-scelte input:focus-visible + span { outline: 3px solid var(--acc); }
.m35-notifiche-azioni { display: grid; gap: 8px; text-align: center; }
.ap .m35-notifiche-azioni .h-btn { min-height: 52px; border-radius: 99px; font-weight: 700; background: var(--verde); color: #04140e; }
.ap .m35-notifiche-azioni .h-btn-linea { background: none; color: inherit; box-shadow: inset 0 0 0 2px var(--filo); }
.m35-notifiche-ios { margin: 0; }
/* Pira */
.pira { overflow: visible; }
.pira-a { fill: #00e89a; } .pira-b { fill: #00a56d; } .pira-ombra { fill: rgba(0, 0, 0, 0.25); } .pira-guancia { fill: #ff8fb3; opacity: 0.55; } .pira-pupilla { fill: #06251c; }
.o-felici, .o-chiusi, .b-sorriso, .b-triste, .b-o, .pira-braccia, .pira-z { display: none; }
.b-aperta { fill: #06251c; }
@media (max-width: 339px) { .ap-promo strong { font-size: 22px; } .ap-cas span { font-size: 13px; } .ap-carta strong { font-size: 20px; } .ap-carta em { font-size: 14px; } .ap .ap-barra a { font-size: 12px; } .ap-titolo h1 { font-size: 26px; } .ap-tre .ap-carta small { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .ap * { transition: none !important; animation: none !important; } }
.ap-paese { display: contents; }

/* Versione desktop */
.ap .ds { max-width: 520px; margin: 22px auto 0; padding: 16px; border-radius: 24px; border: 2px dashed var(--filo); text-align: center; }
.ap .ds strong { display: block; margin-bottom: 10px; font-size: 16px; font-weight: 700; } .ap .ds > div { display: flex; gap: 8px; }
.ap .ds button { flex: 1; min-width: 0; min-height: 48px; padding: 8px 10px; border: 0; border-radius: 99px; background: var(--carta); color: var(--testo); font: 700 15px "Outfit", system-ui, sans-serif; cursor: pointer; overflow-wrap: anywhere; }

/* Elenco dei ticket */
.ap .ap-tk { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 16px; margin-top: 10px; border-radius: 24px; background: var(--carta); box-shadow: var(--ombra); }
.ap-tk strong { min-width: 0; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; } .ap-tk b { align-self: start; padding: 4px 12px; border-radius: 99px; background: #fff0c9; color: #7a5200; font-size: 13px; } .ap-tk[data-stato="contattato"] b { background: #dcefff; color: #0b559a; } .ap-tk[data-stato="chiuso"] b { background: #d8f5e8; color: #007a50; }
.ap-tk span { min-width: 0; color: var(--tenue); font-size: 15px; overflow-wrap: anywhere; } .ap-tk small { color: var(--tenue); font-size: 13px; }
.ap-vuoto { padding: 14px 0 4px; text-align: center; color: var(--tenue); } .ap-vuoto svg { width: 120px; height: 120px; } .ap-vuoto p { margin: 4px 0 0; }

.ap .ap-frase { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, #7a4a00, #a86205); } .ap-frase svg { flex: none; width: 54px; height: 54px; } .ap-frase span { min-width: 0; } .ap-frase small { display: block; font-size: 14px; } .ap-frase strong { display: block; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
