/* ==========================================================
   NODALIS SOFTWARE - style.css
   1. Variabili  2. Base  3. Componenti  4. Sezioni  5. Responsive
   ========================================================== */

/* ---------- 1. VARIABILI ---------- */
:root {
  --bg: #f5f7fa;            /* sfondo chiaro */
  --surface: #ffffff;
  --ink: #0f1b2d;           /* blu notte */
  --slate: #334155;         /* ardesia */
  --muted: #5b6b80;
  --line: #dde3ec;
  --blue: #1d4ed8;          /* blu elettrico */
  --blue-dark: #1e40af;
  --emerald: #10b981;       /* verde smeraldo */
  --emerald-dark: #059669;
  --danger: #c0262d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,27,45,.06), 0 12px 32px -12px rgba(15,27,45,.18);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 72px;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body { margin: 0; font-family: var(--font); color: var(--slate); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.1rem; letter-spacing: 0; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
img, svg { max-width: 100%; }
.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.lead { font-size: 1.15rem; max-width: 56ch; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--emerald); outline-offset: 3px; border-radius: 6px; }

/* ---------- 3. COMPONENTI ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .8rem 1.4rem; border-radius: 10px; border: 2px solid transparent; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .15s, background .2s, color .2s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn--sm { padding: .55rem 1.1rem; font-size: .95rem; }
.btn--lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px -8px rgba(29,78,216,.7); }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--outline { width: 100%; background: transparent; color: var(--blue); border-color: var(--blue); }
.btn--outline:hover { background: var(--blue); color: #fff; }
.btn--accent { background: var(--emerald); color: #04231a; box-shadow: 0 10px 26px -10px rgba(16,185,129,.8); }
.btn--accent:hover { background: #34d399; }

/* Navbar */
.navbar { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h); background: rgba(245,247,250,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.navbar.is-scrolled { box-shadow: 0 6px 24px -14px rgba(15,27,45,.3); }
.navbar__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.3rem; color: var(--blue); text-decoration: none; letter-spacing: -.02em; }
.logo { color: var(--ink); }
.logo svg { color: var(--blue); }
.nav-menu { display: flex; align-items: center; gap: 1.8rem; }
.nav-menu a:not(.btn) { color: var(--slate); text-decoration: none; font-weight: 550; position: relative; }
.nav-menu a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 2px; background: var(--emerald); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.nav-menu a:not(.btn):hover::after { transform: scaleX(1); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; flex-direction: column; justify-content: center; gap: 6px; align-items: center; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- 4. SEZIONI ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section__head { max-width: 640px; margin-bottom: 3rem; }
.section__head p { color: var(--muted); font-size: 1.1rem; }

/* Hero */
.hero { padding: calc(var(--nav-h) + clamp(3rem, 7vw, 6rem)) 0 clamp(3rem, 7vw, 6rem); background: radial-gradient(900px 420px at 85% 10%, rgba(29,78,216,.10), transparent 70%), var(--bg); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 4rem; align-items: center; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; margin: 2rem 0; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 1.2rem 2.4rem; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .95rem; }
.hero__facts strong { display: block; font-size: 1.6rem; color: var(--ink); }

/* Mockup (unico momento di animazione "d'ingresso": il grafico si disegna) */
.mockup { position: relative; background: var(--ink); border-radius: 18px; padding: 0 0 14px; box-shadow: 0 30px 60px -25px rgba(15,27,45,.6); transform: rotate(-1.5deg); }
.mockup__bar { display: flex; gap: 6px; padding: 12px 14px; }
.mockup__bar i { width: 10px; height: 10px; border-radius: 50%; background: #3b4a63; }
.mockup__body { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 0 14px; }
.mockup__side { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.mockup__side b { height: 30px; border-radius: 8px; background: #22314a; }
.mockup__side b:first-child { background: var(--blue); }
.mockup__main { display: grid; gap: 12px; }
.mockup__kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mockup__kpis span { height: 54px; border-radius: 10px; background: #1a2840; border-left: 3px solid var(--emerald); }
.mockup__kpis span:nth-child(2) { border-color: var(--blue); }
.mockup__chart { background: #1a2840; border-radius: 10px; padding: 10px; }
.mockup__chart svg { display: block; width: 100%; height: 130px; }
.mockup .area { fill: rgba(16,185,129,.18); }
.mockup .line { fill: none; stroke: var(--emerald); stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.8s .3s ease-out forwards; }
.mockup__rows { display: grid; gap: 8px; }
.mockup__rows span { height: 14px; border-radius: 6px; background: #22314a; }
.mockup__rows span:nth-child(2) { width: 80%; } .mockup__rows span:nth-child(3) { width: 60%; }
.mockup__badge { position: absolute; right: -14px; bottom: 34px; background: var(--surface); color: var(--ink); font-weight: 650; font-size: .9rem; padding: .6rem 1rem; border-radius: 10px; box-shadow: var(--shadow); animation: float 5s ease-in-out infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float { 50% { transform: translateY(-8px); } }

/* Card prodotti */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--blue); }
.card__icon { width: 52px; height: 52px; color: var(--blue); margin-bottom: 1.2rem; }
.card p { color: var(--muted); font-size: .96rem; }
.card ul { list-style: none; padding: 0; margin: 0 0 1.6rem; flex: 1; font-size: .94rem; }
.card li { position: relative; padding: .35rem 0 .35rem 1.6rem; border-top: 1px solid var(--line); }
.card li::before { content: ""; position: absolute; left: 0; top: .78rem; width: 12px; height: 7px; border-left: 2.5px solid var(--emerald); border-bottom: 2.5px solid var(--emerald); transform: rotate(-45deg); }

/* Assistenza (blocco scuro) */
.support { background: var(--ink); color: #c5d0e0; padding: clamp(4rem, 8vw, 6rem) 0; }
.support h2 { color: #fff; }
.support .lead { color: #aab8cc; }
.support__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.download { margin-top: 2rem; }
.download__os { margin: 1rem 0 .2rem; font-size: .92rem; color: #8fa0b8; }
.download__alt { color: var(--emerald); font-weight: 600; font-size: .95rem; }
.download.is-mac .download__alt { font-size: 1.05rem; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: step; position: relative; padding: 1.2rem 1.3rem 1.2rem 4.2rem; background: #16263f; border: 1px solid #243653; border-radius: var(--radius); }
.steps li::before { content: counter(step); position: absolute; left: 1.3rem; top: 1.2rem; width: 34px; height: 34px; border-radius: 50%; background: var(--emerald); color: #04231a; font-weight: 800; display: grid; place-items: center; }
.steps h3 { color: #fff; margin-bottom: .3rem; }
.steps p { margin: 0; font-size: .95rem; }
.steps code { background: #0b1626; padding: .1em .4em; border-radius: 4px; color: var(--emerald); }

/* Form demo */
.demo__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 4rem; align-items: start; }
.demo__intro { position: sticky; top: calc(var(--nav-h) + 2rem); }
.demo__intro p { color: var(--muted); }
.ticks { list-style: none; padding: 0; display: grid; gap: .6rem; }
.ticks li { padding-left: 1.7rem; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--emerald-dark); font-weight: 800; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: var(--shadow); display: grid; gap: 1.1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; color: var(--ink); font-size: .95rem; }
.field input, .field select, #nl-email { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .75rem .9rem; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field select:focus, #nl-email:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29,78,216,.15); }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.error { color: var(--danger); font-size: .85rem; min-height: 0; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--blue); flex: none; }
.success { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem 1.2rem; border-radius: 12px; background: #e8faf3; border: 1.5px solid var(--emerald); color: #064e3b; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.success[hidden] { display: none; }
.success svg { flex: none; width: 30px; height: 30px; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }

/* Footer */
.footer { background: #0a1424; color: #9fb0c6; padding: 4rem 0 2rem; }
.footer h2, .footer h3 { color: #fff; }
.footer a { color: #c5d0e0; text-decoration: none; }
.footer a:hover { color: var(--emerald); }
.newsletter { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; background: linear-gradient(135deg, #12284a, #0f3a3a); border: 1px solid #25406a; border-radius: 20px; padding: clamp(1.6rem, 4vw, 2.6rem); margin-bottom: 3rem; }
.newsletter h2 { font-size: 1.6rem; }
.newsletter p { margin: 0; }
.newsletter__row { display: flex; gap: .6rem; }
.newsletter__row input { flex: 1; min-width: 0; }
#nl-feedback { display: block; min-height: 1.4em; margin-top: .6rem; font-weight: 600; }
#nl-feedback.ok { color: #6ee7b7; } #nl-feedback.ko { color: #fca5a5; }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; font-size: .95rem; }
.footer__copy { margin: 3rem 0 0; padding-top: 1.5rem; border-top: 1px solid #1b2b44; font-size: .85rem; }

/* ---------- 5. RESPONSIVE ---------- */
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .hero__grid, .support__grid, .demo__grid, .newsletter { grid-template-columns: 1fr; gap: 2.5rem; }
  .demo__intro { position: static; }
  .mockup { max-width: 520px; }
  .nav-toggle { display: flex; }
  .nav-menu { position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.25rem; transform: translateY(-12px); opacity: 0; visibility: hidden; transition: .25s; }
  .nav-menu.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav-menu a:not(.btn) { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .nav-menu .btn { margin-top: 1rem; }
}
@media (max-width: 600px) {
  .grid-4, .row, .footer__cols { grid-template-columns: 1fr; }
  .newsletter__row { flex-direction: column; }
  .mockup__badge { right: 8px; }
}

/* Rispetto di chi preferisce meno animazioni */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mockup .line { stroke-dashoffset: 0; }
}

/* ==========================================================
   6. PRODOTTI E PAGINE PRODOTTO
   ========================================================== */
.card__img { width: 100%; height: auto; aspect-ratio: 800 / 520; object-fit: cover; border-radius: 10px; margin-bottom: 1.2rem; background: var(--line); }
.card__actions { display: grid; gap: .6rem; }

.crumbs { font-size: .92rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs a { color: var(--muted); }
.phero { padding: calc(var(--nav-h) + clamp(2.5rem, 6vw, 5rem)) 0 clamp(2.5rem, 6vw, 4.5rem); background: radial-gradient(800px 380px at 90% 0, rgba(29,78,216,.10), transparent 70%), var(--bg); }
.phero__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3.5rem; align-items: center; }
.phero__img { width: 100%; height: auto; border-radius: 18px; box-shadow: 0 30px 60px -28px rgba(15,27,45,.55); }

.split { display: grid; grid-template-columns: 1.4fr .8fr; gap: 3.5rem; align-items: start; }
.prose p { font-size: 1.08rem; max-width: 62ch; }
.ideal { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--emerald); border-radius: var(--radius); padding: 1.6rem; }
.ideal ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; }

.section--alt { background: var(--surface); border-block: 1px solid var(--line); }
.features { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature { padding: 1.4rem 0 0; border-top: 3px solid var(--blue); }
.feature p { color: var(--muted); margin: 0; }

.cta-band { background: var(--ink); color: #c5d0e0; text-align: center; padding: clamp(3rem, 7vw, 5rem) 0; }
.cta-band h2 { color: #fff; }
.cta-band p { max-width: 52ch; margin: 0 auto 1.6rem; }

.others { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.other { display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1rem 1.2rem; transition: border-color .2s, transform .2s; }
.other:hover { border-color: var(--blue); transform: translateY(-3px); }
.other img { width: 100%; height: auto; border-radius: 8px; margin-bottom: .8rem; }
.other p { margin: 0; color: var(--muted); font-size: .94rem; }

@media (max-width: 900px) {
  .phero__grid, .split { grid-template-columns: 1fr; gap: 2rem; }
  .features, .others { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) { .features, .others { grid-template-columns: 1fr; } }

/* ==========================================================
   7. INVIO MODULI (honeypot, errori, consenso newsletter)
   ========================================================== */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { padding: 1rem 1.2rem; border-radius: 12px; background: #fdecec; border: 1.5px solid var(--danger); color: #7a1218; font-weight: 600; }
.form-error[hidden] { display: none; }
.nl-consent { display: flex; gap: .6rem; align-items: flex-start; margin-top: .8rem; font-size: .85rem; color: #c5d0e0; cursor: pointer; }
.nl-consent input { flex: none; width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--emerald); }
.nl-consent a { color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ==========================================================
   8. LOGO, FEEDBACK E RITOCCHI
   ========================================================== */
.logo img { display: block; height: 58px; width: auto; }
.footer__logo { display: block; height: 64px; width: auto; margin-bottom: 1rem; }
.field textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .75rem .9rem; resize: vertical; min-height: 140px; transition: border-color .2s, box-shadow .2s; }
.field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29,78,216,.15); }
.field.has-error textarea { border-color: var(--danger); }
.optional { font-weight: 400; color: var(--muted); }
.card li.more { font-weight: 600; color: var(--ink); }
.hero .lead strong { color: var(--ink); }

/* ==========================================================
   9. PAGINE LEGALI (Privacy e Cookie Policy)
   ========================================================== */
.legal-hero { padding: calc(var(--nav-h) + clamp(2rem, 5vw, 3.5rem)) 0 1rem; background: var(--bg); }
.legal-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .3rem; }
.legal { max-width: 780px; }
.legal h2 { font-size: 1.25rem; margin: 2.2rem 0 .6rem; }
.legal p, .legal li { font-size: 1.02rem; }
.legal ul { padding-left: 1.2rem; display: grid; gap: .7rem; }
.todo { background: #fff3bf; border-radius: 4px; padding: 0 .3em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.legal-hero + .section { padding-top: 1.5rem; }

/* Immagine della pagina iniziale */
.hero__art { display: block; width: 100%; height: auto; border-radius: 28px; box-shadow: 0 30px 60px -28px rgba(15,27,45,.55); }
