/* ============================================================
   Landing "Dati e creatività"
   Caricato solo dal template page-servizio-dati-creativita.php.

   Differenze dal prototipo blog/dati-creativita-v6.html:
   - le regole globali (body, h1/h2, em, a, .uk-text-lead) sono
     circoscritte a .mc-dati, così header e footer restano intatti;
   - .chevron -> .mc-chevron (il tema la usa per il menu),
     .btn -> .mc-btn, .container -> .mc-canvas.
   ============================================================ */


:root {
    --brand-blue: #007df9;
    --brand-blue-dark: #0a5cd0;
    --highlight-yellow: #fcf1c3;
    --azure: #e2f2ff;
}

/* Scroll fluido per i link àncora (es. "Andiamo al sodo" → #processo) */
html { scroll-behavior: smooth; }
/* Offset per non finire coperti dall'header fisso del sito */
#processo, #esempi { scroll-margin-top: 90px; }

.mc-dati {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* rete di sicurezza anti scroll orizzontale */
}

/* ============================================================
   Text gradient blu — REPLICATO dall'originale
   ============================================================ */
.text-gradient-blu i,
.text-gradient-blu em {
    background-image: linear-gradient(45deg, #004285, #007df9 50%, #8fcdff);
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-style: italic;
    /* niente margini negativi: causavano "Idati" attaccato */
    padding: 0 .1em;
}

/* Fix em di default: NON grigio/rosso, ereditato + italic */
.mc-dati em, .mc-dati i {
    color: inherit;
    font-style: italic;
}
/* Nel workflow section (blu) em resta bianco */
.workflow-section em { color: #fff; }

/* Yellow highlight — solo per "colore" nel titolo strumenti */
.hl {
    font-style: italic;
    display: inline-block;
    position: relative;
    padding: 0 6px;
}
.hl::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    bottom: 4px;
    height: 12px;
    background: var(--highlight-yellow);
    z-index: -1;
    border-radius: 3px;
}

.mc-dati h1, .mc-dati h2 { font-weight: 800; letter-spacing: -.015em; color: #000; }
h1 { font-size: 3rem; line-height: 1.15; margin-bottom: 24px; }
h2 { font-size: 2rem; line-height: 1.2; margin-bottom: 20px; }
/* uk-text-lead override light per usarlo strategicamente sulle intro */
.mc-dati .uk-text-lead { font-size: 1.3rem; line-height: 1.5; color: #333; font-weight: 400; }
.workflow-section .uk-text-lead { color: rgba(255, 255, 255, .95); }

.mc-btn:hover,
.mc-btn:focus,
.mc-dati a { text-decoration: none; }
.mc-dati a:hover { text-decoration: none; }

.mc-chevron {
    color: var(--brand-blue);
    font-size: 32px;
    margin-top: 30px;
    display: inline-block;
    animation: chevronBounce 2.5s ease-in-out infinite;
    text-decoration: none;
}
@keyframes chevronBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}


/* ============================================================
   HERO — reveal in ordine di lettura + reveal-on-scroll sotto canvas
   ============================================================ */
.hero-line {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .9s cubic-bezier(.22, 1, .36, 1),
                transform .9s cubic-bezier(.22, 1, .36, 1);
    will-change: opacity, transform;
}
.hero-line.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Il canvas parte invisibile e viene rivelato via JS dopo i testi */
.mc-canvas.hero-canvas {
    opacity: 0;
    transition: opacity .8s ease;
}
.mc-canvas.hero-canvas.revealed {
    opacity: 1;
}

/* Blocco sotto al canvas: appare SOLO allo scroll */
.hero-below {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .9s cubic-bezier(.22, 1, .36, 1),
                transform .9s cubic-bezier(.22, 1, .36, 1);
    will-change: opacity, transform;
}
.hero-below.revealed {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================================
   CANVAS BAR CHART (originale)
   ============================================================ */
.mc-canvas {
    position: relative;
    width: 100%;          /* riempie il contenitore padre (rispetta i suoi padding) */
    max-width: 600px;
    height: 380px;
    margin: 30px auto;    /* centrato nel padre, niente sforamento vs viewport */
    /* clip dei digit che partono da fuori: senza questo generano
       overflow orizzontale (fascia bianca a destra, visibile su mobile) */
    overflow: hidden;
}
.numero {
    position: absolute;
    font-size: clamp(8px, 2vw, 12px);
    opacity: 0;
    color: #007df9;
    text-shadow: 0 0 5px currentColor;
    transform: scale(0);
    transition: all 0.5s ease;
    font-family: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;
    font-weight: 700;
    pointer-events: none;
}
.x-axis {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 125, 249, .25) 15%, rgba(0, 125, 249, .25) 85%, transparent);
    border-radius: 999px;
    bottom: 30%;
    width: 90%;
    left: 5%;
}

/* Scintilla: digit che lampeggia bianco per un istante */
.numero.flash {
    color: #fff !important;
    text-shadow: 0 0 8px #fff, 0 0 16px #007df9;
}

/* Trend line SVG sopra le cime delle barre */
.trend-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}
.trend-path {
    fill: none;
    stroke: url(#trendGrad);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(0, 125, 249, .4));
}
.trend-dot {
    fill: #0a5cd0;
    stroke: #fff;
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(0, 125, 249, .7));
}
.trend-ring {
    fill: none;
    stroke: #007df9;
    stroke-width: 2;
    animation: trendRing 2s ease-out infinite;
    transform-origin: center;
}
@keyframes trendRing {
    0%   { opacity: .8; r: 5; }
    100% { opacity: 0;  r: 18; }
}
@media (max-width: 768px) { .mc-canvas { height: 300px; } }
@media (max-width: 480px) { .mc-canvas { height: 240px; } }


/* ============================================================
   FLUSSO — BLUE section con card bianche (come originale)
   ============================================================ */
.workflow-section {
    background: var(--brand-blue);
    color: #fff;
    padding: 80px 20px;
    text-align: center;
}
.workflow-section h2 { color: #fff; }
.workflow-section .uk-text-lead { color: rgba(255, 255, 255, .95); }
.workflow-section em { color: #fff; font-weight: 600; }

.workflow-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 48px auto;
}
.workflow-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    color: #333;
    text-align: center;
    transition: transform .3s ease;
}
.workflow-card:hover { transform: translateY(-4px); }
.workflow-card img {
    height: 100px;
    width: auto;
    margin-bottom: 16px;
}
.workflow-card p {
    font-size: 18px;
    color: #222;
    margin: 0;
    line-height: 1.5;
}
.workflow-card p strong { color: #000; }
@media (max-width: 880px) {
    .workflow-cards { grid-template-columns: 1fr; }
}


/* ============================================================
   STRUMENTI PROPRIETARI
   ============================================================ */
@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}


/* ============================================================
   PROCESSO — animazioni potenziate
   ============================================================ */
.process-section {
    background: var(--azure);
    padding: 80px 20px;
}
.flow-step {
    transition: transform .5s ease, opacity .5s ease;
    opacity: 0.4;
    transform: scale(0.95);
    cursor: pointer;
}
.flow-step.active { opacity: 1; transform: scale(1); }
.flow-step-content {
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 30, 80, 0.08);
    padding: 30px;
    height: 400px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 125, 249, .06);
}
.flow-step h3 { color: #000; font-weight: 700; margin: 0; font-size: 1.05rem; }
.flow-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: white;
    border-radius: 50%;
    margin-right: 12px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 125, 249, .35), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.progress-bar {
    height: 8px;
    background-color: #fff;
    margin: 20px auto;
    border-radius: 5px;
    overflow: hidden;
    max-width: 80%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-dark));
    width: 33%;
    transition: width .8s cubic-bezier(.22, 1, .36, 1);
    box-shadow: 0 0 12px rgba(0, 125, 249, .5);
}
.animation-container {
    position: relative;
    height: 230px;   /* aumentato per far respirare le 4 righe dello step 3 */
    margin: 20px 0;
}

/* Step 1 — data points: prima SPENTI (dato grezzo), poi ACCESI al passaggio dello scan */
.data-point {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 30% 30%, #7cc2ff, var(--brand-blue));
    border-radius: 50%;
    opacity: 0;
    box-shadow: none;
    transform: scale(0);
    transition: opacity .5s ease, transform .5s cubic-bezier(.34, 1.56, .64, 1), box-shadow .4s ease;
}
.data-point.appear { opacity: .3; transform: scale(.75); }   /* dato grezzo, spento */
.data-point.lit {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 14px rgba(0, 125, 249, .7);               /* interpretato → acceso */
}
.data-point.hero-dot.lit {
    background: radial-gradient(circle at 30% 30%, #ffca7c, #ff8a3d);
    box-shadow: 0 0 16px rgba(255, 138, 61, .6);
    animation: heroDotPulse 2s ease-in-out infinite .4s;
}

/* Fascio di scansione: "l'interpretazione" che attraversa i dati */
.scan-beam {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, transparent, rgba(0, 125, 249, .9) 25%, rgba(0, 125, 249, .9) 75%, transparent);
    box-shadow: 0 0 18px rgba(0, 125, 249, .55);
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 5;
    pointer-events: none;
}
.scan-beam.on { opacity: 1; }

/* Badge sull'insight trovato */
.insight-badge {
    position: absolute;
    padding: 3px 9px;
    background: linear-gradient(135deg, #ff9a4d, #ff8a3d);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(255, 138, 61, .45);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .4s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1);
    z-index: 6;
    white-space: nowrap;
}
.insight-badge.show { opacity: 1; transform: translateY(0); }
@keyframes heroDotPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 16px rgba(255, 138, 61, .6); }
    50%      { transform: scale(1.3); box-shadow: 0 0 24px rgba(255, 138, 61, .9); }
}
.data-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brand-blue) 20%, var(--brand-blue) 80%, transparent);
    opacity: 0;
    transform-origin: left center;
    transform: scaleX(0);
    transition: opacity .5s ease, transform .8s cubic-bezier(.22, 1, .36, 1);
}
.data-line.draw { opacity: 0.7; transform: scaleX(1); }

/* Step 2 — PIPELINE con nodi + pulse travelling */
.pipeline {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
}
.pipeline-node {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    /* Il prototipo distingueva il nodo con un bordo blu da 2px. Il bordo
       adesso è uno solo per tutto il sito, quindi la tessera si stacca
       dallo sfondo con il colore di riempimento invece che col contorno. */
    background: linear-gradient(135deg, #f2f8ff 0%, #dceeff 100%);
    border: 1px solid #e8eef5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-blue);
    box-shadow: 0 6px 20px rgba(0, 125, 249, .18);
    opacity: 0;
    transform: scale(.3);
    transition: opacity .5s ease, transform .6s cubic-bezier(.34, 1.56, .64, 1);
    z-index: 2;
}
.pipeline-node svg { width: 26px; height: 26px; stroke: currentColor; }
.pipeline-node.appear { opacity: 1; transform: scale(1); }
.pipeline-node.processing {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(0, 125, 249, .5);
    animation: nodePulse 1.6s ease-in-out infinite;
}
@keyframes nodePulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(0, 125, 249, .5); }
    50%      { box-shadow: 0 6px 28px rgba(0, 125, 249, .9); }
}
.pipeline-line {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, rgba(0, 125, 249, .3), rgba(0, 125, 249, .5));
    border-radius: 999px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity .6s ease;
    z-index: 1;
}
.pipeline-line.appear { opacity: 1; }
.pipeline-pulse {
    position: absolute;
    top: 50%;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 12px #fff, 0 0 20px var(--brand-blue);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 3;
}
.pipeline-pulse.travel {
    opacity: 1;
    animation: pulseTravel 3s linear infinite;
}
.pipeline-label {
    position: relative;   /* nel flex column del wrap: sta SOTTO il nodo, non sovrapposto */
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: rgba(0, 125, 249, .7);
    text-align: center;
    width: 60px;
    opacity: 0;
    transition: opacity .4s ease .3s;
}
.pipeline-label.appear { opacity: 1; }

/* Check di consegna completata sul nodo */
.pipeline-check {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(0, 30, 80, .22), 0 0 0 1.5px rgba(0, 125, 249, .25);
    opacity: 0;
    transform: scale(0);
    transition: opacity .3s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1);
    z-index: 4;
    pointer-events: none;
}
.pipeline-check.show { opacity: 1; transform: scale(1); }

/* Step 3 — insights (sinistra) + strategie (destra) — 40% width ognuno + gap centrale */
.insight-strategy-row {
    position: absolute;
    left: 0;
    right: 0;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 4px;
}
.insight-strategy-row .arrow {
    color: var(--brand-blue);
    opacity: 0;
    font-size: 14px;
    transition: opacity .5s ease .3s;
    flex-shrink: 0;
}
.insight-strategy-row.revealed .arrow {
    opacity: .8;
    animation: arrowNudge 1.5s ease-in-out infinite;   /* la freccia "spinge" verso la strategia */
}
@keyframes arrowNudge {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(5px); }
}

/* Focus a rotazione: una riga alla volta si illumina (leggibilità della trasformazione) */
.insight-strategy-row .insight,
.insight-strategy-row .strategy {
    transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1),
                box-shadow .4s ease, border-color .4s ease;
}
.insight-strategy-row.focus .insight {
    background: linear-gradient(180deg, #ffffff 0%, #eaf4ff 100%);
    border-color: rgba(0, 125, 249, .6);
    box-shadow: 0 6px 18px rgba(0, 125, 249, .3);
    transform: translateX(0) scale(1.05);
    color: #0a2540;
}
.insight-strategy-row.focus .strategy {
    box-shadow: 0 8px 20px rgba(0, 125, 249, .55), inset 0 1px 0 rgba(255, 255, 255, .2);
    transform: translateX(0) scale(1.05);
}
.insight-strategy-row.focus .arrow { opacity: 1; }

.insight {
    flex: 1;
    min-height: 40px;
    border-radius: 8px;
    /* azzurro pieno: deve emergere sul bianco della card */
    background: linear-gradient(180deg, #eaf4ff 0%, #dbeeff 100%);
    border: 1px solid rgba(0, 125, 249, .3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: #44546f;
    opacity: 0;
    box-shadow: 0 3px 8px rgba(0, 30, 80, .1);
    text-align: center;
    padding: 4px 6px;
    transform: translateX(-20px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1);
    line-height: 1.2;
}
.insight.appear { opacity: 1; transform: translateX(0); }
.insight b { font-size: .95rem; color: var(--brand-blue-dark); display: block; margin-top: 2px; }
.strategy {
    flex: 1;
    min-height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    opacity: 0;
    box-shadow: 0 4px 10px rgba(0, 125, 249, .35), inset 0 1px 0 rgba(255, 255, 255, .2);
    text-align: center;
    padding: 4px 6px;
    font-weight: 700;
    transform: translateX(20px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1);
    line-height: 1.15;
}
.strategy.appear { opacity: 1; transform: translateX(0); }

/* Navigazione step: solo mobile */
.flow-nav { display: none; }

@media (max-width: 640px) {
    .flow-step { display: none; }
    .flow-step.active { display: block; }

    .flow-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        margin: 24px auto 0;
    }
    .flow-nav__btn {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: none;
        background: #fff;
        color: var(--brand-blue);
        font-size: 24px;
        line-height: 1;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 4px 14px rgba(0, 30, 80, .12);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .flow-nav__btn:active {
        transform: scale(.92);
        background: var(--brand-blue);
        color: #fff;
    }
    .flow-nav__dots {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .flow-nav__dot {
        width: 9px;
        height: 9px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: rgba(0, 125, 249, .28);
        cursor: pointer;
        transition: width .3s ease, background .3s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .flow-nav__dot.active {
        width: 26px;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-dark));
    }
}


/* ============================================================
   TESTIMONIAL — SEMPLICI, come originale (no left border, no Playfair)
   ============================================================ */
.testimonials-section {
    background: #fff;
    padding: 80px 20px;
}
.testimonial-card {
    background: #fff;
    border: 1px solid rgba(0, 30, 80, .06);
    border-radius: 12px;
    padding: 22px 22px 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .04);
    margin-bottom: 20px;
    transition: transform .3s ease, box-shadow .3s ease;
    display: flex;
    flex-direction: column;
}
.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 30, 80, .1);
}
.testimonial-card__quote {
    font-size: .95rem;
    line-height: 1.55;
    color: #333;
    margin: 0 0 14px;
    flex: 1;
}
.testimonial-card__logo {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.testimonial-card__logo img {
    height: 32px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    opacity: .9;
    transition: opacity .3s ease;
}
.testimonial-card:hover .testimonial-card__logo img { opacity: 1; }


/* CTA finale */


@media (max-width: 880px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}


/* ============================================================
   Utility che sostituiscono gli style="" inline del prototipo
   ============================================================ */

.mc-dati .mc-hero-canvas__riga,
.mc-dati .mc-hero-canvas__sottotesto {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.mc-dati .mc-hero-canvas__sottotesto {
    font-size: 1rem;
    margin-bottom: 30px;
}

.mc-dati .mc-flusso__testo,
.mc-dati .mc-citazioni__intro {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

.mc-dati .mc-citazioni__intro {
    margin-bottom: 40px;
}

.mc-dati .mc-processo__titolo {
    font-size: 3rem;
}

.mc-dati .mc-processo__claim {
    font-size: 1.3rem;
    font-weight: 700;
}

.mc-dati .mc-processo__step-titolo {
    color: #000;
    font-weight: 700;
    margin: 0;
    font-size: 1.05rem;
}

@media (max-width: 880px) {
    .mc-dati .mc-processo__titolo { font-size: 1.8rem; }
}
