/* Dianix — sito vetrina. Nessuna dipendenza esterna. */

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("../fonts/sora-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("../fonts/sora-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #13213A;
  --ink-2: #1D2E4D;
  --ink-3: #2A3D60;
  --coral: #E4572E;
  --coral-text: #B83E1C;
  --coral-btn: #F0794F; /* testo inchiostro sopra: contrasto 5.8:1 */
  --paper: #FFFFFF;
  --mist: #EEF1F5;
  --line: #D5DBE3;
  --grey: #5B6472;
  --grey-on-ink: #A9B4C6;
  --ok: #1E7A4F;
  --ok-bg: #E3F4EA;
  --wait-bg: #FCE9E3;
  --wa-bubble: #DCF5E3;
  --wa-bg: #EFE9E1;

  --font: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1160px;
  --gutter: 24px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--coral-text); }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); line-height: 1.06; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.12; }
h3 { font-size: 1.2rem; line-height: 1.35; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-s);
}
.skip:focus { top: 12px; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 1rem/1 var(--font); text-decoration: none; letter-spacing: -0.005em;
  border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--coral-btn); color: var(--ink); }
.btn-primary:hover { background: #F4936F; color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-3); color: var(--paper); }
.btn-ghost { border-color: rgba(255,255,255,.35); color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper); color: var(--paper); }

/* ---------- Header ---------- */
.site-header { background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--paper); text-decoration: none; }
.brand:hover { color: var(--paper); }
.brand svg { width: 20px; height: 33px; }
.brand-name { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }

.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--grey-on-ink); text-decoration: none; font-size: .95rem; border-radius: var(--radius-s);
}
.nav-list a:hover { color: var(--paper); }
.nav-list .btn { margin-left: 12px; min-height: 44px; padding: 0 18px; font-size: .95rem; color: var(--ink); }
.nav-list .btn:hover { color: var(--ink); }

.nav-toggle { display: none; }

@media (max-width: 980px) {
  .site-nav { display: none; }
  .nav-toggle { display: block; position: relative; }
  .nav-toggle summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid rgba(255,255,255,.35);
    font-weight: 600; font-size: .95rem;
  }
  .nav-toggle summary::-webkit-details-marker { display: none; }
  .nav-toggle[open] summary { border-color: var(--paper); }
  .nav-toggle .nav-list {
    position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px));
    flex-direction: column; align-items: stretch; gap: 0; padding: 10px;
    background: var(--ink-2); border-radius: var(--radius-m); box-shadow: 0 18px 40px rgba(5, 12, 26, .45);
  }
  .nav-toggle .nav-list a { color: var(--paper); padding: 0 14px; }
  .nav-toggle .nav-list .btn { margin: 8px 0 0; color: var(--ink); }
}

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: var(--paper); padding: 72px 0 112px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 64px; align-items: center; }
.hero h1 { max-width: 13ch; }
.hero-lead { margin-top: 24px; max-width: 34em; font-size: 1.15rem; color: #D3DAE6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-note { margin-top: 20px; font-size: .9rem; color: var(--grey-on-ink); }

/* La telefonata */
.call {
  background: var(--paper); color: var(--ink); border-radius: var(--radius-l);
  box-shadow: 0 30px 80px rgba(3, 9, 22, .55); overflow: hidden; margin: 0;
}
.call-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.call-who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.call-who svg { width: 12px; height: 20px; }
.call-state { display: inline-flex; align-items: center; gap: 8px; color: var(--grey); font-variant-numeric: tabular-nums; }
.call-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.call-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 18px; font-size: .97rem; line-height: 1.5; }
.msg-bot { align-self: flex-start; background: var(--mist); border-bottom-left-radius: 6px; }
.msg-caller { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 6px; }
.msg-who { display: block; font-size: .78rem; font-weight: 600; color: var(--grey); margin-bottom: 2px; }
.msg-caller .msg-who { color: var(--grey-on-ink); }
.saved {
  margin-top: 6px; border: 2px solid var(--coral); border-radius: var(--radius-m); padding: 14px 16px;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .92rem;
}
.saved-title { grid-column: 1 / -1; font-weight: 600; margin-bottom: 4px; }
.saved dt { color: var(--grey); }
.saved dd { margin: 0; font-weight: 500; }

@media (prefers-reduced-motion: no-preference) {
  .call-body > * { opacity: 0; transform: translateY(8px); animation: say .45s ease-out forwards; animation-delay: calc(var(--i) * .9s + .4s); }
}
@keyframes say { to { opacity: 1; transform: none; } }

/* ---------- Sezioni ---------- */
.section { padding: 112px 0; }
.section-mist { background: var(--mist); }
.section-head { max-width: 46rem; }
.section-head p { margin-top: 18px; font-size: 1.12rem; color: var(--grey); }

/* Come funziona: è una sequenza, quindi numerata */
.steps { list-style: none; margin: 64px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 72px; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-weight: 600; font-size: 1.1rem;
}
.steps li::after {
  content: ""; position: absolute; top: 23px; left: 64px; right: -16px; height: 2px; background: var(--line);
}
.steps li:last-child::after { display: none; }
.steps li:nth-child(2)::before { background: var(--coral-btn); color: var(--ink); }
.steps p { margin-top: 10px; color: var(--grey); }

/* Cosa fa */
.features { margin: 64px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; }
.feature { padding: 28px 0; border-top: 1px solid var(--line); }
.feature p { margin-top: 8px; color: var(--grey); max-width: 34em; }

.audience { margin-top: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.audience-label { font-weight: 600; margin-right: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .93rem; }

/* ---------- Dashboard (finta finestra) ---------- */
.mock {
  margin: 56px 0 0; background: var(--paper); border-radius: var(--radius-l);
  box-shadow: 0 1px 0 var(--line), 0 24px 60px rgba(19, 33, 58, .14); overflow: hidden;
}
.mock-bar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: #E3E8EF; }
.mock-dots { display: flex; gap: 6px; }
.mock-dots span { width: 10px; height: 10px; border-radius: 50%; background: #C2CAD6; }
.mock-url { flex: 1; max-width: 360px; margin: 0 auto; text-align: center; font-size: .82rem; color: var(--grey); background: var(--paper); border-radius: 999px; padding: 4px 12px; }

.app-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.app-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15rem; letter-spacing: -0.03em; }
.app-brand svg { width: 13px; height: 22px; }
.app-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .88rem; color: var(--grey); }
.fake-select { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 12px; color: var(--ink); }
.fake-select::after { content: "▾"; margin-left: 10px; color: var(--grey); }

.app-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.app-list { padding: 18px 24px 24px; min-width: 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; font-size: .9rem; }
.tab { padding: 6px 12px; border-radius: 999px; color: var(--grey); }
.tab-on { background: var(--ink); color: var(--paper); }
.table-box { overflow-x: auto; }
.calls { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.calls th { text-align: left; font-weight: 500; color: var(--grey); padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: .82rem; }
.calls td { padding: 12px 10px; border-bottom: 1px solid var(--mist); vertical-align: top; }
.calls td:first-child { font-variant-numeric: tabular-nums; color: var(--grey); }
.calls .is-selected td { background: #F6F8FB; }
.calls .is-selected td:first-child { box-shadow: inset 3px 0 0 var(--coral); }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status-wait { background: var(--wait-bg); color: var(--coral-text); }
.status-done { background: var(--ok-bg); color: var(--ok); }

.app-detail { border-left: 1px solid var(--line); padding: 22px 24px 26px; background: #FAFBFD; min-width: 0; }
.app-detail h3 { font-size: 1.1rem; }
.detail-sub { color: var(--grey); font-size: .88rem; margin-top: 2px; }
.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 18px 0; font-size: .9rem; }
.detail-grid dt { color: var(--grey); }
.detail-grid dd { margin: 0; }
.transcript { border-top: 1px solid var(--line); padding-top: 14px; font-size: .86rem; line-height: 1.55; }
.transcript-title { font-weight: 600; margin-bottom: 8px; }
.transcript p + p { margin-top: 6px; }
.transcript b { font-weight: 600; }
.fake-btn { display: inline-flex; margin-top: 18px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: .88rem; }

.mock-caption { margin-top: 14px; font-size: .88rem; color: var(--grey); }

.points { margin: 72px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.points p { margin-top: 8px; color: var(--grey); }

/* Messaggio e ruoli */
.split { margin-top: 96px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.split h3 { font-size: 1.55rem; letter-spacing: -0.02em; }
.split-text p { margin-top: 14px; color: var(--grey); }

.editor { background: var(--paper); border-radius: var(--radius-l); padding: 24px; box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(19, 33, 58, .10); margin: 0; }
.editor-title { font-weight: 600; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.editor-title span { font-weight: 400; color: var(--grey); font-size: .88rem; }
.field { margin-top: 16px; }
.field-label { font-size: .85rem; font-weight: 600; }
.field-box { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font-size: .9rem; line-height: 1.5; color: var(--ink); background: #FCFCFD; }
.field-lock { color: var(--grey); background: var(--mist); }
.editor-foot { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--grey); }

.roles { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: .93rem; }
.roles th, .roles td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.roles th:first-child, .roles td:first-child { text-align: left; }
.roles thead th { font-weight: 600; font-size: .88rem; }
.roles tbody th { font-weight: 400; }
.yes { color: var(--ok); font-weight: 700; font-size: 1.25rem; line-height: 1; }
.no { color: #9AA3B0; font-size: 1.25rem; line-height: 1; }

/* ---------- WhatsApp ---------- */
.wa .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); gap: 72px; align-items: center; }
.badge { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--wait-bg); color: var(--coral-text); font-size: .85rem; font-weight: 600; margin-bottom: 18px; }
.wa-text p { margin-top: 16px; color: var(--grey); max-width: 34em; }
.wa-list { margin: 24px 0 0; padding: 0; list-style: none; }
.wa-list li { position: relative; padding-left: 26px; margin-top: 10px; }
.wa-list li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); }

.phone {
  width: min(360px, 100%); margin: 0 auto; border-radius: 40px; padding: 12px; background: var(--ink);
  box-shadow: 0 30px 70px rgba(19, 33, 58, .25);
}
.phone-screen { border-radius: 30px; overflow: hidden; background: var(--wa-bg); }
.phone-head { background: #0F5B4B; color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.phone-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; }
.phone-avatar svg { width: 12px; height: 20px; }
.phone-name { font-weight: 600; font-size: .95rem; line-height: 1.2; }
.phone-name small { display: block; font-weight: 400; font-size: .78rem; opacity: .85; }
.phone-chat { padding: 18px 14px 22px; display: flex; flex-direction: column; gap: 10px; min-height: 380px; }
.wa-msg { max-width: 84%; padding: 9px 12px 18px; border-radius: 12px; font-size: .9rem; line-height: 1.45; position: relative; background: var(--paper); align-self: flex-start; }
.wa-msg time { position: absolute; right: 10px; bottom: 4px; font-size: .68rem; color: var(--grey); }
.wa-me { align-self: flex-end; background: var(--wa-bubble); }
.wa-day { align-self: center; font-size: .75rem; background: rgba(255,255,255,.8); padding: 3px 10px; border-radius: 8px; color: var(--grey); }

/* ---------- Privacy e sicurezza ---------- */
.trust { margin: 64px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; }
.trust div { padding: 28px 0; border-top: 1px solid var(--line); }
.trust p { margin-top: 8px; color: var(--grey); }

/* ---------- Domande ---------- */
.faq { margin-top: 48px; max-width: 52rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 0; font-weight: 600; font-size: 1.1rem; min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.6rem; font-weight: 400; line-height: 1; color: var(--coral-text); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 24px; color: var(--grey); max-width: 44em; }

/* ---------- Contatti ---------- */
.cta { background: var(--ink); color: var(--paper); padding: 104px 0; }
.cta .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: 48px; align-items: end; }
.cta p { margin-top: 18px; color: #D3DAE6; font-size: 1.12rem; max-width: 36em; }

/* ---------- Footer ---------- */
.site-footer { background: #0D1829; color: var(--grey-on-ink); padding: 48px 0; font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; align-items: flex-start; }
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--coral); }
.footer-brand .brand-name { font-size: 1.3rem; }
.footer-brand p { margin-top: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }

/* ---------- Pagine di testo (privacy, 404) ---------- */
.page { padding: 80px 0 112px; }
.prose { max-width: 46rem; }
.prose h1 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); }
.prose h2 { font-size: 1.5rem; margin-top: 48px; letter-spacing: -0.02em; }
.prose p, .prose ul { margin-top: 14px; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 6px; }
.prose .updated { color: var(--grey); margin-top: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { padding: 48px 0 80px; }
  .hero .wrap, .wa .wrap, .split, .cta .wrap { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero h1 { max-width: 16ch; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .steps li::after { display: none; }
  .app-main { grid-template-columns: minmax(0, 1fr); }
  .app-detail { border-left: 0; border-top: 1px solid var(--line); }
  .points { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .section { padding: 80px 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 1rem; }
  .steps, .features, .trust { grid-template-columns: minmax(0, 1fr); }
  .call-body { padding: 16px; }
  .msg { max-width: 94%; }
  .split { margin-top: 72px; }
  .editor { padding: 18px; }
  .roles { font-size: .85rem; }
  .roles th, .roles td { padding: 10px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
