/* Cenazen app. Colori da brand/brand.json: base salvia e carta, rosso solo per i pulsanti d'azione. */
:root {
  --bg: #F7F5EF;
  --surface: #FFFFFF;
  --ink: #1F2A22;
  --ink-soft: #5B6A5E;
  --line: #E1E3DA;
  --sage: #4F7158;
  --sage-mid: #8FAE93;
  --sage-light: #DCE6DA;
  --sage-tint: #EEF2EB;
  --cta: #B3381F;
  --cta-dark: #9A2F19;
  --r: 20px;
  --r-s: 14px;
  --shadow: 0 1px 2px rgba(31,42,34,.05), 0 10px 28px rgba(31,42,34,.07);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --duration-quick: 150ms;
  --duration-fast: 250ms;
  --duration-medium: 350ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.36, 0.64, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: 32px; font-weight: 800; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
.soft { color: var(--ink-soft); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.stack { display: grid; gap: 12px; }
.stack-l { display: grid; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* Barra in alto */
.top { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.top img { height: 26px; width: auto; display: block; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; font-size: 22px; color: var(--ink); box-shadow: var(--shadow); cursor: pointer; text-decoration: none; }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent; font: 700 17px var(--font-body); cursor: pointer; text-decoration: none; transition: transform var(--duration-quick) ease-out, background-color var(--duration-quick) ease-out; width: 100%; }
.btn:active { transform: scale(0.98); }
.btn-cta { background: var(--cta); color: #fff; }
.btn-cta:hover { background: var(--cta-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-soft { background: var(--sage-light); color: var(--ink); }
.btn-sm { min-height: 44px; font-size: 15px; padding: 0 16px; width: auto; }
.link { background: none; border: 0; color: var(--sage); font: 600 15px var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; padding: 0; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Card */
.card { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card-sage { background: var(--sage); color: #F7F5EF; border-radius: var(--r); padding: 20px; }
.card-sage .soft { color: #DCE6DA; }
.card-tint { background: var(--sage-tint); border-radius: var(--r); padding: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--sage-light); color: var(--ink); font-size: 13px; font-weight: 600; }
.pill-dark { background: rgba(255,255,255,.18); color: #fff; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sage); }

/* Benvenuto */
.welcome { min-height: 100dvh; display: grid; align-content: space-between; padding: 12px 0 28px; gap: 24px; }
.welcome h1 { font-size: 40px; line-height: 1.02; }
.welcome .hero-phone { border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.proof .card { padding: 14px; }
.proof b { font-family: var(--font-display); font-size: 24px; display: block; color: var(--sage); line-height: 1; margin-bottom: 4px; }

/* Form */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field input { min-height: 54px; border-radius: var(--r-s); border: 2px solid #8C948C; background: var(--surface); padding: 0 14px; font: 400 17px var(--font-body); color: var(--ink); }
.field input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.err { color: var(--cta); font-weight: 600; font-size: 14px; min-height: 1.2em; }

/* Passi dell'onboarding */
.steps-bar { display: flex; gap: 6px; margin: 4px 0 20px; }
.steps-bar span { flex: 1; height: 6px; border-radius: 99px; background: var(--sage-light); }
.steps-bar span.on { background: var(--sage); }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; border-radius: var(--r-s); background: var(--surface); border: 2px solid var(--line); cursor: pointer; font: 600 17px var(--font-body); color: var(--ink); text-align: left; width: 100%; }
.choice i { font-size: 26px; color: var(--sage); }
.choice small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 14px; }
.choice[aria-pressed="true"], .choice[aria-checked="true"] { border-color: var(--sage); background: var(--sage-tint); }
.choice .tick { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #8C948C; display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
.choice .tick i { opacity: 0; }
.choice[aria-pressed="true"] .tick, .choice[aria-checked="true"] .tick { background: var(--sage); border-color: var(--sage); }
.choice[aria-pressed="true"] .tick i, .choice[aria-checked="true"] .tick i { opacity: 1; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chip { aspect-ratio: 1; min-height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font: 700 15px var(--font-body); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.day-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.foot-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(247,245,239,0) 0%, var(--bg) 30%); z-index: 20; }
.foot-cta > div { max-width: 480px; margin: 0 auto; display: grid; gap: 8px; }

/* Settimana in stile calendario */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; background: var(--surface); border-radius: var(--r); padding: 12px 4px; box-shadow: var(--shadow); }
.wday { display: grid; justify-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 4px 0; min-height: 64px; font-family: var(--font-body); color: var(--ink); }
.wday small { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.wday span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--sage-mid); font-size: 15px; }
.wday.free span { border-style: dashed; border-color: var(--line); color: var(--ink-soft); }
.wday.done span { background: var(--sage); color: #fff; border-color: var(--sage); }
.wday[aria-current="date"] span { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Piatto */
.dish { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.dish-ico { width: 64px; height: 64px; border-radius: 18px; background: var(--sage-light); display: grid; place-items: center; font-size: 32px; color: var(--sage); }
.dish h3 { font-size: 17px; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.tonight { display: grid; gap: 14px; }
.big-ico { height: 150px; border-radius: 18px; background: var(--sage-light); display: grid; place-items: center; font-size: 76px; color: var(--sage); }
.leftover { display: flex; gap: 10px; align-items: flex-start; background: var(--sage-tint); border-radius: var(--r-s); padding: 12px 14px; font-size: 15px; }
.leftover i { font-size: 22px; color: var(--sage); flex: none; margin-top: 1px; }

/* Ricetta */
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--sage-light); border-radius: 999px; padding: 4px; }
.tabs2 button { min-height: 44px; border: 0; border-radius: 999px; background: none; font: 700 15px var(--font-body); color: var(--ink-soft); cursor: pointer; }
.tabs2 button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.ing { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ing:last-child { border-bottom: 0; }
.ing b { font-weight: 600; white-space: nowrap; }
.cook { min-height: calc(100dvh - 60px); display: grid; grid-template-rows: auto 1fr auto; gap: 16px; padding-bottom: 20px; }
.cook .step-text { font-size: 24px; line-height: 1.35; font-weight: 500; align-self: center; }
.cook .prog { height: 6px; background: var(--sage-light); border-radius: 99px; overflow: hidden; }
.cook .prog span { display: block; height: 100%; background: var(--sage); transition: width var(--duration-fast) var(--ease-smooth-out); }
@media (prefers-reduced-motion: reduce) { .cook .prog span { transition: none; } }

/* Lista */
.aisle h4 { margin: 18px 0 4px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--sage); }
.item { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item input { width: 24px; height: 24px; accent-color: var(--sage); flex: none; margin: 0; }
.item .n { display: grid; flex: 1; }
.item .n small { color: var(--ink-soft); font-size: 13px; }
.item .q { color: var(--ink-soft); font-size: 14px; white-space: nowrap; }
.item input:checked ~ .n { text-decoration: line-through; color: var(--ink-soft); }
.bar { height: 8px; background: var(--sage-light); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--sage); width: 0; transition: width var(--duration-fast) var(--ease-smooth-out); }
@media (prefers-reduced-motion: reduce) { .bar span { transition: none; } }
.total { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: end; }
.total b { font-family: var(--font-display); font-size: 30px; line-height: 1; }

/* Paywall e scheda d'acquisto */
.plan { display: grid; gap: 10px; padding: 16px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; width: 100%; font-family: var(--font-body); color: var(--ink); }
.plan[aria-checked="true"] { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-light); }
.plan .radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #8C948C; flex: none; display: grid; place-items: center; }
.plan[aria-checked="true"] .radio { border-color: var(--sage); }
.plan[aria-checked="true"] .radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--sage); }
.plan .name { font-weight: 700; font-size: 17px; }
.plan .price { font-family: var(--font-display); font-weight: 800; font-size: 22px; white-space: nowrap; }
.plan .perday { font-size: 14px; color: var(--ink-soft); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li i { color: var(--sage); font-size: 18px; margin-top: 2px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; background: var(--sage); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.gifts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gift { border-radius: var(--r-s); background: var(--sage-tint); padding: 10px; display: grid; gap: 4px; align-content: start; text-align: center; }
.gift i { font-size: 26px; color: var(--sage); }
.gift small { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sage); }
.gift b { font-size: 13.5px; line-height: 1.25; }
.seats { display: grid; gap: 6px; }
.placeholder { display: inline-block; background: #FFF3C4; color: #5C4A00; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; }

/* Barra delle schede */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: grid; justify-items: center; gap: 2px; min-height: 52px; align-content: center; text-decoration: none; color: var(--ink-soft); font-size: 12px; font-weight: 600; border-radius: 14px; }
.tabbar a i { font-size: 24px; }
.tabbar a[aria-current="page"] { color: var(--sage); }
.tabbar a[aria-current="page"] i::before { font-family: "Phosphor-Fill" !important; }

/* Foglio dal basso */
.sheet-bg { position: fixed; inset: 0; background: rgba(31,42,34,.4); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 480px; margin: 0 auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 86dvh; overflow: auto; animation: su var(--duration-medium) var(--ease-smooth-out); }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
@keyframes su { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; z-index: 50; max-width: calc(100% - 32px); }
.preview-note { margin: 18px 0 0; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--sage-light); border-top-color: var(--sage); animation: gira 900ms linear infinite; margin: 0 auto; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.plans { display: grid; gap: 12px; }
.tag-arrivo { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--sage-light); color: var(--ink); white-space: nowrap; }
.input { min-height: 48px; min-width: 0; border-radius: var(--r-s); border: 2px solid #8C948C; background: var(--surface); padding: 0 12px; font: 400 16px var(--font-body); color: var(--ink); }
.input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--sage-tint); }
.seg > * { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; background: transparent; font: 600 15px var(--font-body); color: var(--ink); text-decoration: none; cursor: pointer; }
.seg > [aria-pressed="true"], .seg > [aria-selected="true"], .seg > [aria-current="page"] { background: var(--surface); box-shadow: var(--shadow); }
.dish-img { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; background: var(--sage-light); }
.foto { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: var(--sage-light); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto figcaption { position: absolute; right: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(31,42,34,.72); color: #F7F5EF; font-size: 11px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font: 600 14px var(--font-body); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ricettario { padding: 8px 0 40px; display: grid; gap: 14px; }
.ricettario .ric { border-top: 1px solid var(--line); padding-top: 14px; break-inside: avoid; }
.ricettario ul, .ricettario ol { padding-left: 20px; display: grid; gap: 4px; }
@media print { .no-print, .tabbar { display: none !important; } body { background: #fff; } .ricettario h2 { font-size: 20px; } }
.save { justify-self: start; display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--cta); color: #fff; font-size: 14px; font-weight: 700; }
.plan[aria-checked="false"] ul { display: none; }
h1:focus { outline: none; }

/* Telefoni stretti (320 px): sette cerchi da 44 px non stanno in una riga, quindi vanno su due. */
@media (max-width: 359px) {
  .days { grid-template-columns: repeat(4, 1fr); justify-items: center; }
  .day-chip { width: 100%; max-width: 56px; }
  .wday span { width: 34px; height: 34px; }
}

/* Quiz d'ingresso (pagina /quiz/) */
.qz-barra { height: 6px; border-radius: 99px; background: var(--sage-light); margin: 2px 0 22px; overflow: hidden; }
.qz-barra span { display: block; height: 100%; background: var(--sage); border-radius: 99px; transition: width var(--duration-medium) var(--ease-smooth-out); }
.qz-h { font-size: 28px; line-height: 1.12; }
.qz-salta { justify-self: center; min-height: 44px; padding: 0 12px; font-weight: 500; color: var(--ink-soft); }
.qz-info p { font-size: 17px; }
.qz-citazione { margin: 0; padding: 18px 20px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.qz-citazione p { font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.25; }
.qz-citazione cite { display: block; margin-top: 8px; font-style: normal; font-size: 14px; color: var(--ink-soft); }
.qz-tre { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qz-tre figure { margin: 0; text-align: center; font-size: 13px; line-height: 1.3; }
.qz-tre img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-s); display: block; margin-bottom: 6px; }
.qz-dia p { font-size: 17px; }
.qz-num { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--sage); letter-spacing: -0.02em; line-height: 1; margin-right: 4px; }
.qz-fasi { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.qz-fasi li { display: flex; gap: 12px; align-items: center; font-size: 17px; color: var(--ink-soft); }
.qz-fasi li i { font-size: 26px; color: var(--sage-mid); }
.qz-fasi li.fatto { color: var(--ink); }
.qz-fasi li.fatto i { color: var(--sage); }
.qz-piano.on { border: 2px solid var(--sage); }
.qz-giorno { font-family: var(--font-display); font-size: 18px; color: var(--sage); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .qz-barra span { transition: none; } }
.qz-cena .dish { min-width: 0; flex: 1; }
.qz-cena .dish h3 { overflow-wrap: anywhere; }
.qz-ris, .qz-ris > *, .qz-ris .stack > * { min-width: 0; }
.qz-ris { grid-template-columns: minmax(0, 1fr); }
.qz-piano .row { flex-wrap: wrap; gap: 4px 10px; }
.stella { width: 52px; height: 52px; border: 0; background: none; font-size: 36px; color: var(--cta); cursor: pointer; display: grid; place-items: center; border-radius: 12px; }
.field textarea { border-radius: var(--r-s); border: 2px solid #6F7A72; background: var(--surface); padding: 12px 14px; font: 400 17px/1.45 var(--font-body); color: var(--ink); width: 100%; resize: vertical; }
.confronto { width: 100%; border-collapse: collapse; font-size: 15px; }
.confronto th, .confronto td { padding: 9px 6px; text-align: center; border-top: 1px solid var(--line); }
.confronto th { font-size: 14px; border-top: 0; }
.confronto td:first-child, .confronto th:first-child { text-align: left; }
.confronto .on { background: var(--sage-tint); }
.qz-dato { display: grid; gap: 4px; padding: 18px 20px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); font-size: 17px; }
.qz-dato b { font-family: var(--font-display); font-size: 44px; line-height: 1; font-weight: 800; color: var(--sage); letter-spacing: -0.02em; }
.qz-fonte { font-size: 13px; color: var(--ink-soft); }
.qz-info .eyebrow { display: inline-flex; align-items: center; gap: 6px; }
