/* ============================================================
   blueGrape CRM — design system
   Nessuna dipendenza esterna: font di sistema, CSS custom properties,
   tema chiaro/scuro con override manuale via [data-theme].
   ============================================================ */

/* ---------- 1. Token ---------- */
:root {
    color-scheme: light dark;

    --grape-50:  #f5f3ff;
    --grape-100: #ede9fe;
    --grape-200: #ddd6fe;
    --grape-400: #a78bfa;
    --grape-500: #8b5cf6;
    --grape-600: #7c3aed;
    --grape-700: #6d28d9;

    --blue-50:  #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-900: #172554;

    --ok-500: #10b981;
    --warn-500: #f59e0b;
    --err-500: #e11d48;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    --shell: min(1200px, 100% - 2.5rem);
    --shell-narrow: min(820px, 100% - 2.5rem);

    --step--1: clamp(.82rem, .8rem + .1vw, .89rem);
    --step-0:  clamp(1rem, .96rem + .18vw, 1.08rem);
    --step-1:  clamp(1.2rem, 1.12rem + .35vw, 1.4rem);
    --step-2:  clamp(1.45rem, 1.3rem + .7vw, 1.9rem);
    --step-3:  clamp(1.8rem, 1.5rem + 1.4vw, 2.6rem);
    --step-4:  clamp(2.2rem, 1.7rem + 2.4vw, 3.6rem);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Tema chiaro (default) */
:root,
:root[data-theme="light"] {
    --bg: #ffffff;
    --bg-soft: #f7f8fc;
    --bg-inset: #eef1f8;
    --surface: #ffffff;
    --surface-2: #f9fafc;
    --border: #e4e7f0;
    --border-strong: #ccd2e2;
    --text: #12172a;
    --text-soft: #4a5169;
    --text-mute: #6c7391;
    --brand: var(--blue-600);
    --brand-ink: var(--blue-700);
    --accent: var(--grape-600);
    --tint: var(--blue-50);
    --tint-2: var(--grape-50);
    --shadow-sm: 0 1px 2px rgba(18, 23, 42, .06), 0 1px 3px rgba(18, 23, 42, .05);
    --shadow: 0 4px 16px rgba(18, 23, 42, .07), 0 1px 3px rgba(18, 23, 42, .05);
    --shadow-lg: 0 24px 48px -18px rgba(18, 23, 42, .22);
    --header-bg: rgba(255, 255, 255, .82);
}

/* Tema scuro: preferenza di sistema, salvo scelta esplicita dell'utente */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0e1a;
        --bg-soft: #0e1424;
        --bg-inset: #131a2e;
        --surface: #111827;
        --surface-2: #151d31;
        --border: #232c44;
        --border-strong: #33405e;
        --text: #eef1f8;
        --text-soft: #b8c0d6;
        --text-mute: #8e97b3;
        --brand: #7ea6ff;
        --brand-ink: #a9c4ff;
        --accent: #b79dff;
        --tint: #131c33;
        --tint-2: #1a1633;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
        --shadow: 0 6px 20px rgba(0, 0, 0, .45);
        --shadow-lg: 0 28px 56px -20px rgba(0, 0, 0, .7);
        --header-bg: rgba(10, 14, 26, .8);
    }
}

:root[data-theme="dark"] {
    --bg: #0a0e1a;
    --bg-soft: #0e1424;
    --bg-inset: #131a2e;
    --surface: #111827;
    --surface-2: #151d31;
    --border: #232c44;
    --border-strong: #33405e;
    --text: #eef1f8;
    --text-soft: #b8c0d6;
    --text-mute: #8e97b3;
    --brand: #7ea6ff;
    --brand-ink: #a9c4ff;
    --accent: #b79dff;
    --tint: #131c33;
    --tint-2: #1a1633;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 28px 56px -20px rgba(0, 0, 0, .7);
    --header-bg: rgba(10, 14, 26, .8);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.18; font-weight: 700; letter-spacing: -.022em; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }
p  { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

a { color: var(--brand-ink); text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

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

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--brand); color: #fff; padding: .7rem 1.2rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- 3. Layout ---------- */
.shell { width: var(--shell); margin-inline: auto; }
.shell-narrow { width: var(--shell-narrow); margin-inline: auto; }

section { padding-block: clamp(3rem, 7vw, 6rem); }
section.tight { padding-block: clamp(2rem, 4vw, 3.5rem); }
.band-soft { background: var(--bg-soft); }
.band-inset { background: var(--bg-inset); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

@media (max-width: 640px) {
    .grid {
        gap: .9rem;
    }

    .section-head {
        margin-bottom: 1.6rem;
    }

    .lead {
        font-size: 1rem;
    }
}

.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* ---------- 4. Tipografia di servizio ---------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: var(--step--1); font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
    color: var(--accent); margin-bottom: .9rem;
}
.eyebrow::before { content: ""; width: 1.6rem; height: 2px; background: currentColor; border-radius: 2px; }
.eyebrow.no-rule::before { display: none; }

.lead { font-size: var(--step-1); color: var(--text-soft); line-height: 1.55; }
.muted { color: var(--text-mute); }
.small { font-size: var(--step--1); }
.gradient-text {
    background: linear-gradient(115deg, var(--blue-600), var(--grape-600) 65%, var(--grape-500));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="dark"] .gradient-text,
:root:not([data-theme="light"]) .gradient-text {
    background: linear-gradient(115deg, #8fb4ff, #c3aaff 70%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; }

/* ---------- 5. Bottoni ---------- */
.btn {
    --btn-bg: var(--brand);
    --btn-fg: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    padding: .78rem 1.4rem; border-radius: var(--radius-pill);
    font: inherit; font-weight: 600; font-size: var(--step-0);
    background: var(--btn-bg); color: var(--btn-fg);
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(115deg, var(--blue-600), var(--grape-600));
    box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--grape-600) 60%, transparent);
    color: #fff;
}
.btn-primary:hover { box-shadow: 0 12px 26px -8px color-mix(in srgb, var(--grape-600) 65%, transparent); }

.btn-ghost {
    background: transparent; color: var(--text); border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand-ink); }

.btn-quiet { background: transparent; color: var(--brand-ink); padding-inline: .4rem; }
.btn-quiet:hover { box-shadow: none; text-decoration: underline; }

.btn-sm { padding: .5rem 1rem; font-size: var(--step--1); }
.btn-lg { padding: .95rem 1.9rem; font-size: var(--step-1); }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* ---------- 6. Card ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.5rem; box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card h3 { margin-bottom: .45rem; }
.card p { color: var(--text-soft); }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.card-link .more { color: var(--brand-ink); font-weight: 600; font-size: var(--step--1); display: inline-flex; gap: .35rem; align-items: center; margin-top: .9rem; }
.card-link:hover .more { gap: .6rem; }

.icon-badge {
    width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--tint), var(--tint-2));
    color: var(--brand-ink); border: 1px solid var(--border); margin-bottom: 1rem; flex: none;
}
.icon-badge svg { width: 24px; height: 24px; }
.icon-badge.lg { width: 62px; height: 62px; border-radius: 18px; }
.icon-badge.lg svg { width: 30px; height: 30px; }

@media (max-width: 640px) {
    .card {
        border-radius: 12px;
        padding: 1.1rem;
    }

    .card p {
        font-size: .96rem;
    }

    .icon-badge {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        margin-bottom: .8rem;
    }

    .icon-badge svg {
        width: 21px;
        height: 21px;
    }
}

/* ---------- 7. Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 60;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.site-header .bar { display: flex; align-items: center; gap: 1rem; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 750; letter-spacing: -.02em; font-size: 1.12rem; }
.brand-mark { display: inline-flex; align-items: center; flex: none; }
.brand-mark img { display: block; height: 40px; width: auto; max-width: 100%; }
.brand-mark .only-dark { display: none; }
:root[data-theme="dark"] .brand-mark .only-dark { display: block; }
:root[data-theme="dark"] .brand-mark .only-light { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .brand-mark .only-dark { display: block; }
    :root:not([data-theme="light"]) .brand-mark .only-light { display: none; }
}
@media (max-width: 520px) { .brand-mark img { height: 32px; } }
.brand span i { font-style: normal; color: var(--accent); }

.nav { display: flex; align-items: center; gap: .15rem; margin-left: auto; }
.nav a, .nav button.navlink {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .5rem .8rem; border-radius: var(--radius-sm);
    color: var(--text-soft); text-decoration: none; font-weight: 550; font-size: .95rem;
    background: none; border: 0; font-family: inherit; cursor: pointer;
}
.nav a:hover, .nav button.navlink:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--brand-ink); background: var(--tint); }

.has-menu { position: relative; }
.dropdown {
    position: absolute; top: calc(100% + .5rem); left: 0; min-width: 560px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: .7rem; display: none; z-index: 70;
}
.dropdown.open { display: block; }
.dropdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem; }
.dropdown a {
    display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .7rem; border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text);
}
.dropdown a:hover { background: var(--surface-2); }
.dropdown a strong { display: block; font-size: .93rem; font-weight: 650; }
.dropdown a em { font-style: normal; display: block; font-size: .8rem; color: var(--text-mute); line-height: 1.4; }
.dropdown .mini-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--tint); color: var(--brand-ink); flex: none; margin-top: .1rem; }
.dropdown .mini-icon svg { width: 17px; height: 17px; }
.dropdown-foot { border-top: 1px solid var(--border); margin-top: .5rem; padding: .7rem .7rem .3rem; display: flex; justify-content: space-between; align-items: center; font-size: .87rem; }

.header-actions { display: flex; align-items: center; gap: .5rem; }

.lang-switch {
    width: 38px; height: 38px; border-radius: var(--radius-pill); display: grid; place-items: center;
    background: transparent; border: 1px solid var(--border); color: var(--text-soft);
    font-size: .78rem; font-weight: 750; text-decoration: none;
}
.lang-switch:hover { background: var(--surface-2); color: var(--text); }

.theme-toggle {
    width: 38px; height: 38px; border-radius: var(--radius-pill); display: grid; place-items: center;
    background: transparent; border: 1px solid var(--border); color: var(--text-soft); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .only-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .only-dark { display: block; }
:root[data-theme="dark"] .theme-toggle .only-light { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .only-dark { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .only-light { display: none; }
}
.nav .navlink svg { width: 14px; height: 14px; opacity: .6; }

.burger { display: none; width: 42px; height: 42px; border-radius: var(--radius-sm); background: transparent; border: 1px solid var(--border); color: var(--text); cursor: pointer; place-items: center; }
.burger svg { width: 22px; height: 22px; }

@media (max-width: 1080px) {
    .nav { display: none; }
    .burger { display: grid; }
    .header-actions .btn { display: none; }
}

.mobile-nav {
    display: none; border-top: 1px solid var(--border); background: var(--surface);
    padding: 1rem 0 1.6rem; max-height: min(78vh, 640px); overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: .65rem .2rem; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.mobile-nav .group-title { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin: 1.2rem 0 .3rem; font-weight: 650; }
.mobile-nav .btn { margin-top: 1.2rem; }

@media (max-width: 640px) {
    :root {
        --shell: min(100% - 1.25rem, 1200px);
        --shell-narrow: min(100% - 1.25rem, 820px);
    }

    section { padding-block: 2.7rem; }
    h1 { font-size: 2.05rem; }
    h2 { font-size: 1.7rem; }

    .site-header .bar {
        min-height: 60px;
        gap: .65rem;
    }

    .header-actions {
        gap: .35rem;
        margin-left: auto;
    }

    .lang-switch,
    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .burger {
        width: 38px;
        height: 38px;
    }

    .mobile-nav {
        padding: .65rem 0 1.2rem;
        max-height: calc(100vh - 60px);
    }

    .mobile-nav a {
        padding-block: .72rem;
    }
}

/* ---------- 8. Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 8vw, 7rem) clamp(3rem, 6vw, 5rem); }
.hero::before {
    content: ""; position: absolute; inset: -30% -10% auto -10%; height: 130%;
    background:
        radial-gradient(50% 45% at 18% 12%, color-mix(in srgb, var(--blue-500) 22%, transparent), transparent 70%),
        radial-gradient(45% 40% at 82% 8%, color-mix(in srgb, var(--grape-500) 20%, transparent), transparent 70%);
    pointer-events: none; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: 1.1rem; }
.hero .lead { max-width: 56ch; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--border); }
.hero-proof div strong { display: block; font-size: var(--step-2); font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.hero-proof div span { font-size: var(--step--1); color: var(--text-mute); }

.pill {
    display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem .35rem .45rem;
    border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border);
    font-size: var(--step--1); color: var(--text-soft); box-shadow: var(--shadow-sm); margin-bottom: 1.4rem;
}
.pill b { background: linear-gradient(115deg, var(--blue-600), var(--grape-600)); color: #fff; padding: .15rem .6rem; border-radius: var(--radius-pill); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; }

@media (max-width: 640px) {
    .hero {
        padding-block: 2.35rem 2.8rem;
    }

    .hero::before {
        inset: -18% -55% auto -55%;
        height: 85%;
    }

    .hero-grid {
        gap: 1.6rem;
    }

    .hero h1 {
        margin-bottom: .85rem;
    }

    .hero .lead {
        font-size: 1rem;
        line-height: 1.55;
    }

    .pill {
        display: flex;
        width: 100%;
        align-items: flex-start;
        border-radius: 18px;
        padding: .55rem .7rem;
        line-height: 1.35;
    }

    .pill b {
        flex: none;
        margin-top: .02rem;
    }

    .btn-row {
        width: 100%;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        min-height: 46px;
        padding-inline: 1rem;
        white-space: normal;
        text-align: center;
    }

    .btn-lg {
        padding: .82rem 1rem;
        font-size: 1rem;
    }

    .hero-proof {
        display: grid;
        grid-template-columns: 1fr;
        gap: .85rem;
        margin-top: 1.6rem;
        padding-top: 1.1rem;
    }

    .hero-proof div {
        display: grid;
        grid-template-columns: 3.5rem 1fr;
        gap: .75rem;
        align-items: center;
    }

    .hero-proof div strong {
        font-size: 1.35rem;
    }
}

/* ---------- 9. Mockup applicativo (SVG-free, puro CSS) ---------- */
.app-mock {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); overflow: hidden; font-size: .8rem;
}
.app-mock .mock-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem .9rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.app-mock .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.app-mock .mock-title { margin-left: .6rem; color: var(--text-mute); font-size: .76rem; }
.app-mock .mock-body { display: grid; grid-template-columns: 132px 1fr; min-height: 300px; }
.app-mock .mock-side { border-right: 1px solid var(--border); padding: .8rem .6rem; background: var(--surface-2); }
.app-mock .mock-side li { list-style: none; padding: .34rem .5rem; border-radius: 7px; color: var(--text-mute); font-size: .76rem; }
.app-mock .mock-side ul { margin: 0; padding: 0; }
.app-mock .mock-side li.on { background: var(--tint); color: var(--brand-ink); font-weight: 600; }
.app-mock .mock-main { padding: .9rem 1rem; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .8rem; }
.mock-kpi { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .6rem; }
.mock-kpi b { display: block; font-size: 1.15rem; line-height: 1.2; }
.mock-kpi span { font-size: .68rem; color: var(--text-mute); }
.mock-row { display: flex; align-items: center; gap: .5rem; padding: .45rem .1rem; border-bottom: 1px solid var(--border); font-size: .74rem; }
.mock-row:last-child { border-bottom: 0; }
.mock-tag { font-size: .64rem; padding: .1rem .45rem; border-radius: var(--radius-pill); font-weight: 650; letter-spacing: .02em; }
.tag-open { background: color-mix(in srgb, var(--warn-500) 18%, transparent); color: #b45309; }
.tag-run  { background: color-mix(in srgb, var(--blue-500) 18%, transparent); color: var(--blue-700); }
.tag-done { background: color-mix(in srgb, var(--ok-500) 18%, transparent); color: #047857; }
:root[data-theme="dark"] .tag-open { color: #fcd34d; }
:root[data-theme="dark"] .tag-run { color: #93c5fd; }
:root[data-theme="dark"] .tag-done { color: #6ee7b7; }
.mock-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-gantt { margin-top: .7rem; }
.mock-gantt .gr { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: .5rem; margin-bottom: .35rem; font-size: .68rem; color: var(--text-mute); }
.mock-gantt .track { background: var(--bg-inset); border-radius: var(--radius-pill); height: 10px; position: relative; }
.mock-gantt .bar { position: absolute; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--blue-500), var(--grape-500)); }

@media (max-width: 640px) {
    .app-mock {
        border-radius: 16px;
        font-size: .74rem;
    }

    .app-mock .mock-bar {
        padding: .6rem .7rem;
    }

    .app-mock .dot {
        width: 8px;
        height: 8px;
    }

    .app-mock .mock-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-mock .mock-body {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .app-mock .mock-side {
        display: none;
    }

    .app-mock .mock-main {
        padding: .75rem;
    }

    .mock-kpis {
        gap: .45rem;
    }

    .mock-kpi {
        padding: .45rem;
        min-width: 0;
    }

    .mock-kpi b {
        font-size: 1rem;
    }

    .mock-kpi span {
        display: block;
        line-height: 1.25;
    }

    .mock-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: .4rem;
        padding-block: .5rem;
    }

    .mock-row .muted {
        display: none;
    }

    .mock-gantt .gr {
        grid-template-columns: 68px 1fr;
        gap: .45rem;
    }
}

@media (max-width: 380px) {
    .mock-kpis {
        grid-template-columns: 1fr;
    }
}

/* ---------- 10. Elenchi funzionali ---------- */
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.15rem; }
.feature-list li { display: grid; grid-template-columns: 26px 1fr; gap: .85rem; align-items: start; }
.feature-list .tick {
    width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: .2rem;
    background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand-ink); flex: none;
}
.tick svg { width: 13px; height: 13px; }
.more svg { width: 15px; height: 15px; }
.chip svg { width: 15px; height: 15px; }
.btn svg { width: 17px; height: 17px; }
.feature-list strong { display: block; }
.feature-list p { margin: .2rem 0 0; color: var(--text-soft); font-size: .96rem; }

.pain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.pain-list li { display: grid; grid-template-columns: 20px 1fr; gap: .7rem; color: var(--text-soft); align-items: start; }
.pain-list .x { color: var(--err-500); font-weight: 700; line-height: 1.5; }

/* ---------- 11. Scenario / esempio ---------- */
.scenario {
    border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.scenario > header { padding: 1.25rem 1.5rem; background: linear-gradient(120deg, var(--tint), var(--tint-2)); border-bottom: 1px solid var(--border); }
.scenario > header .label { font-size: var(--step--1); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.scenario > header h3 { margin: .3rem 0 .35rem; font-size: var(--step-1); }
.scenario > header p { margin: 0; color: var(--text-soft); font-size: .95rem; }
.scenario .steps { list-style: none; counter-reset: st; margin: 0; padding: 1.4rem 1.5rem; display: grid; gap: .9rem; }
.scenario .steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; gap: .85rem; align-items: start; color: var(--text-soft); }
.scenario .steps li::before {
    content: counter(st); width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; font-size: .78rem; font-weight: 700;
    background: var(--bg-inset); color: var(--brand-ink); border: 1px solid var(--border);
}
.scenario .outcome {
    display: flex; gap: .7rem; align-items: flex-start;
    padding: 1rem 1.5rem 1.25rem; border-top: 1px dashed var(--border);
    background: var(--surface-2);
}
.scenario .outcome svg { width: 20px; height: 20px; color: var(--ok-500); flex: none; margin-top: .2rem; }
.scenario .outcome p { margin: 0; font-weight: 600; }

/* ---------- 12. Flusso ---------- */
.flow { display: flex; flex-wrap: wrap; gap: .55rem; align-items: stretch; }
.flow .node {
    flex: 1 1 150px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem; position: relative; box-shadow: var(--shadow-sm);
}
.flow .node b { display: block; font-size: .95rem; }
.flow .node span { font-size: .8rem; color: var(--text-mute); }
.flow .arrow { align-self: center; color: var(--text-mute); font-size: 1.1rem; }
@media (max-width: 720px) { .flow .arrow { transform: rotate(90deg); } .flow { flex-direction: column; } }

/* ---------- 13. Prezzi ---------- */
/* Interruttore annuale/mensile. Entrambi i prezzi sono resi dal server: il passaggio
   è puro CSS su [data-billing], così non c'è sfarfallio e senza JS resta l'annuale.
   Per lo stesso motivo l'interruttore compare solo quando il JS ha marcato la pagina. */
.billing { display: none; }
.js .billing { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.billing-switch { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); }
.billing-switch button {
    padding: .45rem 1.1rem; border-radius: var(--radius-pill); border: 0; background: transparent;
    font-family: inherit; font-size: .9rem; font-weight: 600; color: var(--text-soft); cursor: pointer;
}
.billing-switch button:hover { color: var(--text); }
.billing-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.billing-hint { margin: 0; }
.on-monthly { display: none; }
:root[data-billing="monthly"] .on-annual { display: none; }
:root[data-billing="monthly"] .on-monthly { display: inline; }

.plans { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.8rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; height: 100%; }
/* Con quattro piani lo shell da 1200px lascia ~265px a colonna: rientriamo il padding per non strozzare il testo. */
@media (min-width: 1100px) { .plan { padding: 1.5rem 1.35rem; } }
.plan.featured { border-color: color-mix(in srgb, var(--grape-600) 55%, var(--border)); box-shadow: var(--shadow-lg); position: relative; }
.plan.featured::after {
    content: "Più scelto"; position: absolute; top: -.75rem; left: 1.8rem;
    background: linear-gradient(115deg, var(--blue-600), var(--grape-600)); color: #fff;
    font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    padding: .28rem .8rem; border-radius: var(--radius-pill);
}
.plan h3 { margin-bottom: .2rem; }
.plan .audience { font-size: var(--step--1); color: var(--text-mute); margin-bottom: 1.1rem; }
.plan .price { font-size: var(--step-3); font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.plan .price-note { font-size: var(--step--1); color: var(--text-mute); margin-bottom: 1rem; }
.plan .summary { font-size: .93rem; color: var(--text-soft); padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.plan ul { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: .6rem; font-size: .92rem; flex: 1; }
.plan li { display: grid; grid-template-columns: 18px 1fr; gap: .6rem; align-items: start; }
.plan li svg { width: 15px; height: 15px; margin-top: .3rem; }
.plan li.yes svg { color: var(--ok-500); }
.plan li.no { color: var(--text-mute); }
.plan li.no svg { color: var(--text-mute); }

/* ---------- 14. FAQ ---------- */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
    cursor: pointer; list-style: none; padding: 1.1rem .2rem; font-weight: 620;
    display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); flex: none; transition: transform .2s var(--ease); }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 3rem 1.3rem .2rem; color: var(--text-soft); }
.faq-cat { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); font-weight: 650; margin: 2.2rem 0 .3rem; }
.faq-cat:first-child { margin-top: 0; }

/* ---------- 15. Form ---------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.4rem); box-shadow: var(--shadow); }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: .38rem; }
.field .hint { font-size: .82rem; color: var(--text-mute); font-weight: 400; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field select, .field textarea {
    width: 100%; padding: .72rem .9rem; font: inherit; font-size: .97rem;
    color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.field .validation-message, .validation-message { color: var(--err-500); font-size: .84rem; display: block; margin-top: .3rem; }
.field input.invalid, .field select.invalid, .field textarea.invalid { border-color: var(--err-500); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.check { display: grid; grid-template-columns: 20px 1fr; gap: .7rem; align-items: start; font-size: .9rem; color: var(--text-soft); }
.check input { width: 18px; height: 18px; margin-top: .2rem; accent-color: var(--brand); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-radius: var(--radius); padding: 1.1rem 1.3rem; display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1.4rem; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: .2rem; }
.alert-ok { background: color-mix(in srgb, var(--ok-500) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok-500) 35%, transparent); }
.alert-ok svg { color: var(--ok-500); }
.alert-warn { background: color-mix(in srgb, var(--warn-500) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn-500) 35%, transparent); }
.alert-warn svg { color: var(--warn-500); }
.alert p { margin: 0; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 16. CTA ---------- */
.cta-band {
    border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.4rem);
    background: linear-gradient(125deg, var(--blue-700), var(--grape-700));
    color: #fff; position: relative; overflow: hidden;
}
.cta-band::after {
    content: ""; position: absolute; right: -8%; top: -60%; width: 55%; aspect-ratio: 1;
    background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%); pointer-events: none;
}
.cta-band h2 { color: #fff; margin-bottom: .6rem; }
.cta-band p { color: rgba(255,255,255,.86); max-width: 58ch; }
.cta-band .btn-primary { background: #fff; color: var(--blue-700); box-shadow: none; }
.cta-band .btn-primary:hover { background: #f2f5ff; }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.cta-band .fineprint { font-size: var(--step--1); color: rgba(255,255,255,.72); margin-top: 1rem; }

@media (max-width: 640px) {
    .cta-band {
        border-radius: 16px;
        padding: 1.4rem;
    }

    .cta-band::after {
        display: none;
    }

    .cta-band h2 {
        font-size: 1.55rem;
    }

    .cta-band p {
        font-size: .98rem;
    }
}

/* ---------- 17. Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding-block: 3.5rem 2rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin-bottom: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer a { color: var(--text-soft); text-decoration: none; font-size: .93rem; }
.site-footer a:hover { color: var(--brand-ink); text-decoration: underline; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .85rem; color: var(--text-mute); }

/* ---------- 18. Breadcrumb & varie ---------- */
.crumbs { font-size: var(--step--1); color: var(--text-mute); margin-bottom: 1.2rem; }
.crumbs a { color: var(--text-mute); text-decoration: none; }
.crumbs a:hover { color: var(--brand-ink); text-decoration: underline; }
.crumbs span { margin: 0 .4rem; opacity: .6; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-size: .85rem; color: var(--text-soft); text-decoration: none; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.stat b { display: block; font-size: var(--step-2); font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: var(--step--1); color: var(--text-mute); }

.quote { border-left: 3px solid var(--accent); padding: .4rem 0 .4rem 1.3rem; font-size: var(--step-1); line-height: 1.5; }
.quote footer { font-size: var(--step--1); color: var(--text-mute); margin-top: .7rem; }

.prose h2 { margin-top: 2.4rem; font-size: var(--step-2); }
.prose h3 { margin-top: 1.8rem; }
.prose ul { display: grid; gap: .4rem; }
.prose li { color: var(--text-soft); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.cmp { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
table.cmp th, table.cmp td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
table.cmp thead th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); }
table.cmp tbody tr:last-child td { border-bottom: 0; }
table.cmp td.before { color: var(--text-mute); }
table.cmp td.after { font-weight: 600; }

@media (max-width: 640px) {
    .table-wrap {
        border-radius: 12px;
        margin-inline: -.15rem;
        -webkit-overflow-scrolling: touch;
    }

    table.cmp {
        min-width: 700px;
        font-size: .86rem;
    }

    table.cmp th,
    table.cmp td {
        padding: .68rem .75rem;
        vertical-align: top;
    }
}

.anchor-nav { display: flex; flex-wrap: wrap; gap: .4rem; padding: .8rem 0; border-block: 1px solid var(--border); position: sticky; top: 68px; background: var(--header-bg); backdrop-filter: blur(12px); z-index: 40; }
.anchor-nav a { font-size: .86rem; padding: .3rem .75rem; border-radius: var(--radius-pill); color: var(--text-soft); text-decoration: none; }
.anchor-nav a:hover { background: var(--surface-2); color: var(--text); }

/* L'animazione di ingresso è progressive enhancement: senza JS il contenuto
   resta visibile (la classe .js viene aggiunta dallo script inline nell'head). */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* Blazor: errore di connessione */
#blazor-error-ui {
    color-scheme: light;
    background: #fff3cd; color: #664d03; bottom: 0; display: none; left: 0; position: fixed;
    width: 100%; z-index: 1000; padding: .8rem 1.2rem; box-shadow: 0 -1px 6px rgba(0,0,0,.2);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .8rem; }
