/* =========================================
   SCROLL PROGRESS BAR
   ========================================= */
#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #0052CC, #4dabf7);
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* =========================================
   1. CONFIGURAZIONE BASE & VARIABILI
   ========================================= */
:root {
    --primary-blue: #0052CC;
    --primary-dark: #003ea1;
    --dark-text: #111111;
    --light-text: #555555;
    --light-bg: #FFFFFF;
    --gray-bg: #F8F9FC;
    --chart-track: #e6e6e6;
    --blue-tint: #F0F5FF;
}

/* Fix per lo scorrimento del menu che tagliava i titoli */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 130px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--dark-text);
    background-color: var(--light-bg);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-weight: 800;
    margin-top: 0;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

/* Gradient shimmer sull'h1 della hero — il blu scorre sul nero */
.hero h1 {
    background: linear-gradient(
        90deg,
        #111111 0%,
        #111111 30%,
        #0052CC 50%,
        #111111 70%,
        #111111 100%
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 8s linear infinite;
}

@keyframes shimmerText {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--dark-text);
}

p {
    margin-bottom: 1.5rem;
    color: var(--light-text);
    font-size: 1.1rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 25px;
    position: relative;
    z-index: 2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* =========================================
   2. GESTIONE ICONE GOOGLE (Fix Fondamentale)
   ========================================= */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    /* Dimensione base */
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    /* Supporto rendering */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
}

/* Stile specifico per le icone nelle card dei servizi */
.check-icon {
    font-size: 3rem !important;
    color: var(--primary-blue);
    margin-bottom: 15px;
    display: block;
}

/* =========================================
   3. HEADER & NAVIGAZIONE
   ========================================= */
header {
    padding: 25px 0;
    background: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 65px;
    width: auto;
    mix-blend-mode: multiply;
    filter: contrast(1.2);
    display: block;
}

.nav-center {
    display: flex;
    gap: 10px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-pill {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 600;
    font-size: 0.95rem;
    background: #F0F2F5;
    padding: 10px 25px;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-pill:hover,
.nav-pill.active {
    background: white;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: 0 4px 10px rgba(0, 82, 204, 0.1);
    transform: translateY(-1px);
}

.menu-btn {
    background: var(--dark-text);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.menu-btn:hover {
    background: var(--primary-blue);
}

/* Menu Laterale */
.menu-overlay {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 40px;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
}

.menu-overlay.active {
    right: 0;
}

.close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.overlay-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 20px;
    margin-top: 40px;
}

.overlay-link {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.overlay-link:hover {
    color: var(--primary-blue);
}

.overlay-sublink {
    display: block;
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
}

.overlay-sublink:hover {
    color: var(--primary-blue);
}

/* =========================================
   4. BOTTONI E UTILITY
   ========================================= */
.btn {
    display: inline-block;
    background-color: var(--primary-blue);
    color: white;
    padding: 14px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.2);
    border: none;
    cursor: pointer;
    animation: glowPulse 2.5s infinite ease-in-out;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0, 82, 204, 0.25); }
    50%       { box-shadow: 0 4px 30px rgba(0, 82, 204, 0.6), 0 0 0 6px rgba(0, 82, 204, 0.08); }
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 82, 204, 0.5);
    animation: none;
}

.btn-white {
    background: white;
    color: var(--primary-blue);
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 800;
    display: inline-block;
    transition: transform 0.2s;
}

.btn-white:hover {
    transform: scale(1.05);
}

.btn-submit {
    background-color: var(--dark-text);
    color: white;
    border: none;
    padding: 18px 40px;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.btn-submit:hover {
    background-color: var(--primary-blue);
}

.highlight {
    color: var(--primary-blue);
    font-weight: 700;
}

/* =========================================
   5. SEZIONI HOME PAGE
   ========================================= */
.hero {
    padding: 100px 0 120px;
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
    background-image: linear-gradient(#f0f2f5 1px, transparent 1px), linear-gradient(90deg, #f0f2f5 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ★ ORBS in alto al centro */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
    animation: orbFloatSide 10s ease-in-out infinite;
    pointer-events: none;
}
.hero-orb-1 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, #0052CC, transparent 70%);
    top: -90px; left: 50%; transform: translateX(-50%);
    opacity: 0.28;
    animation-name: orbFloatCenter;
    animation-duration: 12s;
}
.hero-orb-2 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, #4dabf7, transparent 70%);
    top: -70px; left: calc(50% - 190px);
    opacity: 0.2;
    animation-duration: 9s; animation-delay: -3s;
}
.hero-orb-3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, #003ea1, transparent 70%);
    top: -70px; left: calc(50% + 90px);
    opacity: 0.2;
    animation-duration: 14s; animation-delay: -5s;
}
@keyframes orbFloatCenter {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50%       { transform: translateX(calc(-50% + 12px)) scale(1.05) translateY(-15px); }
}
@keyframes orbFloatSide {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(10px, -18px) scale(1.04); }
}

/* ★ BADGE FLOTTANTE HERO */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid rgba(0, 82, 204, 0.2);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0, 82, 204, 0.1);
    animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
.badge-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--primary-blue);
    flex-shrink: 0;
    animation: dotPulse 1.5s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.35; transform: scale(0.65); }
}
@keyframes badgePop {
    from { opacity: 0; transform: translateY(-10px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ★ SCROLL REVEAL */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }

.hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, #ffffff, transparent);
    z-index: 1;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text {
    animation: slideUpFade 0.8s ease-out forwards;
}

.hero-visual {
    position: relative;
    animation: slideUpFade 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-dashboard-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
    position: relative;
    z-index: 5;
    animation: float 6s ease-in-out infinite;
}

/* Su desktop la dashboard è grande e prominente (più spazio a destra) */
@media (min-width: 901px) {
    .hero-grid {
        grid-template-columns: 1fr 1.15fr;
    }
    .hero-dashboard-img {
        width: 170%;
        max-width: none;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grafico Live Home */
.live-chart-container {
    position: absolute;
    bottom: -20px;
    left: -20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
    width: 180px;
    border: 1px solid #eee;
    animation: slideUpFade 1s ease-out 0.8s forwards;
    opacity: 0;
}

.chart-bar {
    width: 20%;
    background: var(--primary-blue);
    border-radius: 4px 4px 0 0;
    animation: growBar 2s ease-out forwards;
    height: 0;
    opacity: 0.8;
}

.b1 {
    animation-delay: 1.2s;
    --h: 40%;
}

.b2 {
    animation-delay: 1.4s;
    --h: 70%;
    background: #003ea1;
}

.b3 {
    animation-delay: 1.6s;
    --h: 55%;
}

.b4 {
    animation-delay: 1.8s;
    --h: 90%;
    background: #4dabf7;
}

@keyframes growBar {
    to {
        height: var(--h);
    }
}

.live-label {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 10px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
}

/* Sezione Metodo */
.section-method {
    padding: 100px 0;
    background: var(--light-bg);
    border-bottom: 1px solid #eee;
}

.method-header {
    text-align: center;
    margin-bottom: 60px;
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
    position: relative;
}

@property --step-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.method-step {
    position: relative;
    z-index: 1;
    background: white;
    padding: 26px 18px;
    border-radius: 18px;
}

/* Contorno tracciato attorno a ogni fase, con una luce blu che gira in loop (sfalsate tra le fasi) */
.method-step::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from var(--step-angle),
        rgba(0, 82, 204, 0.12) 0deg,
        rgba(0, 82, 204, 0.12) 245deg,
        rgba(77, 171, 247, 0.55) 300deg,
        rgba(106, 180, 248, 0.95) 332deg,
        #a6d4fc 345deg,
        rgba(0, 82, 204, 0.12) 357deg,
        rgba(0, 82, 204, 0.12) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: stepBorderRotate 4.5s linear infinite;
    pointer-events: none;
    z-index: 2;
}

.method-step:nth-child(2)::after { animation-delay: -1.125s; }
.method-step:nth-child(3)::after { animation-delay: -2.25s; }
.method-step:nth-child(4)::after { animation-delay: -3.375s; }

@keyframes stepBorderRotate {
    to { --step-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
    .method-step::after { animation: none; }
}

.step-icon-box {
    width: 80px;
    height: 80px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    margin: 0 auto 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0, 82, 204, 0.2);
}

.step-icon-svg {
    width: 40px;
    height: 40px;
}

/* Sezione Sicurezza */
.section-security {
    padding: 100px 0;
    background-color: var(--blue-tint);
    border-bottom: 1px solid #e0e6f0;
}

.security-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: center;
}

.security-visual {
    display: flex;
    justify-content: center;
}

.shield-svg {
    width: 250px;
    height: 250px;
    color: var(--primary-blue);
    filter: drop-shadow(0 20px 30px rgba(0, 82, 204, 0.2));
}

.animate-shield {
    animation: shieldPulse 3s infinite ease-in-out;
}

/* Lo scudo si FORMA (contorno che si disegna + riempimento + corpo lucchetto)
   e poi il LUCCHETTO SI CHIUDE, quando la sezione entra in vista. */
.shield-outline { stroke-dasharray: 1; }
.section-security.revealed .shield-outline {
    animation: shieldDraw 1.4s ease 0.15s both;
}
@keyframes shieldDraw {
    from { stroke-dashoffset: 1; }
    to   { stroke-dashoffset: 0; }
}

.section-security.revealed .shield-fill {
    animation: shieldFill 0.8s ease 0.9s both;
}
@keyframes shieldFill {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.shield-body {
    transform-box: fill-box;
    transform-origin: center;
}
/* Corpo e archetto restano nascosti durante la formazione dello scudo (via "both"),
   ma visibili come stato base -> con "riduci animazioni" il lucchetto resta comunque presente. */
.shield-body {
    transform-box: fill-box;
    transform-origin: center;
}
.section-security.revealed .shield-body {
    animation: shieldBody 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s both;
}
@keyframes shieldBody {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}

.shield-shackle {
    transform-box: fill-box;
    transform-origin: center bottom;
}
.section-security.revealed .shield-shackle {
    animation: shackleClose 1.5s cubic-bezier(0.5, 0.05, 0.25, 1) 2.1s both;
}
@keyframes shackleClose {
    0%   { transform: translateY(-70%); opacity: 0; }
    25%  { opacity: 1; }
    65%  { transform: translateY(10%); }
    100% { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .section-security.revealed .shield-outline,
    .section-security.revealed .shield-fill,
    .section-security.revealed .shield-body,
    .section-security.revealed .shield-shackle { animation: none; }
}

@keyframes shieldPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }

    100% {
        transform: scale(1);
    }
}

.security-text h2 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.security-list {
    list-style: none;
    padding: 0;
    margin-top: 30px;
}

.security-list li {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-text);
}

.security-icon {
    font-family: 'Material Icons' !important;
    color: var(--primary-blue);
    margin-right: 15px;
    font-size: 1.5rem !important;
    font-weight: normal;
    font-style: normal;
}

/* Sezione Problema */
.section-problem-light {
    padding: 120px 0;
    background: white;
    overflow: hidden;
}

.problem-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.chart-col {
    text-align: center;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 80%;
    max-height: 350px;
}

.circle-bg {
    fill: none;
    stroke: var(--chart-track);
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke: var(--primary-blue);
    stroke-dasharray: 0, 100;
    transition: stroke-dasharray 2.5s ease-out;
}

.animate-chart .circle {
    stroke-dasharray: 90, 100;
}

.percentage {
    fill: var(--primary-blue);
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 0.5em;
    text-anchor: middle;
    dominant-baseline: central;
}

/* =========================================
   SEZIONE STATISTICHE ANIMATE
   ========================================= */
.section-stats {
    background: var(--dark-text);
    padding: 80px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.stat-item {
    text-align: center;
    padding: 30px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.stat-item:last-child {
    border-right: none;
}

.stat-number {
    display: block;
    font-size: clamp(2.1rem, 6vw, 3.5rem);
    font-weight: 900;
    color: white;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #ffffff, #4dabf7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stat-number.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Sezione Servizi Home */
.services-header-black {
    padding: 80px 0;
    background: var(--dark-text);
    color: white;
    text-align: center;
}

.services-header-black h2 {
    color: white;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.services-header-black p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

.services-list {
    background: var(--light-bg);
}

.service-row {
    padding: 100px 0;
}

.service-row:nth-child(even) {
    background-color: var(--gray-bg);
}

.service-flex {
    display: flex;
    align-items: center;
    gap: 80px;
}

.service-flex-reverse {
    display: flex;
    align-items: center;
    gap: 80px;
    flex-direction: row-reverse;
}

.service-text {
    flex: 1;
}

.service-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-num {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary-blue);
    opacity: 0.8;
    line-height: 1;
    margin-bottom: 20px;
}

.icon-box {
    background: white;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.5s ease-out;
}

.big-icon-svg {
    width: 100px;
    height: 100px;
    color: var(--primary-blue);
}

/* Animazioni Icone */
@keyframes pulseSlow {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.animate-pulse .big-icon-svg {
    animation: pulseSlow 3s infinite ease-in-out;
}

@keyframes spinSlow {
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin .big-icon-svg {
    animation: spinSlow 10s linear infinite;
}

.pop-in {
    animation: popIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Grafico Forecast Animato (Servizio 3) */
.trend-chart-box {
    width: 60%;
    height: 60%;
    position: relative;
}

.trend-svg-squared {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-grid-line {
    stroke: #e0e0e0;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.trend-area-squared {
    fill: var(--primary-blue);
    opacity: 0;
    transform: translateY(10px);
    transition: all 1s ease-out;
}

.trend-line-squared {
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.5s ease-out;
}

.animate-trend-squared .trend-area-squared {
    opacity: 0.15;
    transform: translateY(0);
}

.animate-trend-squared .trend-line-squared {
    stroke-dashoffset: 0;
}

/* =========================================
   6. PAGINE INTERNE (Analisi, Contatti, FAQ)
   ========================================= */
.page-hero,
.page-header {
    padding: 80px 0;
    background: var(--dark-text);
    color: white;
    text-align: center;
}

.page-hero h1,
.page-header h1 {
    font-size: 3.5rem;
    margin: 0 0 15px 0;
    letter-spacing: -1px;
}

.page-hero p,
.page-header p {
    font-size: 1.3rem;
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
}

.page-hero.left-align {
    text-align: left;
}

.page-header-light {
    background: var(--gray-bg);
    padding: 80px 0;
    text-align: center;
}

.page-header-light h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 800;
    background: linear-gradient(90deg, #111111 0%, #111111 30%, #0052CC 50%, #111111 70%, #111111 100%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .page-header-light h1 { animation: none; }
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    padding: 80px 0;
    align-items: center;
}

.intro-text h2 {
    color: var(--primary-blue);
    font-size: 2rem;
    margin-top: 0;
}

.impact-box {
    background: var(--gray-bg);
    padding: 40px;
    border-radius: 12px;
    border-left: 5px solid var(--primary-blue);
}

.impact-title {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: block;
}

.impact-stat {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-blue);
    line-height: 1;
    margin-bottom: 10px;
    display: block;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 80px;
}

.feature-card {
    background: white;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

/* Spotlight discreto che segue il cursore (acceso solo all'hover, posizione gestita via JS) */
.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 82, 204, 0.16), transparent 62%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-blue);
    box-shadow: 0 18px 40px rgba(0, 82, 204, 0.12);
}

.feature-card:hover::before {
    opacity: 1;
}

@media (hover: none) {
    .feature-card::before { display: none; }
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--dark-text);
}

.cta-section {
    background: var(--primary-blue);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.cta-section h3 {
    font-size: 2rem;
    margin-bottom: 30px;
}

/* --- SEZIONE CONTATTI (Redesign Minimal/Ingegneristico) --- */
.contact-section-minimal {
    background-color: var(--gray-bg);
    padding: 0 0 100px 0;
    position: relative;
}

.contact-section-minimal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background-color: var(--gray-bg);
    z-index: 0;
}

.contact-info-strip {
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border-top: 4px solid var(--primary-blue);
    position: relative;
    z-index: 2;
    margin-top: -60px;
    margin-bottom: 40px;
}

.info-block {
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-icon-minimal {
    color: var(--primary-blue);
    font-size: 2rem !important;
    background: var(--blue-tint);
    padding: 12px;
    border-radius: 50%;
}

.info-title-minimal {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    letter-spacing: 1px;
}

.info-data-minimal {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark-text);
}

.contact-form-minimal-wrapper {
    background: white;
    padding: 60px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 2;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.minimal-form .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-group-line {
    margin-bottom: 30px;
}

.form-group-line label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 10px;
}

.minimal-form input,
.minimal-form select,
.minimal-form textarea {
    width: 100%;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    background: transparent;
    padding: 12px 0;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--dark-text);
    border-radius: 0;
    transition: border-color 0.3s;
}

.minimal-form input:focus,
.minimal-form select:focus,
.minimal-form textarea:focus {
    outline: none;
    border-bottom-color: var(--primary-blue);
    box-shadow: none;
}

.minimal-form textarea {
    height: 120px;
    resize: none;
    margin-top: 10px;
}

.form-submit-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
    border-top: 1px solid #f0f0f0;
    padding-top: 40px;
}

.privacy-notice {
    font-size: 0.85rem;
    color: #777;
    max-width: 50%;
    margin: 0;
    line-height: 1.5;
}

.btn-submit-minimal {
    background: var(--dark-text);
    color: white;
    border: none;
    padding: 16px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
}

.btn-submit-minimal:hover {
    background: var(--primary-blue);
    padding: 16px 45px;
    box-shadow: 0 10px 20px rgba(0, 82, 204, 0.2);
}

/* --- CUSTOM SELECT (FORM CONTATTI) --- */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    position: relative;
    cursor: pointer;
    border-bottom: 2px solid #e0e0e0;
    padding: 12px 0;
    transition: border-color 0.3s;
}

.select-selected {
    color: var(--dark-text);
    font-size: 1.05rem;
}

.select-selected::after {
    content: "";
    position: absolute;
    top: 18px;
    right: 10px;
    border: 6px solid transparent;
    border-color: #888 transparent transparent transparent;
}

.custom-select.select-arrow-active {
    border-bottom-color: var(--primary-blue);
}

.select-arrow-active .select-selected::after {
    top: 10px;
    border-color: transparent transparent var(--primary-blue) transparent;
}

.select-items {
    position: absolute;
    background-color: white;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    border-top: none;
}

.select-items div {
    color: var(--dark-text);
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    transition: background 0.2s, color 0.2s;
    font-size: 1rem;
}

.select-items div:last-child {
    border-bottom: none;
}

.select-items div:hover,
.same-as-selected {
    background-color: var(--blue-tint);
    color: var(--primary-blue);
    font-weight: 600;
}

.select-hide {
    display: none;
}

/* FAQ */
.faq-section {
    padding: 80px 0;
}

.faq-item {
    background: white;
    border: 1px solid #eee;
    margin-bottom: 20px;
    padding: 25px;
    border-radius: 12px;
    cursor: pointer;
    transition: border 0.3s, box-shadow 0.3s;
}

.faq-item:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.faq-question {
    font-size: 1.2rem;
    font-weight: 700;
    position: relative;
    padding-right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-icon {
    font-size: 1.5rem !important;
    color: var(--primary-blue);
    transition: transform 0.3s;
}

.faq-answer {
    display: none;
    margin-top: 15px;
    color: #555;
    font-size: 1.05rem;
    line-height: 1.6;
    padding-top: 15px;
    border-top: 1px solid #f5f5f5;
}

.faq-item.open .faq-answer {
    display: block;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

/* Chi Siamo */
.content-section {
    padding: 80px 0;
}

.values-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.value-card {
    background: #fff;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Footer */
footer {
    background: #111;
    color: #fff;
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: white;
}

.footer-col p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-bottom: 15px;
}

.footer-logo {
    height: 40px;
    width: auto;
    mix-blend-mode: multiply;
    filter: invert(1);
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* =========================================
   7. DOCUMENTAZIONE LEGALE (PRIVACY / TERMINI)
   ========================================= */
.legal-page-bg {
    background-color: var(--gray-bg);
    padding-bottom: 100px;
}

.legal-document-wrapper {
    background: white;
    padding: 60px 80px;
    margin: 0 auto;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: -40px;
    position: relative;
    z-index: 2;
}

.legal-document-wrapper h3 {
    font-size: 1.4rem;
    color: var(--dark-text);
    margin-top: 50px;
    margin-bottom: 25px;
    padding-left: 20px;
    border-left: 4px solid var(--primary-blue);
    line-height: 1.3;
}

.legal-document-wrapper h3:first-child {
    margin-top: 0;
}

.legal-document-wrapper p,
.legal-document-wrapper li {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #555;
}

.legal-document-wrapper p {
    margin-bottom: 25px;
}

.legal-document-wrapper ul {
    margin-bottom: 35px;
    padding-left: 25px;
}

.legal-document-wrapper li {
    margin-bottom: 15px;
}

.legal-document-wrapper strong {
    color: var(--dark-text);
    font-weight: 700;
}

.legal-document-wrapper a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.legal-document-wrapper a:hover {
    border-bottom-color: var(--primary-blue);
}

.legal-document-wrapper .update-date {
    font-size: 0.9rem;
    color: #aaa;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 900px) {
    .nav-center {
        display: none;
    }

    .menu-btn {
        margin-left: auto;
    }

    .header-content {
        flex-direction: row;
    }

    .hero-grid,
    .problem-grid,
    .footer-grid,
    .security-grid,
    .contact-grid,
    .content-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .method-grid,
    .feature-grid,
    .values-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .method-grid::before {
        display: none;
    }

    .service-row {
        padding: 60px 0;
        text-align: center;
    }

    .service-flex,
    .service-flex-reverse {
        flex-direction: column-reverse;
        gap: 40px;
    }

    .icon-box {
        width: 160px;
        height: 160px;
        margin: 0 auto 30px;
    }

    .big-icon-svg {
        width: 70px;
        height: 70px;
    }

    .security-visual {
        margin-bottom: 40px;
    }

    h1 {
        font-size: 2.8rem;
    }

    .page-hero h1 {
        font-size: 2.5rem;
    }

    .intro-text,
    .security-text {
        text-align: center;
    }

    .security-list li {
        justify-content: center;
    }

    .live-chart-container {
        left: 10px;
        transform: scale(0.8);
        transform-origin: left bottom;
    }

    /* Contatti Minimal Mobile */
    .contact-info-strip {
        flex-direction: column;
        gap: 20px;
        text-align: left;
        padding: 25px;
        margin-top: 0;
        border-radius: 0;
        box-shadow: none;
        border-top: none;
    }

    .contact-section-minimal {
        padding: 0;
    }

    .contact-section-minimal::before {
        display: none;
    }

    .contact-form-minimal-wrapper {
        padding: 30px;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid #eee;
    }

    .minimal-form .form-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-submit-row {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .privacy-notice {
        max-width: 100%;
    }

    /* Documentazione Legale Mobile */
    .legal-document-wrapper {
        padding: 40px 25px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid #eee;
        margin-top: 0;
    }

    .legal-page-bg {
        padding-bottom: 40px;
    }

    /* --- Barra statistiche: 2 colonne pulite su mobile (evita overflow) --- */
    .section-stats {
        padding: 50px 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 26px 12px;
        min-width: 0;
    }

    /* Niente bordo destro sulla colonna di destra; bordo inferiore tra le due righe */
    .stat-item:nth-child(2n) {
        border-right: none;
    }

    .stat-item:nth-child(1),
    .stat-item:nth-child(2) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .stat-label {
        font-size: 0.78rem;
        letter-spacing: 0.5px;
    }
}

/* Schermi molto stretti: una sola colonna */
@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-item {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .stat-item:last-child {
        border-bottom: none;
    }
}

/* =========================================
   UTILITY / ACCESSIBILITA
   ========================================= */

/* Etichette per screen reader (visivamente nascoste ma lette dagli assistenti vocali) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Campo honeypot anti-spam: nascosto agli umani, visibile ai bot */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* =========================================
   LOGIN (spostato da login.php)
   ========================================= */
.login-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f7f9fc;
    padding: 40px 20px;
}

.login-card {
    background: white;
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    max-width: 450px;
    width: 100%;
    text-align: center;
    border-top: 5px solid var(--primary-blue);
}

.login-card h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: #111;
}

.login-card p.subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 35px;
}

.login-form input {
    width: 100%;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: #fdfdfd;
    transition: all 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: #111;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: var(--primary-blue);
}

.alert-maintenance {
    background: #fff8e6;
    color: #856404;
    border-left: 4px solid #ffcc00;
    padding: 18px 20px;
    margin-top: 35px;
    border-bottom-right-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 0.85rem;
    text-align: left;
    line-height: 1.5;
}

.alert-maintenance strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #664d03;
}

/* =========================================
   ANIMAZIONE BUSSOLA HOME (spostato da index.php)
   ========================================= */
@keyframes compassSpin {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(35deg); }
    50% { transform: rotate(-35deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

.compass-needle {
    transform-origin: center;
    animation: compassSpin 5s ease-in-out infinite;
}

/* =========================================
   PARALLAX DISCRETO — profondità allo scroll
   Movimento minimo e sobrio. Si disattiva su mobile
   e con "prefers-reduced-motion" (degrada a statico pulito).
   ========================================= */

/* Wrapper dell'immagine hero: spostato leggermente via JS.
   Non tocca le animazioni interne (float dell'immagine, orb). */
.hero-parallax {
    will-change: transform;
}

/* Bande che ricevono uno strato di profondità.
   Stesso linguaggio visivo degli orb blu della hero. */
.section-stats,
.page-hero,
.page-header,
.cta-section {
    position: relative;
    overflow: hidden;
}

/* Il contenuto resta sempre sopra lo strato decorativo */
.section-stats > .container,
.page-hero > .container,
.page-header > .container,
.cta-section > .container {
    position: relative;
    z-index: 1;
}

/* Strato glow tenue che scorre lentamente (l'effetto parallax) */
.section-stats::before,
.page-hero::before,
.page-header::before,
.cta-section::before {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    top: -45%;
    bottom: -45%;
    z-index: 0;
    pointer-events: none;
    transform: translate3d(0, var(--parallax-bg, 0), 0);
    will-change: transform;
}

/* Glow blu brand sulle bande scure */
.section-stats::before,
.page-hero::before,
.page-header::before {
    background: radial-gradient(ellipse 60% 55% at 50% 38%, rgba(77, 171, 247, 0.10), transparent 70%);
}

/* Glow chiaro discreto sul blu della CTA */
.cta-section::before {
    background: radial-gradient(ellipse 55% 60% at 50% 35%, rgba(255, 255, 255, 0.08), transparent 70%);
}

/* MOBILE: niente movimento, fondo statico e pulito (il parallax classico rompe lo scroll su telefono) */
@media (max-width: 768px) {
    .hero-parallax,
    .section-stats::before,
    .page-hero::before,
    .page-header::before,
    .cta-section::before {
        transform: none !important;
    }
}

/* ACCESSIBILITA: se l'utente ha "riduci animazioni" attivo, nessun parallax */
@media (prefers-reduced-motion: reduce) {
    .hero-parallax,
    .section-stats::before,
    .page-hero::before,
    .page-header::before,
    .cta-section::before {
        transform: none !important;
    }
}

/* ===========================================
   Linee verticali laterali con scia blu (solo pagina Chi Siamo)
   =========================================== */
.side-line {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 56px;
    z-index: 1;
    pointer-events: none;
}
.side-line-left  { left: 22px; }
.side-line-right { right: 22px; transform: scaleX(-1); }

.side-wave {
    width: 100%;
    height: 100%;
    display: block;
}
.side-wave-base {
    stroke: rgba(0, 82, 204, 0.10);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.side-wave-glow {
    stroke: #5ab0f7;
    stroke-width: 2.5;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 0.14 0.86;
    stroke-dashoffset: 1;
    filter: drop-shadow(0 0 4px rgba(77, 171, 247, 0.85));
    animation: waveTravel 6.5s linear infinite;
}
.side-line-right .side-wave-glow { animation-delay: -3.25s; }

@keyframes waveTravel {
    from { stroke-dashoffset: 1; }
    to   { stroke-dashoffset: 0; }
}

/* Solo su schermi larghi: sotto, finirebbero sopra il contenuto */
@media (max-width: 1280px) {
    .side-line { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .side-wave-glow { animation: none; }
}