/* ---- Header home: slider Klarna + gestionale + CRM ---- */
.hs-stage {
    --hs-ink: #120E1F;
    --hs-orange: #FF4E00;
    --hs-orange-dk: #E04400;
    /* 77px = altezza della navbar fixed-top. Niente misura via JS: finché style.css (async) non è
       applicato la navbar risulta alta fino a ~460px, e AOS salva le soglie a DOMContentLoaded
       → le animazioni sotto (es. box migrazione) partivano centinaia di px in ritardo */
    padding: 77px 20px 22px;
    max-width: 1240px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    color: var(--hs-ink);
}

.hs-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 36px;
}

.hs-track {
    display: flex;
    align-items: flex-start;
    transition: transform .7s cubic-bezier(.65, 0, .35, 1);
}

.hs-sl {
    flex: 0 0 100%;
    min-width: 0;
}

.hs-slide {
    position: relative;
    /* altezza = larghezza del banner / 1.875 (rapporto della foto gestionale): la foto copre sempre tutto il banner */
    height: clamp(520px, calc((100vw - 40px) / 1.875), 640px);
    display: flex;
    align-items: center;
    padding: 64px 72px;
    overflow: hidden;
    border-radius: 36px;
}

.hs-slide.hs-g {
    background: #A2A6A1;
}

.hs-slide.hs-k {
    background: #C8C9C3;
}

/* stessa sfumatura del fondo della foto CRM: resta sotto la foto se il banner è più largo */
.hs-slide.hs-c {
    background: linear-gradient(90deg, #C1BBA5, #C1C8C5);
}

.hs-media {
    position: absolute;
    inset: 0;
}

.hs-photo {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
}

.hs-g .hs-photo {
    aspect-ratio: 2500 / 1333;
}

.hs-c .hs-photo {
    aspect-ratio: 1845 / 920;
}

.hs-k .hs-photo {
    aspect-ratio: 1000 / 1030;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%);
    mask-image: linear-gradient(90deg, transparent 0, #000 16%);
}

.hs-photo > img,
.hs-photo > svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    display: block;
}

.hs-copy {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 26px;
    justify-items: start;
}

.hs-g .hs-copy,
.hs-c .hs-copy {
    max-width: min(520px, 46%);
}

.hs-k .hs-copy {
    max-width: min(600px, 52%);
}

.hs-h1 {
    margin: 0;
    display: grid;
    gap: 18px;
}

.hs-eyebrow {
    font-family: 'Poppins-Medium', sans-serif;
    font-size: .82rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    line-height: 1.5;
    max-width: 34ch;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hs-eyebrow img {
    height: 22px;
    width: auto;
}

.hs-title {
    margin: 0;
    font-family: 'Poppins-Bold', sans-serif;
    font-size: clamp(2.8rem, 4.9vw, 4.4rem);
    line-height: .98;
    letter-spacing: -.04em;
    color: var(--hs-ink);
    text-wrap: balance;
}

.hs-sub {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.55;
    color: #15171C;
    max-width: 44ch;
}

.hs-c .hs-title {
    font-size: clamp(2.6rem, 4.6vw, 4.1rem);
}

.hs-title em {
    font-style: normal;
    color: var(--hs-orange);
}

.hs-sub s {
    color: #5A5F6B;
    text-decoration-thickness: 2px;
}

.hs-cta,
.hs-cta:hover,
.hs-cta:focus {
    display: inline-flex;
    align-items: center;
    background: var(--hs-orange);
    color: #FFFFFF;
    font-family: 'Poppins-Medium', sans-serif;
    font-size: 18px;
    padding: 15px 28px;
    border-radius: 999px;
    text-decoration: none;
    transition: background .2s;
}

.hs-cta:hover {
    background: var(--hs-orange-dk);
}

.hs-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hs-cta2,
.hs-cta2:hover,
.hs-cta2:focus {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--hs-ink);
    font-family: 'Poppins-Medium', sans-serif;
    font-size: 18px;
    /* 1.5px di bordo tolti dal padding: stessa altezza di .hs-cta */
    padding: 13.5px 26.5px;
    border: 1.5px solid var(--hs-ink);
    border-radius: 999px;
    text-decoration: none;
    transition: background .2s;
}

.hs-cta2:hover {
    background: rgba(18, 14, 31, .06);
}

/* Schermo del tablet (slide CRM): livello piatto 900x960 proiettato sui 4 angoli dello schermo nella foto
   (1010,205 · 1483,146 · 1590,652 · 1094,727 su 1845x920). --hs-k = larghezza reale / 1845, dal JS della home:
   senza JS resta scale(0), cioè nascosto, e si vede solo la foto */
.hs-scr {
    position: absolute;
    left: 0;
    top: 0;
    width: 900px;
    height: 960px;
    transform-origin: 0 0;
    transform: scale(var(--hs-k, 0)) matrix3d(0.565070259, -0.0616653689, 0, 2.66451138e-05, 0.0287610859, 0.504716005, 0, -5.36918776e-05, 0, 0, 1, 0, 1010, 205, 0, 1);
}

.hs-scr img {
    position: absolute;
    max-width: none;
    display: block;
}

.hs-kp {
    opacity: 0;
    transform: translateY(34px);
}

.hs-ln {
    clip-path: inset(0 100% 0 0);
}

.hs-br {
    transform: scaleY(0);
    transform-origin: 50% 100%;
}

.hs-photo.in .hs-kp {
    opacity: 1;
    transform: none;
    transition: opacity .5s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}

/* nth-of-type conta tutte le img dello schermo: 1-4 card, 5 grafico, 6-12 barre */
.hs-photo.in .hs-kp:nth-of-type(2) { transition-delay: .1s; }
.hs-photo.in .hs-kp:nth-of-type(3) { transition-delay: .2s; }
.hs-photo.in .hs-kp:nth-of-type(4) { transition-delay: .3s; }

.hs-photo.in .hs-ln {
    clip-path: inset(0);
    transition: clip-path 1.3s cubic-bezier(.45, 0, .2, 1) .7s;
}

.hs-photo.in .hs-br {
    transform: none;
    transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}

.hs-photo.in .hs-br:nth-of-type(6) { transition-delay: .9s; }
.hs-photo.in .hs-br:nth-of-type(7) { transition-delay: .98s; }
.hs-photo.in .hs-br:nth-of-type(8) { transition-delay: 1.06s; }
.hs-photo.in .hs-br:nth-of-type(9) { transition-delay: 1.14s; }
.hs-photo.in .hs-br:nth-of-type(10) { transition-delay: 1.22s; }
.hs-photo.in .hs-br:nth-of-type(11) { transition-delay: 1.3s; }
.hs-photo.in .hs-br:nth-of-type(12) { transition-delay: 1.38s; }

/* Palinsesto che entra a righe (slide gestionale) */
.hs-bd {
    opacity: 0;
    transform: translate(6px, 60px);
}

.hs-photo.in .hs-bd {
    opacity: 1;
    transform: none;
    transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .45s ease;
}

.hs-photo.in .hs-bd:nth-of-type(2) { transition-delay: .12s; }
.hs-photo.in .hs-bd:nth-of-type(3) { transition-delay: .24s; }
.hs-photo.in .hs-bd:nth-of-type(4) { transition-delay: .36s; }
.hs-photo.in .hs-bd:nth-of-type(5) { transition-delay: .48s; }
.hs-photo.in .hs-bd:nth-of-type(6) { transition-delay: .6s; }

/* Checkout animato (slide Klarna) */
.hs-photo .hs-tk,
.hs-photo .hs-btn,
.hs-photo .hs-rd {
    transform-box: fill-box;
    transform-origin: center;
}

.hs-tk {
    animation: hs-float 4s ease-in-out infinite;
}

@keyframes hs-float {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50% { transform: translateY(-9px) rotate(1.5deg); }
}

.hs-hl {
    fill: #FFFFFF;
    opacity: 0;
    transition: opacity .45s ease;
}

.hs-photo.sel .hs-hl {
    opacity: .13;
}

.hs-rd {
    opacity: 0;
    transform: scale(.6);
    transition: opacity .3s ease .15s, transform .35s cubic-bezier(.3, .7, .4, 1.5) .15s;
}

.hs-photo.sel .hs-rd {
    opacity: 1;
    transform: scale(1);
}

.hs-photo.click .hs-btn {
    animation: hs-hop .45s cubic-bezier(.3, .7, .4, 1.4);
}

@keyframes hs-hop {
    0% { transform: scale(1); }
    30% { transform: scale(.93); }
    65% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.hs-ok {
    opacity: 0;
    transition: opacity .3s ease;
}

.hs-photo.paid .hs-ok {
    opacity: 1;
}

.hs-ok text {
    font-family: 'Poppins-Medium', sans-serif;
    font-size: 15px;
    fill: #1B1650;
}

/* Frecce e indicatori */
.hs-arr {
    position: absolute;
    top: 50%;
    z-index: 5;
    /* 44px a 10px dal bordo: finiscono a 54px, prima dei testi che partono a 72px (padding della slide) */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: #FFFFFF;
    color: var(--hs-ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .35);
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
}

.hs-arr svg {
    width: 18px;
    height: 18px;
}

.hs-arr.l {
    left: 10px;
    transform: translate(-8px, -50%);
}

.hs-arr.r {
    right: 10px;
    transform: translate(8px, -50%);
}

.hs-viewport:hover .hs-arr,
.hs-arr:focus-visible {
    opacity: 1;
    transform: translate(0, -50%);
}

.hs-arr:hover {
    background: #F4F2F0;
}

.hs-arr:focus-visible,
.hs-bars button:focus-visible {
    outline: 2px solid var(--hs-ink);
    outline-offset: 3px;
}

.hs-bars {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.hs-bars button {
    all: unset;
    cursor: pointer;
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(18, 14, 31, .22);
    overflow: hidden;
    position: relative;
    transition: width .35s ease;
}

.hs-bars button.on {
    width: 44px;
}

.hs-bars button i {
    position: absolute;
    inset: 0;
    background: var(--hs-ink);
    transform-origin: 0 50%;
    transform: scaleX(0);
    display: block;
}

/* Mobile: foto in card in alto, testi centrati sotto su fondo bianco */
@media (max-width: 999px) {
    .hs-stage {
        padding-inline: 0;
    }

    .hs-viewport,
    .hs-slide {
        border-radius: 0;
    }

    .hs-slide,
    .hs-slide.hs-g,
    .hs-slide.hs-k,
    .hs-slide.hs-c {
        height: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        justify-items: center;
        text-align: center;
        padding: 0 10px 6px;
        background: #FFFFFF;
    }

    .hs-media {
        position: relative;
        width: 100%;
        height: 320px;
        border-radius: 32px;
        overflow: hidden;
        margin-bottom: 6px;
    }

    .hs-g .hs-media {
        background: #A2A6A1;
    }

    .hs-k .hs-media {
        background: #C8C9C3;
    }

    .hs-c .hs-media {
        background: linear-gradient(90deg, #C1BBA5, #C1C8C5);
    }

    .hs-c .hs-photo {
        right: auto;
        left: calc(50% - 452px);
    }

    .hs-g .hs-photo {
        right: auto;
        left: calc(50% - 436px);
    }

    .hs-k .hs-photo {
        height: auto;
        width: 118%;
        left: -2%;
        top: -14%;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .hs-g .hs-copy,
    .hs-k .hs-copy,
    .hs-c .hs-copy {
        max-width: 600px;
        gap: 16px;
        justify-items: center;
    }

    .hs-h1 {
        gap: 10px;
    }

    .hs-eyebrow {
        font-size: .7rem;
        justify-content: center;
        margin-inline: auto;
    }

    .hs-title,
    .hs-c .hs-title {
        font-size: 2.3rem;
        line-height: 1;
        padding: 0 8px;
    }

    .hs-sub {
        font-size: .92rem;
        color: #262A33;
        padding: 0 10px;
    }

    .hs-ctas {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .hs-sub-extra,
    .hs-arr {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hs-track {
        transition: none;
    }

    .hs-bd,
    .hs-kp,
    .hs-br {
        opacity: 1;
        transform: none;
    }

    .hs-ln {
        clip-path: none;
    }

    .hs-tk,
    .hs-photo.click .hs-btn {
        animation: none;
    }
}
