/* Sito Habita. Stessi colori dell'app (src/theme.ts). Font di sistema: niente Google Fonts,
   così il sito non trasferisce l'IP dei visitatori a terzi e non serve un banner cookie. */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --muted-surface: #F1F5F9;
  --ink: #0F172A;
  --ink-muted: #475569;
  --ink-subtle: #64748B;
  --line: #E2E8F0;
  --primary: #10B981;
  --primary-strong: #059669;
  --primary-ink: #047857;
  --primary-soft: #ECFDF5;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .12);
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --surface: #111A2E;
    --muted-surface: #16213A;
    --ink: #F1F5F9;
    --ink-muted: #A5B4C8;
    --ink-subtle: #8494AB;
    --line: #1F2B44;
    --primary-ink: #34D399;
    --primary-soft: #0E2A22;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-ink); text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Intestazione */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.4px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.top nav { display: none; gap: 24px; }
.top nav a { color: var(--ink-muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.top nav a:hover { color: var(--ink); }
@media (min-width: 820px) { .top nav { display: flex; } }

/* Selettore lingua (senza JavaScript) */
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink-muted); padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 16px; height: 16px; }
.lang ul { position: absolute; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 170px; }
.lang li a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 15px; }
.lang li a:hover, .lang li a[aria-current] { background: var(--primary-soft); color: var(--primary-ink); }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 14px; font-weight: 700; font-size: 16px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--primary-strong); color: #fff; box-shadow: 0 8px 20px -8px rgba(5, 150, 105, .6); }
.btn-primary:hover { transform: translateY(-1px); background: var(--primary-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { transform: translateY(-1px); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; font-size: 13px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }

/* Hero */
.hero { padding: 48px 0 64px; overflow: hidden; }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 88px 0 96px; } .hero .wrap { grid-template-columns: 1.1fr .9fr; } }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-ink); }
.hero h1 { font-size: clamp(38px, 7vw, 64px); line-height: 1.04; letter-spacing: -.035em; margin: 14px 0 18px; font-weight: 850; }
.hero h1 em { font-style: normal; color: var(--primary-strong); }
.hero p.sub { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-muted); max-width: 34em; margin: 0 0 28px; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stores .pill { margin-top: 18px; }
.stores-note { width: 100%; }

/* Telefono illustrativo */
.phone-stage { position: relative; display: grid; place-items: center; }
.phone-stage::before { content: ""; position: absolute; width: 120%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 22%, transparent), transparent); z-index: 0; }
.phone { position: relative; z-index: 1; width: min(310px, 82vw); aspect-ratio: 9 / 19; border-radius: 46px; background: #0B1220; padding: 12px; box-shadow: 0 40px 80px -30px rgba(15, 23, 42, .55), inset 0 0 0 2px #1E293B; animation: float 7s ease-in-out infinite; }
.screen { position: relative; height: 100%; border-radius: 35px; overflow: hidden; background: #F8FAFC; color: #0F172A; display: flex; flex-direction: column; padding: 44px 14px 16px; }
.notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; background: #0B1220; border-radius: 999px; }
.card-back { position: absolute; left: 26px; right: 26px; top: 60px; bottom: 84px; border-radius: 22px; background: #E2E8F0; transform: scale(.94) translateY(-14px); }
.card { position: relative; flex: 1; border-radius: 22px; background: #fff; overflow: hidden; box-shadow: 0 12px 28px -14px rgba(15, 23, 42, .35); display: flex; flex-direction: column; animation: nudge 7s ease-in-out infinite; }
.card .photo { flex: 1; min-height: 0; }
.card .photo svg { width: 100%; height: 100%; }
.card .info { padding: 14px 16px 16px; }
.card .score { position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, .94); color: #047857; font-weight: 800; font-size: 12px; padding: 6px 10px; border-radius: 999px; }
.card h3 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.card .place { margin: 2px 0 8px; color: #64748B; font-size: 13px; }
.card .price { font-weight: 800; font-size: 15px; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.card .tags span { font-size: 11px; font-weight: 700; color: #047857; background: #ECFDF5; padding: 4px 8px; border-radius: 999px; }
.actions { display: flex; justify-content: center; gap: 18px; padding-top: 14px; }
.actions span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 8px 20px -10px rgba(15, 23, 42, .4); }
.actions span:last-child { background: #059669; }
.actions svg { width: 24px; height: 24px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes nudge { 0%, 70%, 100% { transform: rotate(0) translateX(0); } 80% { transform: rotate(3deg) translateX(10px); } 88% { transform: rotate(-1deg) translateX(-2px); } }

/* Sezioni */
section.block { padding: 72px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2.title { font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 32px; font-weight: 850; }
.columns { display: grid; gap: 24px; }
@media (min-width: 900px) { .columns { grid-template-columns: 1fr 1fr; gap: 32px; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
section.alt .panel { background: var(--bg); box-shadow: none; }
.panel h3 { margin: 0 0 18px; font-size: 20px; letter-spacing: -.2px; display: flex; align-items: center; gap: 10px; }
.panel h3 svg { width: 26px; height: 26px; color: var(--primary-strong); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; counter-increment: step; }
.steps li::before { content: counter(step); width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; }
.steps strong { display: block; font-size: 16px; color: var(--ink); }
.steps span { color: var(--ink-muted); font-size: 15px; }
.grid3 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .grid3 { grid-template-columns: 1fr 1fr 1fr; gap: 20px; } }
.feature { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.feature .icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); margin-bottom: 14px; }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.2px; }
.feature p { margin: 0; color: var(--ink-muted); font-size: 15px; }
.cta { text-align: center; padding: 80px 0; }
.cta .box { background: var(--primary-strong); color: #fff; border-radius: 28px; padding: 56px 24px; position: relative; overflow: hidden; }
.cta .box::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 280px; height: 280px; background: url("/assets/mark-white.svg") center / contain no-repeat; opacity: .12; }
.cta h2 { font-size: clamp(28px, 4.5vw, 42px); letter-spacing: -.03em; line-height: 1.1; margin: 0 auto 12px; max-width: 18em; }
.cta p { margin: 0 0 28px; color: #D1FAE5; font-size: 18px; }
.cta .stores { justify-content: center; position: relative; z-index: 1; }
.cta .btn-ghost { background: #fff; color: #065F46; border: 0; }
.cta .pill { background: rgba(255, 255, 255, .16); color: #fff; }
.cta .pill::before { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); }

/* Pagine di testo */
.page { padding: 40px 0 80px; }
.page-head { max-width: 760px; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -.03em; line-height: 1.08; margin: 8px 0 12px; font-weight: 850; }
.page-head p { color: var(--ink-muted); font-size: 18px; margin: 0; }
.updated { color: var(--ink-subtle); font-size: 14px; font-weight: 600; }
.doc { display: grid; gap: 40px; }
@media (min-width: 980px) { .doc { grid-template-columns: 260px 1fr; gap: 56px; } }
.toc { align-self: start; }
@media (min-width: 980px) { .toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; } }
.toc details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.toc summary { cursor: pointer; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-subtle); }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--ink-muted); text-decoration: none; font-size: 14px; line-height: 1.4; }
.toc a:hover { background: var(--primary-soft); color: var(--primary-ink); }
.prose { max-width: 720px; }
.prose section { padding: 4px 0 22px; scroll-margin-top: 88px; }
.prose h2 { font-size: 20px; letter-spacing: -.2px; margin: 12px 0 8px; }
.prose p { color: var(--ink-muted); margin: 0 0 10px; font-size: 16.5px; line-height: 1.7; }
.prose .note { margin-top: 24px; padding: 14px 16px; border-radius: 14px; background: var(--muted-surface); color: var(--ink-subtle); font-size: 14px; }
.stack { display: grid; gap: 16px; max-width: 760px; }
.stack .panel p { color: var(--ink-muted); margin: 0 0 14px; }
.stack .panel p:last-child { margin-bottom: 0; }
.stack ol.plain { margin: 0; padding-left: 20px; color: var(--ink-muted); display: grid; gap: 6px; }
.stack h2 { font-size: 22px; letter-spacing: -.3px; margin: 24px 0 0; }
.stack > p { color: var(--ink-muted); margin: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq details:first-child { padding-top: 4px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--primary-strong); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 10px 0 0; color: var(--ink-muted); }

/* Piè di pagina */
footer.site { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--ink-subtle); font-size: 14px; }
footer.site .wrap { display: grid; gap: 20px; }
footer.site .links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer.site .links a { color: var(--ink-muted); text-decoration: none; font-weight: 600; }
footer.site .links a:hover { color: var(--ink); }
footer.site .langs { display: flex; flex-wrap: wrap; gap: 6px 14px; }
footer.site .langs a { color: var(--ink-subtle); text-decoration: none; }
footer.site .langs a[aria-current] { color: var(--primary-ink); font-weight: 700; }
footer.site .company { line-height: 1.5; }

/* 404 */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 0; }
.lost .mark { width: 88px; height: 88px; margin: 0 auto 24px; border-radius: 24px; box-shadow: var(--shadow); }
.lost h1 { font-size: 36px; letter-spacing: -.03em; margin: 0 0 8px; }
.lost p { color: var(--ink-muted); margin: 0 0 24px; }

/* Telefono: pulsanti a tutta larghezza */
@media (max-width: 520px) {
  .stores .btn, .stack .btn { width: 100%; }
  .btn { text-align: center; overflow-wrap: anywhere; }
}
