/* ============================================================
   Spesa Smart 2.0 — sito di presentazione
   Stessa identità visiva dell'app: palette "verdura fresca",
   Fredoka per i titoli, Inter per il corpo testo, pillole ovunque.
   ============================================================ */

:root {
  --bg-base:      #F6F1E4;
  --bg-surface:   #FFFFFF;
  --bg-elevated:  #F1EADA;
  --border:       rgba(32,41,34,0.10);
  --border-subtle: rgba(32,41,34,0.06);

  --green:        #4E9C2E;
  --green-dim:    rgba(78,156,46,0.12);
  --green-border: rgba(78,156,46,0.35);
  --red:          #D8472B;
  --red-dim:      rgba(216,71,43,0.10);
  --orange:       #B9800F;
  --orange-dim:   rgba(185,128,15,0.12);
  --blue:         #4F6E8C;
  --blue-dim:     rgba(79,110,140,0.12);
  --purple:       #6851A0;
  --purple-dim:   rgba(104,81,160,0.12);

  --text-primary:   #202922;
  --text-secondary: #5B6B57;
  --text-muted:     #8A9685;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fredoka', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-card: 0 2px 14px -6px rgba(32,41,34,0.10);
  --transition: 150ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-base:      #1B2420;
    --bg-surface:   #1E2B23;
    --bg-elevated:  #26382C;
    --border:       rgba(243,238,226,0.10);
    --border-subtle: rgba(243,238,226,0.06);

    --green:        #8FD14F;
    --green-dim:    rgba(143,209,79,0.14);
    --green-border: rgba(143,209,79,0.35);
    --red:          #F2643B;
    --red-dim:      rgba(242,100,59,0.12);
    --orange:       #F2B84B;
    --orange-dim:   rgba(242,184,75,0.16);
    --blue:         #7A9DBC;
    --blue-dim:     rgba(122,157,188,0.16);
    --purple:       #9482C9;
    --purple-dim:   rgba(148,130,201,0.16);

    --text-primary:   #F3EEE2;
    --text-secondary: #AAB8A6;
    --text-muted:     #6E7C6A;
    --shadow-card: 0 2px 14px -6px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
section { padding: 88px 0; }
@media (max-width: 640px) { section { padding: 56px 0; } }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1.15; }
h2 { font-size: clamp(28px, 4vw, 38px); }
h3 { font-size: 20px; }
p { color: var(--text-secondary); margin: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--green); text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.section-head { max-width: 620px; margin-bottom: 48px; }
.section-head p { margin-top: 12px; font-size: 17px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Bottoni / pillole ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  padding: 13px 26px; border-radius: var(--radius-full);
  border: none; cursor: pointer; text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #12210A; box-shadow: 0 10px 24px -10px var(--green-border); }
.btn-primary:hover { box-shadow: 0 14px 28px -10px var(--green-border); }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg-base) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav-links a { text-decoration: none; color: var(--text-secondary); transition: color var(--transition); }
.nav-links a:hover { color: var(--text-primary); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }
.mobile-only-cta { display: none; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--bg-surface);
    font-size: 20px; cursor: pointer; color: var(--text-primary);
    flex-shrink: 0;
  }
  /* Sulla barra in alto, in mobile, restano SOLO il logo e l'hamburger —
     i due bottoni CTA ("Accedi"/"Apri l'app") non ci stanno affiancati al
     logo su schermi stretti (il testo andava a capo dentro la pillola).
     Si spostano dentro il menu a tendina (vedi .mobile-only-cta sotto). */
  .nav-cta .btn-ghost, .nav-cta .btn-primary { display: none; }
  .brand { font-size: 16px; white-space: nowrap; }
  .btn { white-space: nowrap; }
  body.menu-aperto .nav-links {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-surface); border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px;
  }
  body.menu-aperto .nav-links a { width: 100%; padding: 10px 0; }
  body.menu-aperto .nav-links .mobile-only-cta {
    display: flex; justify-content: center; padding: 12px 0; margin-top: 6px;
  }
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
.hero h1 { font-size: clamp(34px, 5.2vw, 54px); }
.hero .tagline { font-size: clamp(17px, 2vw, 20px); margin-top: 18px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.hero-note i { color: var(--green); }

/* ---------- Mockup telefono (CSS, niente screenshot) ---------- */
.phone {
  width: 100%; max-width: 300px; margin: 0 auto;
  background: var(--bg-surface); border: 10px solid var(--text-primary);
  border-radius: 34px; box-shadow: var(--shadow-card);
  overflow: hidden; position: relative;
}
.phone-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 90px; height: 18px; background: var(--text-primary);
  border-radius: 0 0 12px 12px; z-index: 2;
}
.phone-screen { padding: 26px 14px 14px; }
.phone-topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.phone-topbar .brand-mark { width: 24px; height: 24px; border-radius: 7px; }
.phone-topbar span { font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.phone-greet { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin-bottom: 14px; }
.phone-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.phone-tile {
  border-radius: 12px; padding: 12px 10px; font-size: 11px; font-weight: 700;
  font-family: var(--font-display); color: #12210A; display: flex;
  flex-direction: column; gap: 16px;
}
.phone-tile i { font-size: 16px; }
.phone-tile.t-green { background: var(--green); }
.phone-tile.t-red { background: var(--red); color: #2A0D05; }
.phone-tile.t-blue { background: var(--blue); color: #0E1B26; }
.phone-tile.t-orange { background: var(--orange); color: #241800; }
.phone-list-row {
  display: flex; align-items: center; gap: 8px; background: var(--bg-elevated);
  border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px;
}
.phone-list-row .dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border); flex-shrink: 0; }
.phone-list-row.on .dot { background: var(--green); border-color: var(--green); position: relative; }
.phone-list-row.on span { text-decoration: line-through; color: var(--text-muted); }
.phone-nav { display: flex; justify-content: space-around; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 10px; }
.phone-nav i { font-size: 15px; color: var(--text-muted); }
.phone-nav i.active { color: var(--green); }

/* ---------- Come funziona ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-left: 2px; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--green-dim);
  color: var(--green); font-family: var(--font-display); font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.step h3 { margin-bottom: 8px; }
.step p { font-size: 15px; }

/* ---------- Feature blocks ---------- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  padding: 56px 0; border-bottom: 1px solid var(--border-subtle);
}
.feature:last-child { border-bottom: none; }
.feature.reverse .feature-visual { order: 2; }
@media (max-width: 860px) {
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 28px; }
  .feature.reverse .feature-visual { order: 0; }
}
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; font-size: 24px; margin-bottom: 18px;
}
.feature-icon.i-green { background: var(--green-dim); color: var(--green); }
.feature-icon.i-red { background: var(--red-dim); color: var(--red); }
.feature-icon.i-blue { background: var(--blue-dim); color: var(--blue); }
.feature-icon.i-orange { background: var(--orange-dim); color: var(--orange); }
.feature-icon.i-purple { background: var(--purple-dim); color: var(--purple); }
.feature h3 { font-size: 24px; margin-bottom: 12px; }
.feature p { font-size: 16px; }
.feature-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feature-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--text-secondary); }
.feature-list i { color: var(--green); font-size: 16px; margin-top: 3px; flex-shrink: 0; }
.feature-visual {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 28px; box-shadow: var(--shadow-card); min-height: 220px;
  display: flex; flex-direction: column; gap: 10px; justify-content: center;
}

/* card generiche riusate nei visual delle feature */
.mini-card {
  display: flex; align-items: center; gap: 12px; background: var(--bg-elevated);
  border-radius: var(--radius-md); padding: 12px 14px; font-size: 14px;
}
.mini-card i { font-size: 18px; flex-shrink: 0; }
.mini-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-full);
}
.mini-badge.b-green { background: var(--green-dim); color: var(--green); }
.mini-badge.b-blue { background: var(--blue-dim); color: var(--blue); }
.mini-badge.b-purple { background: var(--purple-dim); color: var(--purple); }
.mini-progress { height: 8px; border-radius: 99px; background: var(--bg-elevated); overflow: hidden; }
.mini-progress-fill { height: 100%; background: var(--red); border-radius: 99px; }

/* ---------- Griglia famiglia/sicurezza (card semplici) ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-card);
}
.card .feature-icon { margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; font-size: 18px; }
.card p { font-size: 14.5px; }

/* ---------- Installazione PWA ---------- */
.install-card p { font-size: 14.5px; }
.install-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.install-steps li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}
.install-steps i { font-size: 15px; color: var(--text-muted); vertical-align: -2px; }
.install-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--green-dim); color: var(--green);
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.install-note {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 780px; margin: 36px auto 0;
  background: var(--orange-dim); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 18px;
  font-size: 14px; color: var(--text-secondary);
}
.install-note i { color: var(--orange); font-size: 18px; margin-top: 2px; flex-shrink: 0; }

/* ---------- Form contatti ---------- */
.contact-form {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px; box-shadow: var(--shadow-card);
  max-width: 520px; margin: 0 auto;
}
.cf-field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.cf-field label { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.cf-field input, .cf-field select, .cf-field textarea {
  width: 100%; padding: 11px 14px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); font-size: 15px; font-family: var(--font-sans);
  outline: none; transition: border-color var(--transition);
}
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus { border-color: var(--green); }
.cf-field textarea { resize: vertical; }
.cf-hint { font-size: 12px; color: var(--text-muted); }
.cf-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin-bottom: 18px; display: flex; justify-content: center; }
.cf-msg { margin-top: 14px; font-size: 14px; text-align: center; min-height: 1.4em; }
.cf-msg.ok { color: var(--green); }
.cf-msg.err { color: var(--red); }
.cf-pin-input { text-align: center; letter-spacing: 0.4em; font-size: 20px; font-weight: 700; }
.cf-link-btn {
  display: block; width: 100%; text-align: center; margin-top: 12px;
  background: none; border: none; color: var(--text-muted); font-size: 13.5px;
  cursor: pointer; text-decoration: underline;
}

/* ---------- FAQ ---------- */
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 15.5px; font-weight: 600; color: var(--text-primary);
  text-align: left;
}
.faq-q i { color: var(--text-muted); transition: transform var(--transition); flex-shrink: 0; }
.faq-item.open .faq-q i { transform: rotate(180deg); color: var(--green); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 220ms ease; }
.faq-a p { padding: 0 20px 18px; font-size: 14.5px; }
.faq-item.open .faq-a { max-height: 320px; }

/* ---------- CTA finale ---------- */
.cta-final {
  background: var(--green); border-radius: var(--radius-xl); padding: 56px 40px;
  text-align: center; margin: 0 24px;
}
@media (min-width: 1080px) { .cta-final { margin: 0 auto; max-width: 1032px; } }
.cta-final h2 { color: #12210A; }
.cta-final p { color: rgba(18,33,10,0.75); margin-top: 12px; font-size: 17px; }
.cta-final .hero-actions { justify-content: center; margin-top: 28px; }
.cta-final .btn-primary { background: #12210A; color: #F3EEE2; box-shadow: none; }
.cta-final .btn-secondary { background: rgba(18,33,10,0.08); border-color: rgba(18,33,10,0.18); color: #12210A; }

/* ---------- Footer ---------- */
footer { padding: 40px 0 32px; border-top: 1px solid var(--border-subtle); margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; font-size: 14px; color: var(--text-muted); }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text-primary); }
.footer-note { font-size: 13px; color: var(--text-muted); margin-top: 18px; }
