/* Font ospitati in locale (nessuna richiesta a server terzi). Licenza SIL OFL. */
@font-face {
  font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk"; src: url("fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700; font-display: swap;
}

/* Tema scuro (proposta B): fondo verde-nero, accento smeraldo. */
:root {
  color-scheme: dark;
  --bg: #0B1214;
  --surface: #121C1F;
  --surface-2: #18272A;
  --ink: #EEF3F2;
  --ink-2: #DCE5E3;
  --ink-soft: #A9B8B5;
  --faint: #8EA09C;
  --line: #22312F;
  --line-strong: #2E3D3B;
  --brand: #34D399;
  --brand-hover: #6EE7B7;
  --brand-ink: #06231A;
  --brand-soft: #102320;
  --brand-line: #24403A;
  --accent: #FBBF77;
  --accent-soft: #2A2116;
  --ok: #6EE7B7;   --ok-bg: #0F2A22;
  --info: #93C5FD; --info-bg: #13233A;
  --warn: #FCD9A8; --warn-bg: #2E2414;
  --err: #FCA5A5;  --err-bg: #3A1B1B;
  --muted: #A9B8B5; --muted-bg: #1B2826;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .55);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.03em; }
h1, h2 { font-weight: 700; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* --- header --------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; letter-spacing: -.01em; }
.logo img { display: block; height: 44px; width: auto; }
.logo .logo-mark { display: none; }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav a, .nav button.linklike {
  padding: 8px 12px; border-radius: 8px; color: var(--ink-soft); text-decoration: none; font-size: .95rem; white-space: nowrap;
}
.nav a:hover, .nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a.btn, .nav a.btn:hover { color: var(--brand-ink); background: var(--brand); margin-left: 8px; padding: 9px 18px; border-radius: 999px; }
.nav a.btn:hover { background: var(--brand-hover); }
.nav form { margin: 0; }

main { padding: 36px 0 72px; }
main.landing { padding: 0; }

/* --- card ----------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.step-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font: 700 .85rem var(--font-sans); margin-right: 8px; vertical-align: 2px;
}
.step-num.done { background: var(--ok); color: var(--brand-ink); }

/* --- buttons & forms ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 20px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; background: var(--brand); color: var(--brand-ink);
  transition: background .15s, transform .15s, box-shadow .15s; min-height: 44px;
}
.btn:hover { background: var(--brand-hover); color: var(--brand-ink); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--faint); background: transparent; color: var(--ink); }
.btn.danger { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.btn.danger:hover { background: var(--err-bg); color: var(--err); border-color: var(--err); }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.action { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.action h3 { margin: 0 0 4px; font-size: 1rem; }
.action p { margin: 0 0 10px; }
.log { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--err); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { color: var(--brand); }
.qr { background: #fff; display: inline-block; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.qr svg { display: block; max-width: 100%; height: auto; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.lg { padding: 14px 28px; font-size: 1.05rem; min-height: 52px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
button.linklike { background: none; border: 0; font: inherit; cursor: pointer; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit;
  background: var(--bg); color: var(--ink); border-color: var(--line-strong);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-line); border-color: var(--brand); }
.field { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 220px; }

/* --- flash & badges ------------------------------------------------------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .95rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.info { background: var(--info-bg); color: var(--info); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.muted { background: var(--muted-bg); color: var(--muted); }
.badge.cat { background: var(--brand-soft); color: var(--brand); }

/* --- pricing (landing + abbonamento) -------------------------------------- */
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 24px; justify-content: center; }
.price-card { position: relative; padding: 32px; margin: 0; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.price-card .ribbon {
  position: absolute; top: -13px; left: 32px;
  background: var(--brand); color: var(--brand-ink); font-size: .78rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}
.price { font: 600 2.6rem/1.1 var(--font-display); letter-spacing: -.02em; margin: 8px 0 4px; }
.price small { font: 500 1rem var(--font-sans); color: var(--ink-soft); letter-spacing: 0; }
.plan-option { cursor: pointer; display: block; }
.plan-option input { position: absolute; opacity: 0; }
.plan-option input:checked + .card { border: 2px solid var(--brand); background: var(--brand-soft); }
.plan-option input:focus-visible + .card { outline: 3px solid var(--brand-soft); }

/* --- app: pannello -------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.stat.active { outline: 2px solid var(--brand); }
.stat .n { font: 600 1.7rem/1.2 var(--font-display); }
.stat .l { color: var(--ink-soft); font-size: .85rem; }
.status-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.muted, tr.muted td { color: var(--ink-soft); }
tfoot th { border-top: 2px solid var(--line); border-bottom: 0; color: var(--ink); font-size: .9rem; text-transform: none; letter-spacing: 0; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-soft); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 20px; }
.filters .field { margin: 0; }
.filters input, .filters select { height: 44px; }
.filters .grow { flex: 1; min-width: 180px; }
.filters .export { margin-left: auto; display: flex; gap: 8px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--ink-soft); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* --- app: configurazione -------------------------------------------------- */
.steps-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.steps-nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: .9rem; }
.tones { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tone-option input { position: absolute; opacity: 0; }
.tone-option .box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; height: 100%; cursor: pointer; }
.tone-option input:checked + .box { border: 2px solid var(--brand); background: var(--brand-soft); }
.tone-option input:focus-visible + .box { outline: 3px solid var(--brand-soft); }
.tone-option .box strong { display: block; margin-bottom: 4px; }

.switch { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; }
.switch .text { flex: 1; }
.switch .text strong { display: block; }
.toggle { position: relative; width: 52px; height: 30px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: .2s; cursor: pointer; }
.toggle span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--brand); }
.toggle input:checked + span::before { transform: translateX(22px); }
.toggle input:focus-visible + span { outline: 3px solid var(--brand-soft); }
.toggle.danger input:checked + span { background: var(--accent); }

.mail-view { white-space: pre-wrap; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; font-size: .95rem; }
.preview-out { margin-top: 14px; }
.auth { max-width: 440px; margin: 20px auto; }
.code-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* --- avviso informativa agenzia e accettazione condizioni ------------------ */
.notice-box { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 16px 18px; margin: 0 0 20px; font-size: .93rem; }
.notice-box .notice-title { display: block; margin-bottom: 6px; font-size: 1rem; }
.notice-box ol { margin: 8px 0; padding-left: 20px; }
.notice-box li { margin-bottom: 4px; }
.notice-box summary { cursor: pointer; font-weight: 600; margin-top: 8px; }
.copy-text { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 8px; line-height: 1.55; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; margin-bottom: 12px; }
.consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.auth.wide { max-width: 640px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- pagine legali -------------------------------------------------------- */
.legal-doc { max-width: 820px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 48px; }
.legal-doc h2 { font-size: 1.25rem; margin-top: 2em; }
.legal-doc table { margin: 8px 0 16px; font-size: .95rem; }
.legal-doc th { white-space: nowrap; }
.legal-doc td:first-child { font-weight: 600; width: 32%; }
@media (max-width: 720px) { .legal-doc { padding: 24px 18px; } .legal-doc table { display: block; overflow-x: auto; } }

/* --- footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .9rem; padding: 40px 0 48px; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.site-footer .legal { margin-top: 20px; font-size: .82rem; }

/* ========================================================================== */
/* Landing                                                                    */
/* ========================================================================== */
.lp-section { padding: 88px 0; }
.lp-section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 650;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 14px;
}
.lp-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: 22ch; }
.lp-lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 60ch; }
.lp-head { margin-bottom: 48px; }
.lp-head.center { text-align: center; }
.lp-head.center .lp-title, .lp-head.center .lp-lead { margin-left: auto; margin-right: auto; }

/* hero */
.lp-hero { padding: 72px 0 88px; position: relative; overflow: hidden; }
.lp-hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 12%, transparent), transparent 65%);
  pointer-events: none;
}
.lp-hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; position: relative; }
.lp-hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.025em; margin-bottom: 20px; }
.lp-hero h1 em { font-style: normal; color: var(--brand); }
.lp-hero .lp-lead { font-size: 1.2rem; margin-bottom: 28px; }
.lp-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-assurances { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 24px 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: .92rem; }
.lp-assurances li { display: flex; align-items: center; gap: 6px; }
.lp-assurances svg { color: var(--ok); flex: none; }

/* foto */
.lp-hero-visual { position: relative; padding: 0 0 48px 64px; }
.lp-hero-photo {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 60% center;
  border-radius: 24px; box-shadow: var(--shadow-lg);
}
.lp-hero-visual .lp-inbox { position: absolute; left: 0; bottom: 0; width: min(400px, 82%); }
.lp-hero-visual::after {
  /* chip "in visita" sulla foto: rafforza il messaggio del titolo */
  content: "In visita · le risposte partono lo stesso";
  position: absolute; top: 20px; right: 20px; padding: 8px 14px; border-radius: 999px;
  background: rgba(11, 18, 20, .8); color: var(--ink); border: 1px solid var(--brand-line); font-size: .82rem; font-weight: 600; backdrop-filter: blur(6px);
}
.lp-photo { display: block; width: 100%; height: auto; border-radius: var(--radius); margin-top: 28px; box-shadow: var(--shadow); }
.lp-banner { aspect-ratio: 21 / 8; object-fit: cover; object-position: center 60%; margin: 0 0 28px; }

/* finta casella */
.lp-inbox { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.lp-inbox-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg); font-size: .85rem; color: var(--ink-soft); }
.lp-inbox-bar .dots { display: flex; gap: 6px; margin-right: 8px; }
.lp-inbox-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.lp-msg { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.lp-msg:last-child { border-bottom: 0; }
.lp-msg .avatar { grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--ink); }
.lp-msg .meta { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--ink-soft); }
.lp-msg .meta strong { color: var(--ink); font-size: .9rem; }
.lp-msg p { margin: 0; font-size: .92rem; color: var(--ink); }
.lp-msg.reply { background: var(--surface-2); }
.lp-msg.reply .avatar { background: var(--brand); color: var(--brand-ink); }
.lp-msg .tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .78rem; font-weight: 600; color: var(--brand); }

/* passi */
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.lp-steps li { position: relative; padding-top: 64px; }
.lp-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font: 600 1.2rem var(--font-display);
  background: var(--brand); color: var(--brand-ink);
}
.lp-steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 22px; left: 56px; right: -16px; height: 1px;
  background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px);
}
.lp-steps h3 { font-size: 1.15rem; }
.lp-steps p { color: var(--ink-soft); margin: 0; }

/* tipi di richiesta */
.lp-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.lp-types { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lp-type { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.lp-type svg { color: var(--brand); margin-bottom: 10px; }
.lp-type h3 { margin-bottom: 4px; }
.lp-type p { margin: 0; font-size: .93rem; color: var(--ink-soft); }

/* bozze -> automatico */
.lp-modes { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: stretch; }
.lp-mode { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.lp-mode .label { font-size: .8rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.lp-mode h3 { font: 700 1.35rem var(--font-display); margin: 6px 0 8px; }
.lp-mode p { color: var(--ink-soft); margin: 0; }
.lp-mode.on { border-color: var(--brand); box-shadow: var(--shadow); }
.lp-arrow { display: grid; place-items: center; color: var(--ink-soft); }
.lp-guard { margin-top: 20px; display: flex; gap: 14px; align-items: flex-start; padding: 18px 22px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.lp-guard svg { flex: none; margin-top: 2px; }

/* demo toni */
.lp-demo { display: grid; grid-template-columns: .85fr 1.15fr; gap: 24px; align-items: start; }
.lp-demo .incoming { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.lp-demo .incoming .from { font-size: .85rem; color: var(--ink-soft); margin-bottom: 6px; }
.lp-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; margin-bottom: 14px; }
.lp-tabs button { border: 0; background: none; font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); min-height: 40px; }
.lp-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.lp-reply { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); font-size: .97rem; }
.lp-tones-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.lp-tones-list li { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .88rem; background: var(--surface); }

/* sicurezza */
.lp-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-trust > div { padding: 4px 0; }
.lp-trust svg { color: var(--brand); margin-bottom: 12px; }
.lp-trust p { color: var(--ink-soft); margin: 0; }

/* prezzi */
.lp-price-features { list-style: none; padding: 0; margin: 20px 0 24px; }
.lp-price-features li { padding: 7px 0 7px 28px; position: relative; }
.lp-price-features li::before {
  content: ""; position: absolute; left: 0; top: 12px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5' fill='none' stroke='%2334D399' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.lp-price-note { text-align: center; color: var(--ink-soft); font-size: .92rem; margin-top: 24px; }

/* faq */
.lp-faq { max-width: 820px; margin: 0 auto; }
.lp-faq details { border-bottom: 1px solid var(--line); }
.lp-faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-weight: 600; font-size: 1.08rem;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg); transition: transform .2s;
}
.lp-faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.lp-faq details p { color: var(--ink-soft); margin: 0 0 22px; max-width: 70ch; }

/* call to action finale */
.lp-final {
  background: linear-gradient(rgba(11, 18, 20, .86), rgba(16, 35, 32, .94)), var(--final-bg, none) center / cover, var(--surface);
  border: 1px solid var(--brand-line);
  color: var(--ink); border-radius: 24px; padding: 72px 48px; text-align: center; position: relative; overflow: hidden;
}
.lp-final h2 { color: var(--ink); font-size: clamp(1.8rem, 3.4vw, 2.5rem); max-width: 24ch; margin: 0 auto 12px; }
.lp-final p { color: var(--ink-soft); max-width: 56ch; margin: 0 auto 28px; font-size: 1.08rem; }

/* --- chat del sito -------------------------------------------------------- */
.chat { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 12px; pointer-events: none; }
.chat > * { pointer-events: auto; }
.chat-launcher {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-lg);
}
.chat-launcher:hover { background: var(--brand-hover); }
.chat-unread { position: absolute; top: 4px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.chat-panel {
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 110px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head strong { display: block; font-family: var(--font-display); }
.chat-sub { display: block; font-size: .8rem; color: var(--ink-soft); }
.chat-close { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; }
.chat-close:hover { background: var(--surface-2); color: var(--ink); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { margin: 0; max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: .93rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.bot, .chat-msg.admin { align-self: flex-start; background: var(--surface-2); color: var(--ink-2); border-bottom-left-radius: 4px; }
.chat-msg.admin { border: 1px solid var(--brand-line); }
.chat-msg.admin b { display: block; font-size: .75rem; color: var(--brand); margin-bottom: 2px; }
.chat-msg.visitor { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.chat-msg.system { align-self: center; max-width: 100%; padding: 4px 8px; font-size: .8rem; color: var(--ink-soft); text-align: center; }
.chat-typing { color: var(--ink-soft); font-style: italic; }
.chat-email { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--brand-soft); }
.chat-email p { margin: 0 0 8px; font-size: .85rem; color: var(--ink-2); }
.chat-email-row { display: flex; gap: 6px; }
.chat-email-row input { min-width: 0; padding: 8px 10px; }
.chat-email-row input[name=name] { flex: 0 1 34%; }
.chat-email-row .btn { min-height: 40px; padding: 0 14px; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px 6px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 44px; max-height: 120px; resize: none; padding: 10px 12px; }
.chat-form .btn { flex: none; width: 44px; padding: 0; }
.chat-form.is-busy .btn { opacity: .6; }
.chat-note { margin: 0; padding: 0 16px 10px; font-size: .75rem; color: var(--faint); }
.chat-note a { color: var(--faint); }
@media (max-width: 520px) {
  .chat { right: 12px; bottom: 12px; left: 12px; }
  .chat-panel { width: 100%; height: calc(100dvh - 96px); }
  .chat-launcher span { display: none; }
  .chat-launcher { width: 56px; min-height: 56px; padding: 0; justify-content: center; }
}

/* --- responsive ----------------------------------------------------------- */
@media (max-width: 960px) {
  .lp-hero .container, .lp-split, .lp-demo { grid-template-columns: 1fr; gap: 40px; }
  .lp-modes { grid-template-columns: 1fr; }
  .lp-arrow { transform: rotate(90deg); }
  .lp-trust { grid-template-columns: 1fr 1fr; }
  .lp-hero-visual { padding: 0; }
  .lp-hero-photo { aspect-ratio: 16 / 10; }
  .lp-hero-visual .lp-inbox { position: relative; width: auto; margin: -64px 16px 0; }
}
@media (max-width: 860px) {
  .grid-2, .grid-3, .pricing { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none; }
  .lp-steps { grid-template-columns: 1fr; gap: 32px; }
  .lp-steps li { padding: 0 0 0 64px; min-height: 44px; }
  .lp-steps li:not(:last-child)::after { display: none; }
  .lp-section { padding: 64px 0; }
}
@media (max-width: 720px) {
  .nav .nav-link { display: none; }
  .topbar.app .logo-full { display: none; }
  .topbar.app .logo .logo-mark { display: block; }
  .topbar.app .nav { overflow-x: auto; }
  .topbar .container { gap: 12px; }
  .lp-types, .lp-trust { grid-template-columns: 1fr; }
  .lp-final { padding: 48px 24px; border-radius: 18px; }
  .lp-hero { padding: 48px 0 64px; }
  .lp-ctas .btn { width: 100%; }
  .lp-banner { aspect-ratio: 16 / 10; }
  .lp-hero-visual::after { top: 12px; right: 12px; font-size: .75rem; }
  .price-card { padding: 28px 22px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 440px) {
  .logo .logo-full { display: none; }
  .logo .logo-mark { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* --- admin: social -------------------------------------------------------- */
.sp-row { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sp-row:last-child { border-bottom: 0; }
.sp-row:hover .sp-when { color: var(--brand); }
.sp-thumb { flex: none; width: 72px; height: 90px; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-size: .72rem; color: var(--ink-soft); text-align: center; }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-when { font-weight: 600; }
.sp-caption { color: var(--ink-2); font-size: .92rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sp-steps { padding-left: 20px; display: grid; gap: 10px; }
.sp-steps code { overflow-wrap: anywhere; }
.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.sp-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.sp-media figure { margin: 0; }
.sp-media img, .sp-media video { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; background: var(--bg); }
.sp-media figcaption { margin-top: 6px; }
.sp-media .btn.ghost { min-height: 32px; padding: 4px 8px; font-size: .82rem; }
.sp-upload { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sp-upload input[type=file] { margin: 4px 0 10px; color: var(--ink-soft); }
.sp-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sp-graphic { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.sp-graphic summary { cursor: pointer; font-weight: 600; }
.sp-graphic[open] summary { margin-bottom: 12px; }
.sp-rewrite { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
@media (max-width: 860px) { .sp-layout { grid-template-columns: 1fr; } }

/* --- reassist.it: consulenze ---------------------------------------------- */
/* Fondo chiaro per il sito di REAssist (Segreteria Digitale resta scura): stessi nomi, altri valori. */
.theme-light {
  color-scheme: light;
  --bg: #F6F8F7;
  --surface: #FFFFFF;
  --surface-2: #EDF3F0;
  --ink: #0F1A17;
  --ink-2: #26342F;
  --ink-soft: #52615C;
  --faint: #6B7A75;
  --line: #E1E8E4;
  --line-strong: #C9D4CF;
  --brand: #0B7A55;
  --brand-hover: #096646;
  --brand-ink: #FFFFFF;
  --brand-soft: #E2F4EC;
  --brand-line: #B5E0CD;
  --accent: #A85A12;
  --accent-soft: #FBEBD9;
  --ok: #1D6B43;   --ok-bg: #E2F2E8;
  --info: #1E5A8F; --info-bg: #E4EDF7;
  --warn: #7D5200; --warn-bg: #FBF0D6;
  --err: #A12A2A;  --err-bg: #FAE4E4;
  --muted: #646D6B; --muted-bg: #ECEBE6;
  --shadow: 0 1px 2px rgba(15, 26, 23, .05), 0 6px 20px rgba(15, 26, 23, .06);
  --shadow-lg: 0 2px 4px rgba(15, 26, 23, .05), 0 24px 48px -12px rgba(15, 26, 23, .18);
}
.theme-light .ra-summary { box-shadow: var(--shadow-lg); }
.ra-wordmark { font: 700 1.5rem var(--font-display); letter-spacing: -.03em; color: var(--ink); text-decoration: none; }
.ra-wordmark b { color: var(--brand); font-weight: 700; }
.ra-hero { padding: 48px 0 32px; max-width: 820px; }
.ra-hero h1 { font-size: clamp(2.8rem, 7vw, 4.8rem); line-height: 1.05; letter-spacing: -.03em; margin-bottom: 18px; }
.ra-hero h1 em { font-style: normal; color: var(--brand); }
.ra-hero .lp-lead { margin-bottom: 26px; }
.ra-section { padding: 36px 0; }
.ra-splash { min-height: calc(100vh - 220px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 64px 0; }
.ra-splash-mark { margin: 12px 0 0; font: 700 1.6rem var(--font-display); letter-spacing: -.03em; color: var(--ink); }
.ra-splash-mark b { color: var(--brand); }
.ra-splash h1 { font-size: clamp(2.8rem, 8vw, 5.2rem); line-height: 1.02; letter-spacing: -.035em; margin: 0; }
.ra-splash h1 em { font-style: normal; color: var(--brand); }
.ra-splash .lp-lead { max-width: 56ch; }
.ra-splash .lp-ctas { justify-content: center; }
.ra-topics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ra-topics .card { margin: 0; }
.ra-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 0; padding-left: 20px; color: var(--ink-2); }
.ra-prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 12px; }
.ra-price-card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ra-price-card.featured { border: 2px solid var(--brand); }
.ra-price-card p { margin: 4px 0 0; }
.ra-price-time { font-weight: 600; color: var(--ink-2); }
.ra-price-card .ra-price { font-size: 2.4rem; line-height: 1.1; }
.ra-booking { display: grid; gap: 20px; }
.ra-step { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0; background: var(--surface); min-width: 0; }
.ra-step legend { padding: 0 6px; font-weight: 700; font-family: var(--font-display); font-size: 1.1rem; }
.ra-durations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ra-choice input, .ra-day input, .ra-slot input { position: absolute; opacity: 0; }
.ra-choice > span { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.ra-price { font: 700 1.5rem var(--font-display); color: var(--ink); }
.ra-price small { font: 500 .85rem var(--font-sans); color: var(--ink-soft); }
.ra-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.ra-day > span { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 8px 6px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; line-height: 1.2; }
.ra-day strong { font: 700 1.3rem var(--font-display); }
.ra-day small { color: var(--ink-soft); font-size: .75rem; }
.ra-slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.ra-slot > span { display: block; text-align: center; padding: 9px 0; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-variant-numeric: tabular-nums; }
.ra-choice input:checked + span, .ra-day input:checked + span, .ra-slot input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.ra-day input:checked + span small { color: var(--brand); }
.ra-choice input:focus-visible + span, .ra-day input:focus-visible + span, .ra-slot input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ra-sub { margin: 8px 0 12px; font-size: 1rem; }
.ra-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0; position: sticky; bottom: 12px; border-color: var(--brand-line); }
.ra-summary-text { font-weight: 600; }
.ra-summary .btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 860px) { .ra-topics, .ra-steps, .ra-durations, .ra-prices { grid-template-columns: 1fr; } }
