:root {
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;
  --violet: #7c3aed;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --bg-alt: #f8fafc;
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .25);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: var(--blue); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* ---------- Bottoni ---------- */
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; box-shadow: 0 6px 16px -6px rgba(29, 78, 216, .6); }
.btn:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.btn-ghost:hover { background: rgba(29, 78, 216, .06); }
.btn-light { background: #fff; color: var(--blue); }
.btn-light:hover { background: #eef2ff; }

/* ---------- Navigazione ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--blue); text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; font-size: 18px; font-weight: 700; }
.logo.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 13px; }
.menu { display: flex; align-items: center; gap: 26px; }
.menu a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.menu a:not(.btn):hover { color: var(--text); }
.menu-toggle, .menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 80px 0 96px; background:
  radial-gradient(900px 500px at 85% -10%, rgba(124, 58, 237, .14), transparent 60%),
  radial-gradient(800px 500px at -10% 20%, rgba(29, 78, 216, .12), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px; background: #eef2ff; color: var(--blue); font-weight: 600; font-size: 14px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); letter-spacing: -.02em; }
.grad { background: linear-gradient(90deg, var(--blue), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--muted); margin: 22px 0 32px; max-width: 560px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Mockup telefono ---------- */
.mock { position: relative; display: flex; justify-content: center; }
.phone { width: 260px; height: 520px; border-radius: 40px; background: #0f172a; padding: 12px; box-shadow: 0 40px 80px -30px rgba(15, 23, 42, .55); position: relative; }
.phone-notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; background: #0f172a; border-radius: 0 0 14px 14px; z-index: 1; }
.phone-screen { height: 100%; border-radius: 30px; background: #f1f5f9; padding: 40px 16px 16px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.m-bar { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--blue); }
.m-doc { flex: 1; background: #fff; border-radius: 12px; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--border); }
.m-line { height: 8px; border-radius: 4px; background: #e2e8f0; }
.w90 { width: 90%; } .w80 { width: 80%; } .w75 { width: 75%; } .w70 { width: 70%; } .w60 { width: 60%; }
.m-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.m-otp span { background: #fff; border: 1.5px solid #c7d2fe; border-radius: 8px; text-align: center; font-weight: 700; padding: 6px 0; color: var(--blue-dark); }
.m-btn { background: var(--blue); color: #fff; text-align: center; border-radius: 10px; padding: 10px; font-size: 13px; font-weight: 600; }
.sms-bubble { position: absolute; right: -8px; top: 70px; max-width: 230px; background: #fff; border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.45; box-shadow: var(--shadow); border: 1px solid var(--border); animation: float 5s ease-in-out infinite; }
.sms-bubble small { display: block; font-weight: 700; color: var(--muted); letter-spacing: .05em; margin-bottom: 4px; font-size: 11px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Sezioni ---------- */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.title { font-size: clamp(28px, 3.4vw, 40px); text-align: center; letter-spacing: -.015em; }
.subtitle { text-align: center; color: var(--muted); font-size: 18px; margin: 12px auto 48px; max-width: 620px; }
.title.left, .subtitle.left { text-align: left; margin-left: 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
.steps li { position: relative; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; font-weight: 700; margin-bottom: 16px; }
.steps h3, .feature h3 { font-size: 19px; margin-bottom: 8px; }
.steps p, .feature p { margin: 0; color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.feature { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.icon { font-size: 26px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: #eef2ff; margin-bottom: 16px; }

.dev-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.dev-cta { margin: 28px 0 6px; }
.dev-langs { margin: 0; color: var(--muted); font-size: 14px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding-left: 32px; margin: 12px 0; font-weight: 500; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: #dcfce7; color: #15803d; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.code { margin: 0; background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 24px; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; box-shadow: var(--shadow); }
.code .c { color: #64748b; } .code .k { color: #93c5fd; } .code .s { color: #86efac; }

.policy { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; margin-top: 36px; }
.policy p { color: var(--muted); }
.policy strong { color: var(--text); }
.policy blockquote { margin: 16px 0; padding: 14px 18px; border-left: 4px solid var(--blue); background: #eef2ff; border-radius: 0 10px 10px 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }

.contact { background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; }
.contact .title { color: #fff; }
.contact .subtitle { color: rgba(255, 255, 255, .85); margin-bottom: 32px; }

.footer { padding: 32px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--blue); }
.footer .brand { font-size: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .dev-cta, .dev-langs { text-align: center; }
  .hero { padding: 56px 0 72px; }
  .hero-grid, .dev-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-grid > div:first-child { text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .cta { justify-content: center; }
  .steps, .features { grid-template-columns: 1fr 1fr; }
  .title.left, .subtitle.left { text-align: center; margin-left: auto; }
  .checks { max-width: 380px; margin: 0 auto; }
}
@media (max-width: 720px) {
  .menu-btn { display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
  .menu-btn span, .menu-btn span::before, .menu-btn span::after { content: ""; display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; position: relative; transition: transform .2s, background .2s; }
  .menu-btn span::before { position: absolute; top: -7px; }
  .menu-btn span::after { position: absolute; top: 7px; }
  .menu-toggle:checked + .menu-btn span { background: transparent; }
  .menu-toggle:checked + .menu-btn span::before { transform: translateY(7px) rotate(45deg); }
  .menu-toggle:checked + .menu-btn span::after { transform: translateY(-7px) rotate(-45deg); }
  .menu { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 4px; padding: 12px 20px 20px; background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .menu a:not(.btn) { padding: 10px 0; width: 100%; text-align: center; }
  .menu-toggle:checked ~ .menu { display: flex; }
  .steps, .features { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .sms-bubble { right: 0; top: auto; bottom: -24px; }
  .policy { padding: 22px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sms-bubble { animation: none; }
}

/* ---------- Documentazione sviluppatori ---------- */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 80px; }
.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 14px; }
.toc nav { display: flex; flex-direction: column; }
.toc-title { margin: 18px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc-title:first-child { margin-top: 0; }
.toc a { color: var(--muted); text-decoration: none; padding: 5px 10px; border-left: 2px solid var(--border); }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }
.docs-content { min-width: 0; }
.docs-content section { padding: 8px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.docs-content section:last-child { border-bottom: 0; }
.docs-content h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.02em; margin-bottom: 12px; }
.docs-content h2 { font-size: 26px; margin-bottom: 14px; letter-spacing: -.01em; }
.docs-content p, .docs-content li { color: #334155; }
.docs-content .lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; max-width: none; }
.docs-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.docs-content :not(pre) > code { background: #eef2ff; color: var(--blue-dark); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.docs-content .small { font-size: 14px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.facts div { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg-alt); }
.facts span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.facts code { background: none !important; padding: 0 !important; white-space: normal !important; }
.notes { padding-left: 20px; }
.notes li { margin: 6px 0; }
.flow { padding-left: 22px; }
.flow li { margin: 8px 0; padding-left: 4px; }
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.endpoint code { font-size: 15px; font-weight: 600; word-break: break-all; }
.method { font: 700 12px/1 ui-monospace, Menlo, Consolas, monospace; padding: 6px 8px; border-radius: 6px; color: #fff; }
.m-get { background: #15803d; } .m-post { background: var(--blue); } .m-put { background: #b45309; }
.params { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 14px; display: block; overflow-x: auto; }
.params th, .params td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.params th { background: var(--bg-alt); font-weight: 600; }
.params td:first-child { white-space: nowrap; }
.tabs { border: 1px solid #1e293b; border-radius: var(--radius); overflow: hidden; margin: 16px 0; background: #0f172a; }
.tab-bar { display: flex; gap: 2px; background: #1e293b; padding: 6px 6px 0; overflow-x: auto; }
.tab { background: transparent; border: 0; color: #94a3b8; font: 600 13px/1 system-ui, sans-serif; padding: 10px 14px; border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap; }
.tab:hover { color: #e2e8f0; }
.tab.active { background: #0f172a; color: #fff; }
.tabs .code { border-radius: 0; box-shadow: none; }
pre.code { position: relative; margin: 12px 0; font-size: 13px; line-height: 1.6; }
.tabs pre.code { margin: 0; }
pre.code code { white-space: pre; }
.copy { position: absolute; top: 10px; right: 10px; background: #1e293b; color: #cbd5e1; border: 1px solid #334155; border-radius: 6px; font: 600 12px/1 system-ui, sans-serif; padding: 6px 10px; cursor: pointer; opacity: .8; }
.copy:hover { opacity: 1; color: #fff; }
.downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.download { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.download:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.download strong { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--blue); margin-bottom: 4px; }
.download span { font-size: 14px; color: var(--muted); }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .toc { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .facts, .downloads { grid-template-columns: 1fr; }
  pre.code { font-size: 12px; }
}
