/* =============================================================================
 * Test di velocita' (home page): invito al test Speedtest
 * ========================================================================== */
.speedtest {
    padding: 50px 0 110px;
}
.speedtest__box {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 40px;
    align-items: center;
    padding: 56px 60px;
    border-radius: 36px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(0, 211, 99, .2), transparent 45%),
        radial-gradient(circle at 0% 110%, rgba(11, 61, 145, .9), transparent 55%),
        #071b3d;
    overflow: hidden;
}
.speedtest__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
}
.fp-home .speedtest__title.fp-title {
    margin: 0 0 14px;
    font-size: clamp(30px, 4.4vw, 52px);
    color: #fff;
}
.fp-home .speedtest__title.fp-title em { color: #00d363; }
.speedtest__lead {
    margin: 0 0 24px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, .88);
}
.speedtest__steps {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    counter-reset: passo;
}
.speedtest__steps li {
    counter-increment: passo;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.45;
    color: rgba(255, 255, 255, .92);
}
.speedtest__steps li + li { margin-top: 12px; }
.speedtest__steps strong { color: #fff; }
.speedtest__step-icon {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    font-size: 15px;
}
.speedtest__step-icon::after {          /* numero del passo */
    content: counter(passo);
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d363;
    color: #062a20;
    font: 700 11px/18px "Roboto", sans-serif;
    text-align: center;
}
.speedtest__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: 999px;
    background: #00d363;
    color: #062a20 !important;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 10px 24px rgba(0, 211, 99, .35);
    transition: transform .15s, box-shadow .15s, background-color .15s;
}
.speedtest__cta:hover {
    background: #19e077;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 211, 99, .45);
}
.speedtest__cta:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* --- tachimetro animato ---------------------------------------------------- */
.speedtest__visual { text-align: center; }
.speedtest__gauge {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
    margin: 0 auto;
}
.speedtest__arc {
    stroke-dasharray: 100;
    animation: speedtest-arc 4s ease-in-out infinite;
}
.speedtest__needle {
    transform-origin: 120px 130px;
    transform-box: view-box;
    animation: speedtest-needle 4s ease-in-out infinite;
}
@keyframes speedtest-arc {
    0%, 8%   { stroke-dashoffset: 100; }
    55%, 75% { stroke-dashoffset: 8; }
    62%      { stroke-dashoffset: 14; }
    100%     { stroke-dashoffset: 100; }
}
@keyframes speedtest-needle {
    0%, 8%   { transform: rotate(0deg); }
    55%, 75% { transform: rotate(166deg); }
    62%      { transform: rotate(155deg); }
    100%     { transform: rotate(0deg); }
}
.speedtest__readout {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.speedtest__readout-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    font-size: 13px;
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .speedtest__arc { animation: none; stroke-dashoffset: 14; }
    .speedtest__needle { animation: none; transform: rotate(155deg); }
    .speedtest__cta { transition: none; }
    .speedtest__cta:hover { transform: none; }
}

/* --- responsive ------------------------------------------------------------ */
@media (max-width: 991px) {
    .speedtest__box { grid-template-columns: minmax(0, 1fr); padding: 40px 36px; gap: 24px; }
    .speedtest__visual { order: -1; }
    .speedtest__gauge { max-width: 240px; }
}
@media (max-width: 575px) {
    .speedtest { padding: 20px 0 60px; }
    .speedtest__box { padding: 28px 20px; border-radius: 24px; }

    .speedtest__cta { width: 100%; justify-content: center; }
    .speedtest__readout { display: none; }
}
