/* Dispensa — landing. Palette = quella dell'app (src/index.css). */
:root {
  --bg: #f4efe6;
  --card: #fffdf8;
  --text: #1f1b14;
  --muted: #6e6557;
  --line: #e8e0d2;
  --accent: #2e6b4f;
  --accent-soft: #dcebe2;
  --on-accent: #fffdf8;
  --soon: #e08a1e;
  --soon-soft: #fbe9cf;
  --soon-ink: #8a4f06;
  --expired: #d2452f;
  --expired-soft: #f8d9d2;
  --expired-ink: #a3301c;
  --ok-ink: #245a41;
  --ghost: #d6cbb8;
  --note: #fbe38a;
  --note-ink: #3b2f10;
  --shadow: 0 1px 2px #0000000a, 0 8px 24px #3a2a1012;
  --shadow-lg: 0 2px 4px #0000000d, 0 24px 60px #3a2a1024;
  --serif: 'Fraunces', Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --card: #221f18;
    --text: #f2ede4;
    --muted: #a39a8a;
    --line: #353026;
    --accent: #6fcf9c;
    --accent-soft: #1f3a2d;
    --on-accent: #10231a;
    --soon: #f0a54a;
    --soon-soft: #3e2c14;
    --soon-ink: #f5b76a;
    --expired: #f27461;
    --expired-soft: #43201a;
    --expired-ink: #f58d7c;
    --ok-ink: #8fdcb1;
    --ghost: #5a5243;
    --note: #e9cf6c;
    --note-ink: #2a2008;
    --shadow: 0 1px 2px #0000004d, 0 8px 24px #00000040;
    --shadow-lg: 0 2px 4px #00000059, 0 24px 60px #00000066;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.55 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip {
  position: absolute; left: 16px; top: -120px; z-index: 10;
  background: var(--card); padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow);
}
.skip:focus { top: 12px; }

.label {
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; }
h1 { font-size: clamp(2.1rem, 8.5vw, 3.6rem); }
h1 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(1.7rem, 6vw, 2.5rem); margin-bottom: 28px; max-width: 18ch; }
h3 { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px; border-radius: 16px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 1.02rem; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--ghost); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: .92rem; border-radius: 14px; }
.btn-light { background: var(--card); color: var(--text); }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 14px;
}
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: -.02em; }

/* Hero */
.hero { display: grid; gap: 40px; padding-top: 28px; padding-bottom: 56px; }
.lead { font-size: 1.08rem; color: var(--muted); margin-top: 18px; max-width: 34em; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.ctas .btn { flex: 1 1 150px; }
.fine { font-size: .85rem; color: var(--muted); margin-top: 16px; }

.hero-visual { position: relative; display: flex; justify-content: center; padding: 20px 0 12px; }
.hero-visual::before { /* scaffale */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 14px;
  border-radius: 7px; background: var(--line);
}
.phone {
  position: relative; width: min(280px, 82vw);
  border-radius: 40px; padding: 10px;
  background: #1f1b14; box-shadow: var(--shadow-lg);
  animation: rise .8s cubic-bezier(.2,.8,.2,1) both;
}
@media (prefers-color-scheme: dark) { .phone { background: #3a352b; } }
.notch { position: absolute; top: 18px; left: 50%; width: 76px; height: 20px; margin-left: -38px; border-radius: 12px; background: #1f1b14; z-index: 1; }
.screen {
  background: var(--bg); border-radius: 31px; padding: 44px 14px 12px;
  display: grid; gap: 10px; overflow: hidden;
}
.s-date { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.s-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; margin-top: -4px; }
.s-sub { font-size: .8rem; color: var(--muted); margin-top: -8px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: .8rem; font-weight: 700; padding: 6px 10px; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line);
  opacity: 0; animation: pop .45s ease forwards;
}
.chip b { font-weight: 800; margin-right: 2px; }
.chip.ok { background: var(--accent-soft); color: var(--ok-ink); box-shadow: none; }
.chip.cart { background: var(--soon-soft); color: var(--soon-ink); box-shadow: none; }
.chip.no { background: var(--expired-soft); color: var(--expired-ink); box-shadow: none; }
.chip:nth-child(1) { animation-delay: .5s; }
.chip:nth-child(2) { animation-delay: .65s; }
.chip:nth-child(3) { animation-delay: .8s; }
.chip:nth-child(4) { animation-delay: .95s; }
.s-btn {
  font-size: .8rem; font-weight: 700; text-align: center; padding: 10px;
  border-radius: 14px; background: var(--accent); color: var(--on-accent);
}
.s-card {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--card); border-radius: 16px; padding: 11px 12px;
  font-size: .85rem; font-weight: 600; box-shadow: var(--shadow);
}
.s-tabs {
  display: flex; justify-content: space-around; margin-top: 6px;
  background: var(--card); border-radius: 18px; padding: 8px; font-size: 1.1rem;
}
.s-tabs .on { background: var(--accent-soft); border-radius: 12px; padding: 0 12px; }

.tag {
  font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--line); color: var(--muted); white-space: nowrap;
}
.tag.soon { background: var(--soon-soft); color: var(--soon-ink); }
.tag.bad { background: var(--expired-soft); color: var(--expired-ink); }

/* Wildcard: bigliettino sul frigo */
.note {
  position: absolute; right: max(0px, calc(50% - 200px)); top: -6px;
  font: 600 1.2rem/1.1 'Caveat', cursive; color: var(--note-ink);
  background: var(--note); padding: 10px 12px 12px; width: 104px;
  transform: rotate(6deg); box-shadow: 0 6px 14px #3a2a1026;
  animation: sway 5s ease-in-out 1.4s infinite;
}
.note::before { /* magnete */
  content: ""; position: absolute; top: -7px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background: var(--expired); box-shadow: 0 2px 3px #0003;
}

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes sway { 0%, 100% { transform: rotate(6deg); } 50% { transform: rotate(2deg); } }

/* Features */
.features { padding-top: 48px; padding-bottom: 48px; }
.grid { display: grid; gap: 14px; }
.card {
  background: var(--card); border-radius: 24px; padding: 22px;
  box-shadow: var(--shadow); transition: transform .2s ease;
}
.card:hover { transform: translateY(-3px); }
.card p { color: var(--muted); }
.ico { font-size: 1.7rem; margin-bottom: 12px; letter-spacing: .08em; }
.mini { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.mini li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 14px; background: var(--bg); font-weight: 600; font-size: .92rem;
}
.k { display: inline-block; font-size: .82rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.k.ok { background: var(--accent-soft); color: var(--ok-ink); }
.k.soon { background: var(--soon-soft); color: var(--soon-ink); }
.k.no { background: var(--expired-soft); color: var(--expired-ink); }

/* How */
.how { padding-top: 48px; padding-bottom: 48px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 0; border-top: 1.5px dashed var(--line);
}
.steps li:last-child { border-bottom: 1.5px dashed var(--line); }
.n { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; min-width: 2ch; }
.steps p { color: var(--muted); }
.install {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 28px;
  background: var(--accent-soft); border-radius: 22px; padding: 20px;
}
.install .ico { margin: 0; }
.install p { color: var(--text); opacity: .85; }

/* FAQ */
.faq { padding-top: 48px; padding-bottom: 48px; max-width: 760px; }
details { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 10px; }
summary {
  list-style: none; cursor: pointer; padding: 18px 52px 18px 20px; font-weight: 700; position: relative;
  border-radius: 20px; min-height: 44px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 500; color: var(--accent); transition: transform .2s ease;
}
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details p { padding: 0 20px 18px; color: var(--muted); }

/* Final CTA */
.final { padding-top: 32px; padding-bottom: 56px; }
.final-box {
  background: var(--accent); color: var(--on-accent); border-radius: 28px;
  padding: 36px 22px; text-align: center; box-shadow: var(--shadow-lg);
}
.final-box h2 { margin: 0 auto 10px; max-width: none; }
.final-box p { opacity: .9; margin-bottom: 22px; }

/* Footer */
.foot {
  padding-top: 24px; padding-bottom: calc(32px + env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--line); display: grid; gap: 6px; font-size: .92rem;
}
.foot a { color: var(--muted); text-underline-offset: 3px; }
.foot a:hover { color: var(--accent); }

/* Tablet / desktop */
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card.big { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .steps li { flex-direction: column; border-bottom: 1.5px dashed var(--line); }
  .foot { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.1fr .9fr; align-items: center; padding-top: 56px; padding-bottom: 88px; }
  .ctas .btn { flex: 0 0 auto; }
  .note { top: 30%; right: max(0px, calc(50% - 215px)); width: 118px; font-size: 1.35rem; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .card.big { grid-column: span 1; grid-row: span 2; }
  .features, .how, .faq { padding-top: 72px; padding-bottom: 72px; }
  .final-box { padding: 56px 40px; }
}
