/* ==========================================================================
   Erreci di Roberto Calzone — foglio di stile unico
   Nessuna dipendenza esterna: font di sistema, icone come entità HTML.
   ========================================================================== */

/* 1. Variabili ----------------------------------------------------------- */

:root {
    --ink: #0b2545;
    --ink-2: #13315c;
    --ink-3: #1c3f6e;
    --accent: #5bc0be;
    --accent-strong: #3a9d9b;

    --surface: #ffffff;
    --surface-alt: #f4f6f9;
    --surface-sunken: #eef2f7;

    --text: #1b2430;
    --text-muted: #5a6675;
    --text-on-ink: #eaf2fb;
    --text-on-ink-muted: #a8bcd4;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 6px 20px rgba(11, 37, 69, .06);
    --shadow-hover: 0 2px 4px rgba(11, 37, 69, .08), 0 14px 32px rgba(11, 37, 69, .12);

    --container: 1120px;
    --header-h: 72px;

    --space-1: .35rem;
    --space-2: .75rem;
    --space-3: 1.25rem;
    --space-4: 2rem;
    --space-5: 3rem;
    --space-6: 4.5rem;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* 2. Reset --------------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
    /* Impedisce che le ancore finiscano sotto l'header sticky. */
    scroll-padding-top: calc(var(--header-h) + var(--space-3));
    -webkit-text-size-adjust: 100%;
}

body,
h1, h2, h3, h4,
p, ul, ol, dl, dd, figure {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

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

a {
    color: inherit;
}

/* 3. Base ---------------------------------------------------------------- */

body {
    font-family: var(--font);
    font-size: clamp(1rem, .97rem + .15vw, 1.0625rem);
    line-height: 1.65;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    /* Nessuno scorrimento orizzontale, a nessuna larghezza. */
    overflow-x: hidden;
}

h1, h2, h3 {
    line-height: 1.2;
    letter-spacing: -.015em;
    font-weight: 700;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2rem, 1.4rem + 2.9vw, 3.4rem);
}

h2 {
    font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.35rem);
}

h3 {
    font-size: 1.15rem;
}

p {
    text-wrap: pretty;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1.1rem, 4vw, 2rem);
}

.section {
    padding-block: clamp(var(--space-5), 7vw, var(--space-6));
}

.section-alt {
    background: var(--surface-alt);
    border-block: 1px solid var(--border);
}

.eyebrow {
    margin-bottom: var(--space-2);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.section-intro {
    max-width: 65ch;
    margin-top: var(--space-3);
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* 4. Accessibilità ------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: var(--space-2) var(--space-3);
    background: var(--accent);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
    left: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

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

/* 5. Header -------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--ink);
    color: var(--text-on-ink);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--ink);
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .02em;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 1.15rem;
    letter-spacing: -.01em;
}

.brand-text small {
    font-size: .72rem;
    color: var(--text-on-ink-muted);
    letter-spacing: .02em;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.main-nav a {
    position: relative;
    display: block;
    padding: .55rem .9rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: .95rem;
    font-weight: 500;
    color: var(--text-on-ink);
    transition: background-color .18s ease, color .18s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: .9rem;
    right: .9rem;
    bottom: .3rem;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, .07);
}

.main-nav a:hover::after {
    transform: scaleX(1);
}

/* 6. Toggle menu mobile -------------------------------------------------- */

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
}

/* Hamburger disegnato in CSS: barra centrale + due pseudo-elementi. */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 20px;
    height: 2px;
    margin-inline: auto;
    background: var(--text-on-ink);
    border-radius: 2px;
    transition: transform .22s ease, opacity .18s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: "";
    position: relative;
}

.nav-toggle-bars::before {
    top: -6px;
}

.nav-toggle-bars::after {
    top: 4px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
    top: 0;
    transform: translateY(1px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
    top: -2px;
    transform: translateY(-1px) rotate(-45deg);
}

/* 7. Hero ---------------------------------------------------------------- */

.hero {
    position: relative;
    background:
        radial-gradient(1000px 460px at 78% -12%, rgba(91, 192, 190, .22), transparent 62%),
        linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
    color: var(--text-on-ink);
    padding-block: clamp(var(--space-5), 9vw, 7rem);
    overflow: hidden;
}

/* Il limite di misura va sui figli, non sul contenitore: se lo si mette su
   .hero-inner (che è anche .container, con margin-inline:auto) il blocco si
   centra e l'hero non risulta più allineato all'header. In `ch` il limite
   scala con la dimensione del testo, quindi il titolo resta ampio. */
.hero-inner > * {
    max-width: 62ch;
}

.hero .eyebrow {
    color: var(--accent);
}

.hero .lead {
    margin-top: var(--space-3);
    font-size: clamp(1.05rem, 1rem + .35vw, 1.2rem);
    color: var(--text-on-ink-muted);
    max-width: 56ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .93rem;
    color: var(--text-on-ink-muted);
}

.hero-points li {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.hero-points li::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--accent);
}

/* 8. Bottoni ------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .8rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    font-size: .97rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease,
                transform .18s ease, box-shadow .18s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--ink);
}

.btn-primary:hover {
    background: #6fd0ce;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(91, 192, 190, .28);
}

.btn-ghost {
    border-color: rgba(255, 255, 255, .32);
    color: var(--text-on-ink);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .5);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* 9. Card servizi -------------------------------------------------------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.card {
    padding: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-strong);
}

.card-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: var(--space-2);
    border-radius: 12px;
    background: rgba(91, 192, 190, .16);
    font-size: 1.35rem;
    line-height: 1;
}

.card h3 {
    margin-bottom: .5rem;
}

.card p {
    color: var(--text-muted);
    font-size: .97rem;
}

/* 10. Metodo (steps) ----------------------------------------------------- */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
    counter-reset: step;
}

.step {
    padding: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.step-num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: var(--space-2);
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
}

.step h3 {
    margin-bottom: .4rem;
    font-size: 1.05rem;
}

.step p {
    color: var(--text-muted);
    font-size: .94rem;
}

/* 11. Split (sezione Azienda) -------------------------------------------- */

.split {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: clamp(var(--space-4), 5vw, var(--space-5));
    align-items: start;
}

.split-main > p {
    margin-top: var(--space-3);
    color: var(--text-muted);
    max-width: 62ch;
}

.split-side {
    padding: var(--space-3);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.split-side h3 {
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-strong);
    font-size: 1rem;
    letter-spacing: .01em;
}

.data-list > div {
    padding-block: .7rem;
    border-bottom: 1px solid var(--border);
}

.data-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.data-list dt {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.data-list dd {
    margin-top: .15rem;
    font-size: .97rem;
}

/* 12. Footer ------------------------------------------------------------- */

.site-footer {
    background: var(--ink);
    color: var(--text-on-ink);
    padding-block: var(--space-4);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.footer-brand strong {
    font-size: 1rem;
}

.footer-brand p {
    font-size: .82rem;
    color: var(--text-on-ink-muted);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.footer-nav a {
    font-size: .92rem;
    text-decoration: none;
    color: var(--text-on-ink-muted);
    transition: color .18s ease;
}

.footer-nav a:hover {
    color: var(--accent);
}

/* Dati identificativi obbligatori (art. 7 D.lgs. 70/2003): devono restare
   leggibili, non nascosti in un carattere minuscolo. */
.footer-data {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    flex-basis: 100%;
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .87rem;
    font-style: normal;
    color: var(--text-on-ink-muted);
}

.footer-data strong {
    color: var(--text-on-ink);
    font-weight: 600;
}

.footer-data a {
    color: var(--text-on-ink-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .18s ease;
}

.footer-data a:hover {
    color: var(--accent);
}

.footer-legal {
    flex-basis: 100%;
    padding-top: var(--space-2);
    font-size: .82rem;
    color: var(--text-on-ink-muted);
}

/* 12-bis. Pagine di testo (informativa privacy) ------------------------- */

.main-nav-simple a {
    font-size: .92rem;
}

/* Come per .hero-inner: il limite di misura va sui figli, altrimenti il
   contenitore (che è anche .container, con margin-inline:auto) si centra e il
   testo non risulta più allineato al marchio nell'header. */
.legal > * {
    max-width: 78ch;
}

.legal h1 {
    font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem);
}

.legal h2 {
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.2rem;
}

.legal p {
    margin-bottom: var(--space-2);
    color: var(--text-muted);
}

.legal p strong {
    color: var(--text);
}

.legal a {
    color: var(--accent-strong);
    text-underline-offset: 2px;
}

.legal-updated {
    display: inline-block;
    margin-top: var(--space-3);
    padding: .35rem .8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-alt);
    font-size: .85rem;
}

.legal-list {
    margin-bottom: var(--space-3);
    padding-left: 1.1rem;
    color: var(--text-muted);
}

.legal-list li {
    position: relative;
    margin-bottom: .5rem;
    padding-left: .9rem;
}

.legal-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .65em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.legal-back {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

/* 13. Responsive --------------------------------------------------------- */

@media (max-width: 820px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        display: none;
        background: var(--ink-2);
        border-bottom: 1px solid rgba(255, 255, 255, .1);
        box-shadow: 0 18px 30px rgba(3, 15, 30, .35);
    }

    .main-nav.is-open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--space-2) clamp(1.1rem, 4vw, 2rem);
    }

    .main-nav a {
        padding: .85rem .25rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .main-nav li:last-child a {
        border-bottom: 0;
    }

    .main-nav a::after {
        display: none;
    }

    .header-inner {
        position: relative;
    }

    .split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .hero-actions .btn {
        flex: 1 1 100%;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* 14. Tema scuro --------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #0f1720;
        --surface-alt: #131d28;
        --surface-sunken: #0b131b;

        --text: #e6edf5;
        --text-muted: #9fb0c2;

        --border: #24313f;
        --border-strong: #33455a;

        --ink: #0a1628;
        --ink-2: #0f2038;

        --accent-strong: #5bc0be;

        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
        --shadow-hover: 0 2px 4px rgba(0, 0, 0, .45), 0 14px 32px rgba(0, 0, 0, .45);
    }

    .step-num {
        background: var(--accent);
        color: #06131f;
    }
}

/* 15. Movimento ridotto -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* 16. Stampa ------------------------------------------------------------- */

@media print {
    .site-header,
    .footer-nav,
    .skip-link,
    .hero-actions {
        display: none !important;
    }

    .hero,
    .site-footer {
        background: none !important;
        color: #000 !important;
    }

    .hero .lead,
    .hero-points,
    .footer-brand p,
    .footer-legal {
        color: #333 !important;
    }

    .card,
    .step,
    .split-side {
        break-inside: avoid;
        box-shadow: none !important;
    }
}
