/* TwinSight - main.css */

/* 1. BASE */

:root {
    --bs-body-font-family: 'DM Sans', sans-serif;
    --bs-body-font-size: 18px;

    /* colori */
    --color-1: #2B557A;     /* blu scuro: titoli e testi */
    --color-2: #8184C2;     /* lilla: accenti, sottotitoli */
    --color-3: #FBFBFB;
    --gray: #6f6f7d;

    /* layout */
    --gutter: clamp(20px, 2.8vw, 40px);
    --radius: 30px;
    --shadow-card: 0 10px 30px rgba(129, 132, 194, .16), inset 0 0 0 1px rgba(255, 255, 255, .7);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--bs-body-font-family);
    font-size: var(--bs-body-font-size);
    color: var(--color-1);
    background: #fff;
    overflow-x: hidden;
}

section { position: relative; }

/* le bolle decorative non devono mai creare scroll orizzontale */
main, .site-footer { overflow-x: clip; }

/* padding laterale standard dei contenuti */
.wrap { padding-inline: calc(15px + var(--gutter)); }

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-1);
    font-weight: 600;
    margin: 0;
}

h1 {
    font-size: clamp(50px, 8.4vw, 132px);
    letter-spacing: -0.045em;
    line-height: .95;
    margin-bottom: clamp(24px, 4vw, 64px);
}

h2 {
    font-size: clamp(34px, 4.4vw, 68px);
    letter-spacing: -0.02em;
    line-height: 1.02;
    margin-bottom: clamp(18px, 2vw, 28px);
}

h3 { font-size: clamp(24px, 2.2vw, 34px); letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }

.lead-c1, .lead-c2, .lead-gray {
    font-size: clamp(18px, 1.75vw, 26px);
    line-height: 1.25;
    letter-spacing: -0.01em;
    max-width: 38ch;
}
.lead-c1 { color: var(--color-1); }
.lead-c2 { color: var(--color-2); }
.lead-gray { color: var(--gray); }
.narrow { max-width: 30ch; }
.wide { max-width: 70ch; }

/* sopratitolo in maiuscolo */
.pre-titolo {
    color: var(--color-2);
    font-size: clamp(15px, 1.4vw, 21px);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: clamp(14px, 1.8vw, 26px);
}

/* 2. COMPONENTI CONDIVISI */

/* Header */
header {
    position: absolute;
    top: clamp(24px, 3vw, 44px);
    left: 0;
    width: 100%;
    z-index: 999;
}

.header-inner { padding-inline: calc(15px + var(--gutter)); }

.logo { display: block; width: clamp(96px, 8.4vw, 124px); flex-shrink: 0; }
.logo img { width: 100%; height: auto; display: block; }

nav ul li a {
    color: var(--color-1);
    text-decoration: none;
    font-size: clamp(15px, 1.2vw, 18px);
    font-weight: 500;
    white-space: nowrap;
}
/* voce della pagina corrente */
nav ul li a[aria-current="page"] { color: var(--color-2); }

.nav-toggle {
    background: none;
    border: 0;
    color: var(--color-1);
    font-size: 38px;
    line-height: 1;
    padding: 0;
}

/* Bottoni / CTA */
.cta {
    display: inline-block;
    color: var(--color-1);
    text-transform: uppercase;
    text-decoration: none;
    font-weight: 700;
    font-size: clamp(14px, 1.15vw, 18px);
}
.cta-lg { font-size: clamp(16px, 1.5vw, 22px); }
.cta .bi { font-size: 1.25em; vertical-align: -0.12em; margin-left: 4px; }

/* bottone "pillola" con bordo */
.cta-demo {
    display: inline-block;
    font-weight: 600;
    font-size: clamp(14px, 1.1vw, 17px);
    text-transform: uppercase;
    background: transparent;
    border: 1.5px solid var(--color-1);
    padding: 11px 26px;
    border-radius: 40px;
    text-decoration: none;
    color: var(--color-1);
    white-space: nowrap;
}
.cta-demo:hover { background-color: var(--color-1); color: #fff; }

/* Bolle decorative */
.deco {
    position: absolute;
    height: auto;
    pointer-events: none;
    user-select: none;
    z-index: 3;
}

/* fluttuazione CSS di riserva (se GSAP non c'è) */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.float { animation: float 7s ease-in-out infinite; }
.float:nth-of-type(even) { animation-duration: 9s; animation-delay: -3s; }

/* Card in vetro */
.cards {
    position: relative;
    height: 100%;
    background: url(../img/bg-quadro.webp) center / cover no-repeat;
    border-radius: var(--radius);
    padding: clamp(24px, 2.6vw, 40px);
    box-shadow: var(--shadow-card);
}

.stat {
    font-size: clamp(48px, 5.4vw, 80px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: clamp(14px, 2vw, 30px);
}

.card-label {
    font-size: clamp(18px, 1.9vw, 28px);
    line-height: 1.2;
    margin: 0;
    max-width: 14ch;
}

.card-text-c1 {
    font-size: clamp(17px, 1.55vw, 23px);
    line-height: 1.25;
    margin: 0;
    max-width: 18ch;
}

/* Pannello grande (sezioni a tutta larghezza) */
.panel {
    margin: 15px;
    padding: clamp(24px, 2.8vw, 40px);
    border-radius: var(--radius);
    background: url(../img/bg-quadro.webp) center / cover no-repeat;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* Hero delle pagine interne */
.page-hero {
    position: relative;
    margin: 15px;
    min-height: clamp(560px, 56vw, 900px);
    padding: clamp(110px, 10vw, 150px) var(--gutter) clamp(40px, 5vw, 80px);
    border-radius: var(--radius);
    overflow: hidden;
    background: url(../img/bg-quadro.webp) center / cover no-repeat;
    box-shadow: var(--shadow-card);
}
.page-hero .hero-text { max-width: 100%; }
.page-hero h1 { margin-bottom: clamp(60px, 9vw, 150px); }
.page-hero .lead-c2 { margin-bottom: clamp(24px, 3vw, 44px); }

/* immagine decorativa dell'hero (a destra, sotto il testo) */
.page-hero .hero-art {
    position: absolute;
    right: -2%;
    bottom: -6%;
    width: clamp(300px, 52vw, 860px);
    height: auto;
    pointer-events: none;
    z-index: 1;
}
.page-hero .hero-text { position: relative; z-index: 2; }

/* briciole di pane: Home > Pagina */
.breadcrumb-nav {
    display: flex;
    gap: 6px;
    margin-bottom: clamp(20px, 3vw, 44px);
    font-size: clamp(13px, 1vw, 15px);
    color: var(--color-2);
}
.breadcrumb-nav a { color: inherit; text-decoration: none; }
.breadcrumb-nav a:hover { text-decoration: underline; }

/* CTA finale (card bianca) */
.cta-card {
    margin: clamp(30px, 4vw, 60px) 15px 0;
    padding: clamp(28px, 3.4vw, 54px) clamp(20px, 3.2vw, 50px);
    background: rgba(255, 255, 255, .85);
    border-radius: var(--radius);
    box-shadow: 0 -4px 30px rgba(129, 132, 194, .14), var(--shadow-card);
}
.cta-card h2 { color: #123f7a; font-size: clamp(32px, 4vw, 60px); }
.cta-card .lead-c2 { max-width: 52ch; }

/* Footer */
.site-footer {
    position: relative;
    overflow: hidden;
    background:
        url('../img/bg-footer.webp') left bottom / 100% auto no-repeat,
        linear-gradient(180deg, #f3f4fb, #f1f2fb);
}

.footer-inner {
    padding: clamp(150px, 24vw, 400px) calc(15px + var(--gutter)) 20px;
}

.footer-logo { width: clamp(150px, 16vw, 240px); height: auto; display: block; margin-bottom: 14px; }
.footer-tagline { color: var(--color-1); font-size: clamp(16px, 1.3vw, 20px); margin-bottom: clamp(24px, 4vw, 60px); }

.social-links { display: flex; gap: 14px; }
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #fff;
    color: var(--color-2);
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(129, 132, 194, .2);
}
.social-icon:hover { background: var(--color-2); color: #fff; }

.footer-title {
    color: var(--color-2);
    font-weight: 600;
    font-size: clamp(16px, 1.3vw, 20px);
    margin-bottom: 20px;
}

.contact-item { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.contact-icon-box {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: #fff;
    color: var(--color-1);
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(129, 132, 194, .2);
}
.contact-info { display: flex; flex-direction: column; }
.contact-main { color: var(--color-1); font-size: clamp(16px, 1.3vw, 20px); text-decoration: none; line-height: 1.3; }
.contact-sub { color: var(--color-2); font-size: clamp(13px, 1vw, 16px); }

.footer-bottom {
    margin-top: clamp(24px, 3vw, 44px);
    border-top: 1px solid rgba(43, 85, 122, .28);
}
.copyright-text, .legal-link { color: var(--color-1); font-size: clamp(14px, 1.2vw, 18px); }
.legal-link { text-decoration: underline; }
.legal-link:hover { color: var(--color-2); }
.legal-links { display: flex; justify-content: flex-end; gap: 1.5rem; }
.legal-sep { display: none; }

/* Responsive dei componenti */
@media (max-width: 991.98px) {
    .page-hero .hero-text { max-width: 100%; }
}

@media (max-width: 767.98px) {
    :root { --gutter: 6px; }
    body { background: #f4f6fc; }

    header { top: 18px; }
    .header-inner { padding-inline: 15px; }

    /* menu a tendina su mobile */
    #mainNav {
        width: 100%;
        background: rgba(255, 255, 255, .96);
        border-radius: 20px;
        padding: 20px;
        margin-top: 14px;
        box-shadow: 0 10px 30px rgba(129, 132, 194, .25);
    }

    h1 { font-size: clamp(46px, 14.5vw, 64px); }

    /* hero a tutta larghezza (senza card), come nei mockup mobile */
    .page-hero {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        min-height: 820px;
        padding: 215px 15px 60px;
    }
    .page-hero .hero-text { max-width: 100%; }
    .page-hero h1 { margin-bottom: 110px; }
    .page-hero .lead-c2 { color: var(--color-1); font-size: 15px; line-height: 1.3; max-width: 30ch; margin-bottom: 36px; }
    .page-hero .hero-art { top: 190px; bottom: auto; width: 105vw; right: -38%; opacity: .95; }
    .breadcrumb-nav { display: none; }
    .page-hero .cta, #hero .cta { font-size: 17px; }
    .page-hero .cta .bi, #hero .cta .bi { display: none; }

    .panel { padding: 28px 22px; }
    .cta-card { margin-inline: 17px; }
    .cta-card h2 { font-size: 32px; }

    /* footer mobile: tutto allineato a sinistra, link legali affiancati */
    .site-footer { background-size: 190% auto, auto; }
    .footer-inner { padding-top: 130px; padding-inline: 21px; }
    .footer-logo { width: 140px; }
    .footer-title { display: none; }
    .footer-contacts { border-top: 1px solid rgba(43, 85, 122, .2); padding-top: 22px; margin-top: 8px; }
    .footer-bottom { margin-top: 10px; border-top-color: rgba(43, 85, 122, .2); }
    .copyright-text, .legal-link { font-size: 14px; }
    .legal-links { flex-direction: row-reverse; justify-content: flex-end; gap: 6px; }
    .legal-sep { display: inline; font-size: 14px; }
}

/* 3. ANIMAZIONI (STATI INIZIALI E HOVER) */

/* Stati iniziali (evitano il flash prima di GSAP) */
.js h1 .line > span,
.js .hero-text .lead-c2,
.js .hero-text .cta,
.js .hero-img,
.js .hero-art,
.js .hero-deco-1,
.js .hero-deco-2,
.js .breadcrumb-nav,
.js [data-reveal],
.js main h2 { opacity: 0; }

/* Titolo hero: righe mascherate (la riga sale da sotto) */
h1 .line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
h1 .line > span { display: inline-block; }

/* parole dei titoli h2 spezzate da main.js */
.word { display: inline-block; will-change: transform, opacity; }

/* Barra di progresso dello scroll */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    z-index: 2000;
    background: linear-gradient(90deg, var(--color-2), #d98ae8, var(--color-1));
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}

/* Hover */
.cards { transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s; }
.cards:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 44px rgba(129, 132, 194, .28), inset 0 0 0 1px rgba(255, 255, 255, .8);
}

.cta .bi { display: inline-block; transition: transform .3s; }
.cta:hover .bi-arrow-right { transform: translateX(6px); }
.cta:hover .bi-arrow-down { transform: translateY(5px); }

.cta-demo { transition: background-color .25s, color .25s, transform .25s, box-shadow .25s; }
.cta-demo:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(43, 85, 122, .22); }

/* sottolineatura animata delle voci di menu */
nav ul li:not(:last-child) a { position: relative; }
nav ul li:not(:last-child) a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 1.5px;
    background: var(--color-1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s;
}
nav ul li:not(:last-child) a:hover::after,
nav ul li:not(:last-child) a[aria-current="page"]::after { transform: scaleX(1); }

.social-icon, .contact-icon-box { transition: transform .25s, background-color .25s, color .25s; }
.social-icon:hover, .contact-icon-box:hover { transform: translateY(-3px); }

header.scrolled .header-inner { filter: drop-shadow(0 2px 10px rgba(255, 255, 255, .8)); }

/* Movimento ridotto */
@media (prefers-reduced-motion: reduce) {
    .float { animation: none; }
    .cards, .cards:hover { transition: none; transform: none; }
}

/* 4. PAGINA: HOME (INDEX.HTML) */

/* Hero */
#hero {
    margin: 15px;
    height: clamp(640px, 64vw, 1000px);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: clamp(90px, 8vw, 120px) var(--gutter) 40px;
    background: url(../img/bg-quadro.webp) center / cover no-repeat;
    box-shadow: var(--shadow-card);
}

#hero .hero-text { position: relative; z-index: 2; max-width: 62%; }
#hero .hero-text .lead-c2 { margin-bottom: clamp(28px, 4.4vw, 70px); }

.hero-img {
    position: absolute;
    right: 5%;
    bottom: -8%;
    height: 94%;
    width: auto;
    z-index: 1;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 98%);
    mask-image: linear-gradient(to bottom, #000 78%, transparent 98%);
}

.hero-deco-1 { left: 53%; top: 87%; width: 7%; }
.hero-deco-2 { left: 82%; top: 76%; width: 18%; }

/* Sezione 1: statistiche */
#section-1 { padding: clamp(50px, 6vw, 90px) 0 clamp(40px, 5vw, 80px); }
#section-1 .cta { margin-top: clamp(10px, 2vw, 30px); }

.stats { position: relative; margin-top: clamp(40px, 5vw, 80px); }

.bean-s1 {
    left: 47%;
    top: -24vw;
    width: 31vw;
    max-width: 560px;
    z-index: 4;
}

/* Sezione avatar */
.avatar-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
        "copy  figure ."
        "left  figure right";
    grid-template-rows: auto 1fr;
    align-items: center;
}
.avatar-copy { grid-area: copy; align-self: start; padding-bottom: clamp(24px, 4vw, 64px); }
.avatar-copy .pre-titolo { margin-bottom: clamp(16px, 2.4vw, 36px); }
.avatar-intro { max-width: 31ch; margin: 0; }
.left-list { grid-area: left; margin-right: -5.5vw; }
.right-list { grid-area: right; margin-left: -5.5vw; }
.avatar-figure { grid-area: figure; justify-self: center; align-self: stretch; text-align: center; }

/* video 9:16 del corpo (sostituisce il GIF); bordi sfumati per fondersi con la card */
.central-figure {
    display: block;
    position: relative;
    z-index: 2;
    height: clamp(520px, 54vw, 830px);
    width: auto;
    aspect-ratio: 9 / 16;
    margin: calc(-1 * clamp(24px, 2.8vw, 40px)) 0;   /* occupa tutta l'altezza della card */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%),
                        linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%),
                linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
    mask-composite: intersect;
}

.data-list {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4.4vw, 4.4rem);
    margin: 0;
    padding: 0;
}
.data-list li {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.2vw, 18px);
    font-size: clamp(18px, 1.9vw, 28px);
    color: var(--color-1);
    margin: 0;
}

.icon-box {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(34px, 2.8vw, 42px);
    height: clamp(34px, 2.8vw, 42px);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 12px rgba(129, 132, 194, .25);
    font-size: clamp(15px, 1.3vw, 19px);
    transition: transform .3s, box-shadow .3s, background-color .3s, color .3s;
}
.data-list li:hover .icon-box {
    transform: scale(1.12);
    background: var(--color-2);
    color: #fff;
    box-shadow: 0 8px 18px rgba(129, 132, 194, .45);
}

/* linea con pallino che collega la voce alla figura.
   GSAP anima la variabile --line (0 → 1) per "disegnarla" */
.left-list li::after,
.right-list li::before {
    content: '';
    flex: 1;
    height: 8px;
    min-width: 40px;
    clip-path: inset(0 calc((1 - var(--line, 1)) * 100%) 0 0);
}
.left-list li::after {
    background:
        radial-gradient(circle at calc(100% - 4px) center, var(--color-2) 0 4px, transparent 4.5px),
        linear-gradient(var(--color-2), var(--color-2)) center / 100% 1px no-repeat;
}
.right-list li::before {
    background:
        radial-gradient(circle at 4px center, var(--color-2) 0 4px, transparent 4.5px),
        linear-gradient(var(--color-2), var(--color-2)) center / 100% 1px no-repeat;
}

/* Come funziona */
#come-funziona { padding: clamp(50px, 6vw, 90px) 0 clamp(60px, 7vw, 110px); }

.step { min-height: clamp(230px, 22vw, 320px); }
.step-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: clamp(24px, 3vw, 48px);
}
.step-num {
    font-size: clamp(26px, 2.6vw, 40px);
    font-weight: 500;
    color: var(--color-2);
    opacity: .75;
    transition: opacity .3s, transform .3s;
}
.step:hover .step-num { opacity: 1; transform: translateX(4px); }
.step-title { font-size: clamp(22px, 2.1vw, 32px); font-weight: 600; color: var(--color-1); }

.step-deco.sd-1 { width: 52%; right: -6%; bottom: -16%; }
.step-deco.sd-2 { width: 48%; right: 0; bottom: -16%; }
.step-deco.sd-3 { width: 40%; right: -8%; bottom: -12%; }
.step-deco.sd-4 { width: 26%; right: -8%; bottom: -10%; }

/* Piattaforma + casi d'uso (sfondo continuo) */
.soft-band {
    background: linear-gradient(180deg, #f5f6fc 0%, #eff1fa 55%, #f3f4fb 100%);
    padding-bottom: 15px;
}

#piattaforma { padding: clamp(50px, 6vw, 100px) 0 clamp(40px, 5vw, 80px); }
#piattaforma .lead-c2 { margin-bottom: clamp(30px, 4vw, 60px); }
.dash-img { filter: drop-shadow(0 20px 40px rgba(129, 132, 194, .22)); }

#use-cases { padding: clamp(20px, 3vw, 40px) 0 0; }
.case { min-height: clamp(210px, 19vw, 290px); }
.case h3 { margin-bottom: clamp(18px, 2.4vw, 36px); }

.check-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: clamp(22px, 2.1vw, 32px);
    font-weight: 600;
    color: var(--color-1);
    margin-bottom: clamp(16px, 2vw, 30px);
}
.check-list .bi { color: var(--color-2); opacity: .65; font-size: 1.3em; }
.doctor-img { margin-bottom: -15px; }

/* Responsive */
@media (max-width: 1199.98px) {
    .left-list { margin-right: -2vw; }
    .right-list { margin-left: -2vw; }
}

@media (max-width: 991.98px) {
    #hero .hero-text { max-width: 70%; }
    .hero-img { height: 80%; right: 0; }

    /* card avatar: testo, lista, video, lista (una colonna, senza linee) */
    .avatar-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "copy" "left" "figure" "right";
        gap: 1.5rem;
    }
    .left-list li::after, .right-list li::before { display: none; }
    .left-list, .right-list { margin: 0; gap: 1.2rem; }
    .avatar-copy { padding-bottom: 0; }
    .avatar-figure { margin: .5rem 0; }
    .central-figure { height: min(118vw, 640px); margin: 0; }

    .bean-s1 { top: -34vw; width: 40vw; }
}

@media (max-width: 767.98px) {
    /* hero a tutta larghezza; l'immagine del corpo sta dietro al testo */
    #hero {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        height: auto;
        min-height: 830px;
        align-items: flex-start;
        padding: 280px 15px 60px;
    }
    #hero .hero-text { max-width: 100%; }
    #hero .hero-text .lead-c2 { color: var(--color-1); max-width: 30ch; font-size: 15px; line-height: 1.3; margin-bottom: 40px; }
    .hero-img { height: 760px; right: -26%; top: 70px; bottom: auto; opacity: .95; }
    .hero-deco-1, .hero-deco-2 { display: none; }

    .bean-s1 { display: none; }

    .avatar-intro { margin-bottom: 24px; }
    .data-list li { font-size: 18px; }

    .step { min-height: 200px; }
    .step-deco.sd-1 { width: 38%; }
    .step-deco.sd-2 { width: 34%; }
    .step-deco.sd-3 { width: 30%; }
    .step-deco.sd-4 { width: 20%; }
}

/* 5. PAGINA: CHI SIAMO (CHI-SIAMO.HTML) */

/* Team */
#team { padding: clamp(40px, 5vw, 80px) 0 clamp(30px, 4vw, 60px); }
#team .lead-c2 { margin-bottom: clamp(30px, 4vw, 60px); }

.member {
    display: flex;
    min-height: clamp(260px, 25vw, 400px);
    padding: clamp(24px, 2.8vw, 44px);
    overflow: hidden;
}
.member-info { position: relative; z-index: 2; }
.member h3 { font-weight: 500; line-height: 1.12; margin-bottom: clamp(12px, 1.6vw, 24px); }
.member-role { color: var(--gray); font-size: clamp(15px, 1.2vw, 18px); margin: 0; }

/* foto ritagliata: ancorata in basso a destra della card */
.member-photo {
    position: absolute;
    right: 3%;
    bottom: 0;
    height: 92%;
    width: auto;
    max-width: 66%;
    object-fit: contain;
    object-position: right bottom;
    pointer-events: none;
}

/* mini bio: velo che sale dal basso su hover / focus / tap */
.member { position: relative; cursor: default; }
.member-info { transition: opacity .3s ease; }
.member:hover .member-info, .member:focus-within .member-info, .member.is-open .member-info { opacity: 0; }
.member-bio {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(24px, 2.8vw, 44px);
    background: linear-gradient(180deg, rgba(235, 240, 252, .78), rgba(220, 228, 250, .96));
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}
.member-bio p {
    margin: 0;
    color: var(--color-1);
    font-size: clamp(14px, 1.15vw, 17px);
    line-height: 1.5;
}
.member-bio strong { display: block; margin-bottom: 8px; font-size: clamp(16px, 1.3vw, 20px); font-weight: 600; }
.member:hover .member-bio,
.member:focus-within .member-bio,
.member.is-open .member-bio { opacity: 1; transform: none; }
.member:focus-visible { outline: 2px solid var(--color-1); outline-offset: 3px; }

/* Mission (carousel Bootstrap) */
#mission { padding: clamp(20px, 3vw, 50px) 0; }

.mission-card {
    height: auto;
    min-height: clamp(150px, 13vw, 200px);
    display: flex;
    align-items: center;
}
.mission-title {
    font-size: clamp(34px, 4vw, 60px);
    font-weight: 500;
    color: var(--color-2);
    margin-bottom: clamp(10px, 1.4vw, 20px);
}
.mission-lead {
    font-size: clamp(18px, 1.7vw, 26px);
    line-height: 1.25;
    margin: 0;
    max-width: 32ch;
}
.mission-text { color: var(--color-2); font-size: clamp(14px, 1.1vw, 17px); line-height: 1.35; margin: 0; }

/* pallini di navigazione sotto la card */
#missionCarousel .carousel-indicators {
    position: static;
    margin: 22px 0 0;
}
#missionCarousel .carousel-indicators [data-bs-target] {
    width: 9px;
    height: 9px;
    margin: 0 5px;
    border: 0;
    border-radius: 50%;
    background-color: var(--color-2);
    opacity: .45;
    transition: opacity .3s, transform .3s;
}
#missionCarousel .carousel-indicators .active { opacity: 1; background-color: var(--color-1); transform: scale(1.3); }

/* Traguardi */
#traguardi { padding: clamp(30px, 4vw, 60px) 0 clamp(60px, 8vw, 140px); }

.milestones { position: relative; margin-top: clamp(24px, 3vw, 44px); min-height: clamp(300px, 34vw, 520px); }

.milestones-card { width: 62%; z-index: 2; height: auto; padding: clamp(28px, 3.4vw, 54px); }
.milestones-card .lead-c1 { font-size: clamp(16px, 1.3vw, 20px); max-width: 36ch; margin-bottom: clamp(24px, 3vw, 48px); }

/* la bolla parte dal bordo destro della card ed è dietro di essa */
.milestones-art {
    right: -3%;
    top: -26%;
    width: 44%;
    z-index: 1;
}

.milestone-num {
    font-size: clamp(34px, 3.6vw, 56px);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(129, 132, 194, .45);
}
.milestone-label { font-size: clamp(14px, 1.1vw, 17px); color: var(--color-1); margin: 0; }

/* Responsive */
@media (max-width: 991.98px) {
    .milestones-card { width: 100%; }
    .milestones-art { position: relative; display: block; margin: -40px 0 0 auto; width: 70%; right: -4%; top: 0; }
    .milestones { min-height: 0; }
}

@media (max-width: 767.98px) {
    #team { padding-top: 50px; }

    .member { min-height: 340px; padding: 28px 24px; }
    .member h3 { font-size: 26px; font-weight: 600; }
    .member-role { font-size: 18px; color: var(--color-1); }
    .member-photo { height: 86%; max-width: 64%; right: 0; }

    .mission-card { align-items: flex-start; min-height: 340px; padding: 34px 26px; }
    .mission-title { color: var(--color-1); font-weight: 600; font-size: 28px; }
    .mission-lead { font-size: 18px; margin-bottom: 40px; }
    .mission-text { font-size: 14px; }

    /* traguardi: una sola colonna di numeri, bolla che esce dal fondo della card */
    .milestones { margin-bottom: 230px; }
    .milestones-card { padding: 32px 28px 40px; }
    .milestones-card .lead-c1 { font-size: 21px; max-width: none; margin-bottom: 36px; }
    .milestone-stats { row-gap: 52px; }
    .milestone-num { font-size: 64px; font-weight: 400; color: #4a6b95; padding-bottom: 14px; max-width: 230px; }
    .milestone-label { font-size: 20px; color: #4a6b95; }
    .milestones-art { position: absolute; right: -16%; top: auto; bottom: -250px; width: 54%; margin: 0; z-index: 3;
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%);
        mask-image: linear-gradient(to right, transparent 0, #000 30%); }
}

/* 6. PAGINA: CONTATTI (CONTATTI.HTML) */

.contact-hero { padding-bottom: clamp(50px, 6vw, 100px); }
.contact-hero h1 { margin-bottom: clamp(20px, 3vw, 44px); }
.contact-hero .hero-text { max-width: 78%; }

/* bolle iridescenti sullo sfondo (dietro al testo) */
.contact-blob { z-index: 1; }
.contact-blob-1 { right: 12%; top: 5%; width: 24%; }
.contact-blob-2 { right: -6%; top: 20%; width: 34%; }
.contact-blob-3 { right: 2%; top: 1%; width: 34%; }

.contact-body { position: relative; z-index: 2; margin-top: clamp(40px, 5vw, 80px); }

/* Form */
.demo-form {
    padding: clamp(18px, 2vw, 32px);
    background: rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: var(--radius);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.demo-form .form-control {
    background: rgba(255, 255, 255, .7);
    border: 1px solid transparent;
    border-radius: 40px;
    padding: 13px 22px;
    font-size: 16px;
    color: var(--color-1);
    box-shadow: 0 4px 14px rgba(129, 132, 194, .12);
}
.demo-form textarea.form-control { border-radius: 24px; min-height: 130px; resize: vertical; }
.demo-form .form-control::placeholder { color: var(--color-2); opacity: .9; }
.demo-form .form-control:focus {
    background: #fff;
    border-color: var(--color-2);
    box-shadow: 0 0 0 4px rgba(129, 132, 194, .22);
}
.demo-form .form-control.is-invalid { border-color: #d6546a; background-image: none; }
.demo-form .invalid-feedback { padding-left: 22px; font-size: 14px; }

.form-privacy { font-size: 14px; color: var(--color-2); line-height: 1.35; margin: 4px 6px 0; }
.form-privacy a { color: inherit; }

.btn-submit {
    width: 100%;
    margin-top: 6px;
    padding: 14px 24px;
    border: 0;
    border-radius: 40px;
    background: linear-gradient(90deg, #aeb2ea, #b9b3e9);
    color: #fff;
    font-size: clamp(20px, 1.9vw, 28px);
    font-weight: 600;
    transition: transform .25s, box-shadow .25s, background .25s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(129, 132, 194, .4); background: linear-gradient(90deg, #8184C2, #9b8fd4); }
.btn-submit:disabled { opacity: .6; transform: none; box-shadow: none; }

/* messaggio di conferma al posto del form */
.form-success { text-align: center; padding: clamp(30px, 5vw, 70px) 10px; }
.form-success .bi { font-size: 54px; color: var(--color-2); }
.form-success h3 { margin: 14px 0 10px; }
.form-success p { color: var(--color-2); margin: 0; }

/* Cosa vedrai nella demo */
.demo-list { margin: 0; padding: 0; }
.demo-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 14px;
    font-size: clamp(16px, 1.4vw, 21px);
}
.demo-list li::before {
    content: '';
    position: absolute;
    left: 0; top: .6em;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--color-1);
}

/* Altri contatti */
.other-contacts { margin-top: clamp(50px, 7vw, 120px); }

/* grande card in vetro che contiene i tre uffici */
.other-contacts-card { height: auto; padding: clamp(16px, 2vw, 30px); border-radius: 36px; }
.contact-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(30px, 4vw, 60px);
    min-height: clamp(170px, 14vw, 230px);
    height: 100%;
    padding: clamp(24px, 2.2vw, 36px);
    background: rgba(255, 255, 255, .55);
    border-radius: 26px;
    box-shadow: 0 6px 22px rgba(129, 132, 194, .14);
}
.contact-card h3 { font-size: clamp(22px, 2vw, 30px); font-weight: 600; line-height: 1.15; }
.contact-mail { color: var(--color-2); font-size: clamp(14px, 1.15vw, 17px); text-decoration: none; word-break: break-all; }
.contact-mail:hover { color: var(--color-1); }

@media (max-width: 991.98px) {
    .contact-hero .hero-text { max-width: 100%; }
    .contact-blob-1 { right: 4%; top: 3%; width: 36%; }
    .contact-blob-2 { right: -14%; top: 14%; width: 46%; }
    .contact-blob-3 { right: 0; top: 1%; width: 34%; }
}

@media (max-width: 767.98px) {
    /* bolle dietro al titolo, come nel mockup mobile */
    .contact-hero { min-height: 0; padding-bottom: 60px; }
    .contact-hero h1 { margin-bottom: 190px; }
    .contact-blob-1 { right: 4%; top: 150px; width: 58%; }
    .contact-blob-2 { right: -16%; top: 330px; width: 42%; }
    .contact-blob-3 { display: block; left: -2%; right: auto; top: 385px; width: 66%; }

    .contact-body { margin-top: 70px; }
    .contact-body h2 { font-size: 36px; }

    .demo-form { padding: 26px 20px; border-radius: 34px; }
    .demo-form .form-control { padding: 22px 26px; font-size: 18px; border-radius: 40px; }
    .demo-form textarea.form-control { min-height: 170px; border-radius: 34px; }
    .form-privacy { font-size: 14px; margin: 26px 6px 4px; }
    .btn-submit { font-size: 22px; padding: 18px 24px; }

    .demo-list li { padding-left: 24px; font-size: 18px; }
    .demo-list li::before { width: 9px; height: 9px; background: var(--color-2); top: .5em; }

    .other-contacts-card { padding: 18px; }
    .contact-card { min-height: 200px; }
    .contact-card h3 { font-size: 26px; }
    .contact-mail { font-size: 17px; }
}

/* 7. PAGINA: SOLUZIONI (SOLUZIONI.HTML) */

/* l'hero contiene anche la sezione "piattaforma" */
.solutions-hero { padding-bottom: clamp(24px, 3vw, 44px); }
.solutions-hero .hero-text { max-width: 100%; }
.solutions-hero h1 { margin-bottom: clamp(40px, 6vw, 90px); }
.solutions-hero .hero-art { width: clamp(400px, 76vw, 1200px); right: -16%; bottom: auto; top: -14%; }

.platform { position: relative; z-index: 2; margin-top: clamp(150px, 22vw, 360px); }
.platform .lead-gray { max-width: 36ch; font-size: clamp(16px, 1.4vw, 21px); }

.dash-card { height: auto; padding: clamp(10px, 1.2vw, 18px); }
.dash-card img { display: block; width: 100%; height: auto; border-radius: 22px; }

/* tab delle schermate (solo mobile) */
.sol-tabs { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 14px; padding: 4px 2px 8px; scrollbar-width: none; }
.sol-tabs::-webkit-scrollbar { display: none; }
.sol-tab {
    flex: none;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--color-1);
    font: inherit;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(129, 132, 194, .22);
    cursor: pointer;
}
.sol-tab.is-active { background: #b4b6e6; color: #fff; }
.sol-caption { margin: 16px 2px 0; color: var(--color-2); font-size: 17px; line-height: 1.35; }

/* "Pensato per chi prende decisioni": card con foto */
.pros { padding: clamp(30px, 4vw, 70px) 0 clamp(20px, 3vw, 50px); }
.pros h2 { max-width: 15ch; margin-bottom: clamp(30px, 4vw, 60px); }
.pro-card { height: 100%; padding: clamp(8px, .9vw, 14px) clamp(8px, .9vw, 14px) clamp(18px, 1.6vw, 28px); }
.pro-card:hover { transform: none; }
.pro-img { display: block; width: 100%; height: auto; margin-bottom: clamp(14px, 1.6vw, 24px); }
.pro-card h3 { font-size: clamp(18px, 1.5vw, 23px); font-weight: 600; margin-bottom: 8px; padding-inline: clamp(8px, 1vw, 16px); }
.pro-card p { font-size: clamp(14px, 1.1vw, 17px); line-height: 1.3; margin: 0; padding-inline: clamp(8px, 1vw, 16px); }

/* "Dal dato alla decisione" + onda olografica */
.experts {
    position: relative;
    padding: clamp(50px, 6vw, 100px) 0 clamp(120px, 14vw, 240px);
    background: url('../img/holo-element2.webp') center bottom / 100% auto no-repeat;
}
.experts h2 { max-width: 15ch; margin-bottom: clamp(50px, 8vw, 130px); }
.experts .row { position: relative; z-index: 2; }

.solution-card {
    display: flex;
    flex-direction: column;
    min-height: clamp(210px, 17vw, 260px);
    padding: clamp(18px, 1.6vw, 26px);
}
.solution-card h3 { font-size: clamp(18px, 1.5vw, 23px); font-weight: 600; margin-bottom: clamp(18px, 2vw, 30px); }
.solution-card p { font-size: clamp(15px, 1.2vw, 18px); line-height: 1.25; max-width: 14ch; margin: 0; }
.solution-num {
    margin-top: auto;
    align-self: flex-end;
    font-size: clamp(30px, 2.6vw, 40px);
    font-weight: 500;
    color: var(--color-2);
    opacity: .75;
    line-height: 1;
}

@media (max-width: 991.98px) {
    .experts { background-size: 220% auto; background-position: 70% bottom; }
}

@media (max-width: 767.98px) {
    .solutions-hero .hero-art {
        width: 150vw; right: -72%; top: 240px;
        -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%);
                mask-image: linear-gradient(to bottom, transparent, #000 14%);
    }
    .platform { margin-top: 220px; }

    /* le card dei passaggi si dispongono a zig-zag, come nel mockup */
    .solution-steps .solution-card { width: 78%; min-height: 0; }
    .solution-steps .col:nth-child(even) .solution-card { margin-left: auto; }
    .solution-card p { max-width: 16ch; }
    .pros { padding-top: 10px; }
    .pro-card h3 { font-size: 22px; }
    .pro-card p { font-size: 17px; }
}

/* 8. PAGINA: TECNOLOGIA (TECNOLOGIA.HTML) */

.tech-hero .hero-art { width: clamp(300px, 56vw, 860px); right: -6%; bottom: -4%; }
@media (max-width: 767.98px) { .tech-hero .hero-art { width: 120vw; right: -44%; top: 200px; } }

/* Architettura a livelli */
#architettura { padding: clamp(50px, 6vw, 100px) 0 clamp(30px, 4vw, 60px); }
#architettura .lead-gray { max-width: 70ch; margin-bottom: clamp(30px, 4vw, 60px); }

.layers-stack { display: block; width: 100%; height: auto; }

/* colonna dei 5 livelli: linea verticale + un pallino per card */
.layer-list {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    height: 100%;
    padding-left: clamp(26px, 3vw, 44px);
}
.layer-list::before {
    content: '';
    position: absolute;
    left: 5px; top: 8px; bottom: 8px;
    width: 1px;
    background: var(--color-1);
    opacity: .5;
    transform: scaleY(var(--line-scale, 1));   /* GSAP: 0 → 1 */
    transform-origin: top;
}

.layer {
    flex: 1;
    height: auto;
    padding: clamp(14px, 1.4vw, 22px) clamp(18px, 1.8vw, 28px);
    border-radius: 18px;
}
.layer::before {
    content: '';
    position: absolute;
    left: calc(-1 * clamp(26px, 3vw, 44px) + 1px);
    top: 22px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--color-1);
}
.layer-plate { display: none; }   /* solo mobile: una piastra per ogni livello */
.layer h3 { font-size: clamp(17px, 1.5vw, 22px); font-weight: 600; margin-bottom: 6px; }

.layer-body { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.layer-body p { font-size: clamp(14px, 1.15vw, 17px); line-height: 1.3; max-width: 30ch; margin: 0; }

.layer-bullets {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(4, auto);
    column-gap: clamp(20px, 2.4vw, 40px);
    margin: 0;
    padding: 0;
    font-size: clamp(12px, .95vw, 14px);
    color: var(--color-1);
}
.layer-bullets li { position: relative; padding-left: 12px; white-space: nowrap; }
.layer-bullets li::before { content: '•'; position: absolute; left: 0; }

/* Spiegabile e supervisionato */
#supervisionato { padding: clamp(40px, 5vw, 80px) 0 clamp(20px, 3vw, 40px); }
#supervisionato h2 { max-width: 12ch; }

/* desktop: griglia 3 colonne (card | telefono | card) con le scritte tra le card.
   .sup-cards usa display: contents, così le sue card entrano direttamente nella griglia */
.supervised {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto 1fr auto;
    gap: clamp(14px, 1.6vw, 24px);
    align-items: stretch;
}
.sup-cards { display: contents; }

.sup-card:nth-child(1) { grid-column: 1; grid-row: 1; }
.sup-label-left        { grid-column: 1; grid-row: 2; }
.sup-card:nth-child(3) { grid-column: 1; grid-row: 3; }
.sup-card:nth-child(4) { grid-column: 3; grid-row: 1; }
.sup-label-right       { grid-column: 3; grid-row: 2; }
.sup-card:nth-child(6) { grid-column: 3; grid-row: 3; }
.sup-phone             { grid-column: 2; grid-row: 1 / 4; }

.sup-card { display: flex; flex-direction: column; min-height: clamp(170px, 15vw, 230px); height: auto; }
.sup-card h3 { font-size: clamp(18px, 1.5vw, 23px); max-width: 12ch; margin-bottom: clamp(14px, 2vw, 28px); }
.sup-card p { font-size: clamp(14px, 1.15vw, 17px); line-height: 1.3; max-width: 26ch; margin: 0; }
.sup-num {
    margin-top: auto;
    align-self: flex-end;
    font-size: clamp(26px, 2.4vw, 36px);
    font-weight: 500;
    color: var(--color-2);
    opacity: .75;
    line-height: 1;
}

.sup-label {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: clamp(22px, 2.2vw, 34px);
    font-weight: 500;
    text-align: center;
}

/* telefono con il video: cornice lilla e angoli come nell'immagine originale */
.sup-phone {
    position: relative;
    height: clamp(440px, 44vw, 660px);
    aspect-ratio: 9 / 16;
    align-self: center;
    padding: clamp(5px, .5vw, 8px);
    background: #9a9dd0;
    border-radius: 14.8% / 8.2%;
    overflow: hidden;
}
.sup-phone video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13% / 7.2%;
}
.sup-sound {
    position: absolute;
    top: 4.5%;
    right: 20%;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: var(--color-1);
    font-size: 17px;
    cursor: pointer;
}
.sup-sound:hover { background: #fff; }

/* elementi solo-mobile */
.sup-dots, .sup-mobile-title { display: none; }

/* Responsive */
@media (max-width: 991.98px) {
    .layers-stack { max-width: 260px; margin: 0 auto 28px; }
    .layer-body { flex-direction: column; align-items: flex-start; gap: 12px; }

    /* tablet: una colonna, telefono sopra alle card */
    .supervised { grid-template-columns: 1fr; grid-template-rows: none; }
    .sup-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .sup-cards > * { grid-column: auto !important; grid-row: auto !important; }
    .sup-label { grid-column: 1 / -1 !important; padding: 6px 0; }
    .sup-phone { grid-column: 1; grid-row: 1; justify-self: center; height: min(120vw, 560px); margin-bottom: 20px; }
}

@media (max-width: 767.98px) {
    #architettura { padding-top: 60px; }

    /* livelli: card chiare con la piastra che sporge in alto a destra
       e la linea verticale che attraversa tutto l'elenco */
    .layer-list { gap: 120px; padding-left: 0; margin-top: 90px; height: auto; }
    .layer-list::before { left: auto; right: 38px; top: -40px; bottom: 30px; z-index: 5; opacity: .45; }

    .layer {
        position: relative;
        padding: 30px 58px 28px 24px;
        border-radius: 28px;
        background: rgba(255, 255, 255, .78);
        overflow: visible;
    }
    .layer::before { display: none; }
    .layer-plate {
        display: block;
        position: absolute;
        right: -26px;
        top: -92px;
        width: 64%;
        height: auto;
        z-index: 4;
        pointer-events: none;
    }
    .layer h3 { font-size: 28px; margin-bottom: 18px; position: relative; z-index: 2; }
    .layer-body { gap: 22px; }
    .layer-body p { font-size: 20px; line-height: 1.3; max-width: none; }
    .layer-bullets { grid-auto-flow: row; grid-template-rows: none; font-size: 17px; row-gap: 4px; padding-left: 8px; }
    .layer-bullets li { white-space: normal; padding-left: 16px; }

    /* carousel orizzontale con scroll-snap */
    .sup-panel { margin: 20px 0 0; padding: 0; background: none; box-shadow: none; border-radius: 0; overflow: visible; }
    .supervised { display: flex; flex-direction: column; gap: 0; }
    .sup-cards {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 6px 21px 18px;
        scrollbar-width: none;
    }
    .sup-cards::-webkit-scrollbar { display: none; }
    .sup-label { display: none; }
    .sup-card { flex: 0 0 86%; scroll-snap-align: start; min-height: 260px; padding: 30px 26px; }
    .sup-card h3 { font-size: 26px; max-width: none; }
    .sup-card p { font-size: 17px; max-width: none; }
    .sup-num { font-size: 48px; color: #c3c6ee; opacity: 1; }

    .sup-dots { display: flex; justify-content: center; gap: 12px; padding: 4px 0 40px; }
    .sup-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-2); opacity: .45; transition: all .3s; }
    .sup-dot.active { width: 14px; height: 14px; margin-top: -2px; background: var(--color-1); opacity: 1; }

    .sup-mobile-title { display: block; font-size: 28px; font-weight: 600; padding: 0 21px; margin-bottom: 30px; }
    .sup-phone { height: auto; width: 74%; margin: 0 auto; }
}

/* 9. PAGINA: USE CASES (USE-CASES.HTML) */

.cases-hero .hero-art { width: clamp(300px, 56vw, 880px); right: -4%; bottom: 4%; }
.cases-hero { min-height: clamp(520px, 50vw, 800px); }

#casi { padding: clamp(40px, 6vw, 100px) 0 clamp(30px, 4vw, 60px); }
.case-list { display: flex; flex-direction: column; gap: clamp(50px, 6vw, 100px); }

.case-wide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    column-gap: clamp(20px, 3vw, 50px);
    min-height: clamp(220px, 20vw, 300px);
    height: auto;
    padding: clamp(28px, 3.2vw, 52px);
}
.case-title h3 { font-size: clamp(28px, 3vw, 46px); font-weight: 600; line-height: 1.1; margin-bottom: clamp(12px, 1.6vw, 24px); }
.case-title p { font-size: clamp(15px, 1.2vw, 18px); max-width: 22ch; margin: 0; }
.case-text { color: var(--color-2); font-size: clamp(14px, 1.15vw, 17px); line-height: 1.35; max-width: 30ch; margin: 0; }

/* oggetto 3D: davanti alla card, più alto della card stessa */
.case-art {
    position: absolute;
    top: -25%;
    height: 150%;
    width: auto;
    max-width: 38%;
    object-fit: contain;
    z-index: 4;            /* posizionato senza transform: lo usa GSAP per la fluttuazione */
}

/* Oggetto a sinistra: testi nelle colonne 2 e 3 */
.case-art-left .case-art { left: -1.5%; }
.case-art-left .case-title { grid-column: 2; grid-row: 1; }
.case-art-left .case-text  { grid-column: 3; grid-row: 1; }

/* Oggetto a destra: testi nelle colonne 1 e 2 */
.case-art-right .case-art { right: -1.5%; }
.case-art-right .case-title { grid-column: 1; grid-row: 1; }
.case-art-right .case-text  { grid-column: 2; grid-row: 1; }

/* Oggetto al centro: paragrafo a sinistra, titolo a destra (allineato a destra) */
.case-art-center .case-art { left: 50%; margin-left: -9%; }
.case-art-center .case-text  { grid-column: 1; grid-row: 1; }
.case-art-center .case-title { grid-column: 3; grid-row: 1; text-align: right; }
.case-art-center .case-title p { margin-left: auto; }

#casi-cta { padding-bottom: 15px; }

/* Responsive */
@media (max-width: 991.98px) {
    .case-wide { grid-template-columns: 1fr; row-gap: 14px; padding-top: 0; }

    /* l'oggetto passa in cima, sporgendo dal bordo superiore */
    .case-art {
        position: relative;
        top: auto; left: auto; right: auto; margin: -50px auto 0;
        height: auto;
        width: min(60%, 260px);
        max-width: none;
    }
    .case-art-left .case-art, .case-art-right .case-art, .case-art-center .case-art { left: auto; right: auto; margin: -50px auto 0; }
    .case-art-left .case-title, .case-art-left .case-text,
    .case-art-right .case-title, .case-art-right .case-text,
    .case-art-center .case-title, .case-art-center .case-text { grid-column: 1; grid-row: auto; text-align: left; }
    .case-art-center .case-title p { margin-left: 0; }
    .case-art-center .case-title { order: 1; }
    .case-art-center .case-text { order: 2; }
    .case-list { gap: 90px; }
    .case-wide { margin-top: 50px; }
}

/* 10. PAGINA: DEMO (demo.html) */

/* Pagina demo */
.demo-section { padding: clamp(100px, 9vw, 130px) 0 30px; }

/* Shell: barra laterale + area principale */
.plat {
    /* colori del tema chiaro (il tema scuro li ridefinisce più in basso) */
    --p-bg: #ececf1;
    --p-card-a: #f4f6fd;
    --p-card-b: #e3e7f8;
    --p-inner: #f8f9fe;
    --p-ink: #1c3b66;
    --p-muted: #5f7092;
    --p-line: rgba(43, 85, 122, .18);
    --p-pill: #d4d6f1;
    --p-active: #9b9ed6;
    --p-accent: #7478bd;
    --p-paper: #fff;
    --p-shadow: 0 14px 34px rgba(129, 132, 194, .2), inset 0 0 0 1px rgba(255, 255, 255, .75);

    display: grid;
    grid-template-columns: clamp(190px, 16vw, 250px) minmax(0, 1fr);
    gap: 12px;
    font-size: calc(16px * var(--plat-fs, 1));
    color: var(--p-ink);
}

.plat-side,
.plat-main {
    border-radius: 40px;
    background: var(--p-bg);
    box-shadow: inset 0 0 0 1px rgba(43, 85, 122, .1);
}

.plat-side {
    display: flex;
    flex-direction: column;
    padding: 26px 16px 22px;
}
.plat-logo { display: block; padding: 0 12px 6px; }
.plat-logo img { width: min(150px, 100%); height: auto; }

.plat-nav { display: flex; flex-direction: column; gap: 4px; margin: clamp(30px, 6vw, 80px) 0 auto; }
.plat-nav button,
.plat-logout {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 11px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--p-ink);
    font: inherit;
    font-size: .94em;
    text-align: left;
    cursor: pointer;
    transition: background .2s;
}
.plat-nav button i, .plat-logout i { font-size: 1.25em; }
.plat-nav button:hover, .plat-logout:hover { background: rgba(155, 158, 214, .22); }
.plat-nav button.is-active { background: var(--p-pill); font-weight: 500; }
.plat-logout { margin-top: 26px; border-top: 1px solid var(--p-line); border-radius: 0 0 999px 999px; padding-top: 22px; color: var(--p-muted); }

.plat-main { padding: clamp(18px, 2.4vw, 40px); min-width: 0; }

/* focus visibile su tutti i controlli dell'app */
.plat :focus-visible { outline: 3px solid var(--p-accent); outline-offset: 2px; }

/* Intestazione */
.plat-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: clamp(18px, 2.4vw, 34px); }
.plat-hello { font-size: 1.9em; line-height: 1.15; font-weight: 600; color: var(--p-ink); }
.plat-greeting p { margin: 6px 0 0; color: var(--p-muted); font-size: 1.02em; }
.plat-pills { display: flex; flex-wrap: wrap; gap: 14px; }

.plat-patient { position: relative; }
.plat-pillbox {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 230px;
    padding: 12px 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--p-card-a), var(--p-card-b));
    box-shadow: var(--p-shadow);
    color: var(--p-ink);
    font: inherit;
    text-align: left;
}
button.plat-pillbox { cursor: pointer; justify-content: space-between; }
.plat-pillbox span { display: block; line-height: 1.35; }
.plat-pillbox small { display: block; color: var(--p-muted); font-size: .98em; }
.plat-pillbox span > small:first-child { color: var(--p-ink); font-size: 1.1em; }
.plat-pillbox b { font-weight: 600; }
.plat-pillbox .bi { font-size: 1.1em; transition: transform .2s; }
.plat-pillbox[aria-expanded="true"] .bi { transform: rotate(180deg); }

.plat-menu {
    position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; left: 0;
    margin: 0; padding: 8px; list-style: none;
    border-radius: 24px;
    background: var(--p-inner);
    box-shadow: 0 18px 40px rgba(43, 85, 122, .25);
}
.plat-menu button {
    display: block; width: 100%; padding: 10px 14px; border: 0; border-radius: 16px;
    background: transparent; color: var(--p-ink); font: inherit; font-size: .92em; text-align: left; cursor: pointer;
}
.plat-menu button:hover, .plat-menu button[aria-selected="true"] { background: var(--p-pill); }

/* Vista */
#platView { display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 24px); outline: none; }
#platView.is-in > * { animation: plat-in .5s cubic-bezier(.2, .7, .2, 1) both; }
#platView.is-in > *:nth-child(2) { animation-delay: .06s; }
#platView.is-in > *:nth-child(3) { animation-delay: .12s; }
@keyframes plat-in { from { opacity: 0; transform: translateY(14px); } }

.plat[data-motion="off"] *, .plat[data-motion="off"] *::before, .plat[data-motion="off"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    .plat *, .plat *::before, .plat *::after { animation: none !important; transition: none !important; }
}

/* Componenti */
.plat-card {
    position: relative;
    padding: clamp(18px, 1.8vw, 28px);
    border-radius: 34px;
    background: linear-gradient(150deg, var(--p-card-a), var(--p-card-b));
    box-shadow: var(--p-shadow);
    min-width: 0;
}
.plat-card.is-inner { border-radius: 28px; background: var(--p-inner); box-shadow: 0 8px 22px rgba(129, 132, 194, .18); padding: 20px; }
.plat-card-title { margin: 0 0 clamp(14px, 1.6vw, 22px); font-size: .95em; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--p-ink); }
.plat-card h4 { margin: 0 0 10px; font-size: .9em; font-weight: 600; text-transform: uppercase; color: var(--p-ink); }
.plat-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.plat-card-head .plat-card-title { margin: 0; }

.plat-btn {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 22px; border: 0; border-radius: 999px;
    background: var(--p-pill); color: var(--p-ink);
    font: inherit; font-size: .84em; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; text-decoration: none;
    cursor: pointer; transition: background .2s, transform .2s;
}
.plat-btn:hover { background: var(--p-active); color: #fff; }
.plat-btn.is-solid { justify-content: center; background: var(--p-active); color: #fff; }
.plat-btn.is-solid:hover { background: var(--p-accent); }
.plat-btn:disabled { opacity: .55; cursor: not-allowed; background: var(--p-pill); color: #fff; }
.plat-card > .plat-btn:last-child { margin-top: 20px; width: 100%; max-width: 330px; }

.plat-link { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--p-accent); font: inherit; font-size: .85em; text-decoration: underline; cursor: pointer; }
.plat-icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: var(--p-pill); color: var(--p-ink); font-size: 1em; cursor: pointer; transition: background .2s;
}
.plat-icon-btn:hover { background: var(--p-active); color: #fff; }
.plat-icon-btn.is-plain { background: none; font-size: 1.2em; }

.plat-pill {
    display: inline-block; min-width: 100px; padding: 4px 14px; border-radius: 999px;
    text-align: left; font-size: .92em; font-weight: 500; background: var(--p-pill);
}
.plat-pill.is-ok { background: #c6e5bf; color: #14502b; }
.plat-pill.is-warn { background: #f3e5ac; color: #5f4a05; }
.plat-pill.is-bad { background: #f4c9cd; color: #7a1620; }

.plat-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); }
.plat-grid-3 > .plat-card { display: flex; flex-direction: column; }
.plat-grid-3 > .plat-card > .plat-btn:last-child { margin-top: auto; }

.plat-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0 0 8px; font-size: .94em; }
.plat-dl dt { color: var(--p-muted); font-weight: 400; }
.plat-dl dd { margin: 0; text-align: left; }
.plat-dl.is-pills { gap: 14px 20px; align-items: center; }
.plat-dl.is-lines { gap: 0; }
.plat-dl.is-lines dt, .plat-dl.is-lines dd { padding: 10px 0; border-bottom: 1px solid var(--p-line); }
.plat-dl.is-lines dd { text-align: left; padding-left: 8px; }
.plat-grid-3 .plat-dl.is-lines { margin-bottom: 30px; }
.plat-dl .is-ok, .plat-profile .is-ok { color: #1c6b3a; }
.plat-profile .is-warn { color: #8a6d0a; }
.plat-profile .is-bad { color: #b0242f; }

/* Home */
.plat-stat { padding: 8px 0 14px; border-bottom: 1px solid var(--p-line); margin-bottom: 12px; }
.plat-stat > span { display: block; font-size: .94em; }
.plat-stat p { display: flex; align-items: flex-end; gap: 16px; margin: 0; }
.plat-stat b { font-size: 3em; line-height: 1.1; font-weight: 400; color: var(--p-muted); }
.plat-stat small { font-size: .88em; color: var(--p-muted); padding-bottom: 10px; }

.plat-list { display: flex; flex-direction: column; margin-bottom: 18px; }
.plat-row-btn, .plat-log {
    display: flex; flex-direction: column; gap: 3px; width: 100%;
    padding: 12px 0; border: 0; border-bottom: 1px solid var(--p-line); background: none;
    color: var(--p-ink); font: inherit; font-size: .9em; text-align: left;
}
.plat-row-btn { cursor: pointer; }
.plat-row-btn:hover strong { text-decoration: underline; }
.plat-row-btn span, .plat-log span { color: var(--p-muted); }
.plat-row-btn b { color: var(--p-ink); }

.plat-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.plat-action {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 150px;
    border: 0; border-radius: 28px; background: var(--p-inner); box-shadow: 0 8px 22px rgba(129, 132, 194, .18);
    color: var(--p-ink); font: inherit; font-size: .94em; cursor: pointer; transition: transform .25s, box-shadow .25s;
}
.plat-action i { font-size: 2.2em; }
.plat-action:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(129, 132, 194, .3); }

/* Tab */
.plat-tabs { display: flex; flex-wrap: wrap; gap: 12px; }
.plat-tab {
    padding: 9px 22px; border: 0; border-radius: 999px; background: linear-gradient(145deg, var(--p-card-a), var(--p-card-b));
    box-shadow: var(--p-shadow); color: var(--p-ink); font: inherit; font-size: .94em; cursor: pointer; transition: background .2s;
}
.plat-tab[aria-selected="true"] { background: var(--p-active); color: #fff; }

/* Patient Twin */
.plat-twin { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: clamp(14px, 1.6vw, 24px); }
.plat-twin-side { display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 24px); }
.plat-body-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .62fr); gap: 16px; padding: 0; overflow: hidden; align-items: start; }
.plat-body { position: relative; align-self: stretch; }
.plat-body img { display: block; width: 100%; height: auto; }
.plat-spot {
    position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; cursor: pointer;
}
.plat-spot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(116, 120, 189, .55); transition: box-shadow .3s, background .3s; }
.plat-spot:hover::after, .plat-spot.is-active::after { background: rgba(116, 120, 189, .22); box-shadow: 0 0 0 7px rgba(116, 120, 189, .18); }
.plat-body-info { padding: clamp(18px, 1.8vw, 28px) clamp(18px, 1.8vw, 28px) clamp(18px, 1.8vw, 28px) 0; }
.plat-program { margin: 0 0 14px; font-size: .92em; color: var(--p-muted); }
.plat-program strong { color: var(--p-ink); font-weight: 500; font-size: 1.04em; }
.plat-profiles { display: flex; flex-direction: column; border-radius: 28px; background: var(--p-inner); padding: 8px 20px; box-shadow: 0 8px 22px rgba(129, 132, 194, .18); }
.plat-profile {
    display: flex; flex-direction: column; gap: 3px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--p-line);
    background: none; color: var(--p-ink); font: inherit; font-size: .88em; text-align: left; cursor: pointer;
}
.plat-profile:last-child { border-bottom: 0; }
.plat-profile strong { font-weight: 500; font-size: 1.04em; }
.plat-profile span { color: var(--p-muted); }
.plat-profile.is-active strong { color: var(--p-accent); }
.plat-profile.is-active { box-shadow: inset 3px 0 0 var(--p-accent); padding-left: 12px; }

.plat-timeline { margin: 0; padding: 0 0 0 26px; list-style: none; border-left: 3px solid var(--p-active); }
.plat-timeline li { position: relative; display: flex; flex-direction: column; padding: 0 0 22px; font-size: .94em; }
.plat-timeline li::before { content: ''; position: absolute; left: -35px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--p-card-a); border: 3px solid var(--p-active); }
.plat-timeline time { color: var(--p-muted); font-size: .86em; }
.plat-timeline span { color: var(--p-muted); }
.plat-docs { margin: 0; padding: 0; list-style: none; }
.plat-docs li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--p-line); }
.plat-docs li > i { font-size: 1.5em; color: var(--p-accent); }
.plat-docs span { flex: 1; display: flex; flex-direction: column; font-size: .94em; }
.plat-docs small { color: var(--p-muted); }

/* Tabelle */
.plat-table-wrap { overflow-x: auto; }
.plat-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.plat-table th, .plat-table td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--p-line); vertical-align: middle; white-space: nowrap; }
.plat-table thead th { font-weight: 500; color: var(--p-ink); }
.plat-table tbody th { font-weight: 400; }
.plat-table .plat-pill { min-width: 90px; }
.plat-empty-cell { text-align: center !important; color: var(--p-muted); }
#riskTable, #cmpTable { margin-top: 12px; }

/* Risk Prediction */
.plat-risk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); }
.plat-risk-chart { grid-column: 1 / span 2; }
.plat-risk-factors { grid-column: 3; align-self: end; }
.plat-kpi-value { display: flex; flex-direction: column; margin: 0; line-height: 1.1; }
.plat-kpi-value span { font-size: 1.3em; font-weight: 500; }
.plat-kpi-value b { font-size: 3em; font-weight: 600; }
.plat-kpi-value.is-low, .plat-kpi-value.is-ok { color: #1c6b3a; }
.plat-kpi-value.is-mid { color: #a8780a; }
.plat-kpi-value.is-high { color: #b0242f; }
.plat-note { margin: 8px 0 0; color: var(--p-muted); font-size: .94em; }
.plat-kpi .plat-kpi-value + .plat-note { margin-top: 12px; }
.plat-chips { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 12px; }
.plat-chip { padding: 9px 20px; border: 0; border-radius: 999px; background: var(--p-inner); color: var(--p-ink); font: inherit; font-size: .9em; box-shadow: 0 4px 12px rgba(129, 132, 194, .2); cursor: pointer; }
.plat-chip.is-active { background: var(--p-active); color: #fff; }

.plat-factors { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.plat-factors li { display: grid; grid-template-columns: 7.5em 1fr 3em; align-items: center; gap: 10px; font-size: .92em; }
.plat-factors em { font-style: normal; text-align: right; }
.plat-bar { display: block; height: 9px; border-radius: 9px; background: rgba(129, 132, 194, .22); overflow: hidden; }
.plat-bar b { display: block; height: 100%; border-radius: 9px; background: var(--p-active); }
.plat-bar.is-wide { display: inline-block; width: 120px; margin-right: 8px; vertical-align: middle; }

/* Grafici */
.plat-chart { position: relative; width: 100%; }
.plat-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.plat-svg:focus-visible { outline-offset: 4px; border-radius: 12px; }
.plat-grid { stroke: var(--p-line); stroke-width: 1; }
.plat-axis { fill: var(--p-muted); font-size: 12px; font-family: inherit; }
.plat-end-label { fill: var(--p-ink); font-size: 13px; font-weight: 700; font-family: inherit; }
.plat-dim { fill: var(--p-card-b); fill-opacity: .6; pointer-events: none; }
.plat-focus { stroke: var(--p-accent); stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }
.plat-cross { stroke: var(--p-ink); stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 4 4; }
.plat-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: plat-draw 1.1s .1s ease forwards; }
.plat-band { animation: plat-fade .9s ease both; }
@keyframes plat-draw { to { stroke-dashoffset: 0; } }
@keyframes plat-fade { from { opacity: 0; } }
.plat[data-motion="off"] .plat-line { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .plat-line { stroke-dashoffset: 0; } }

.plat-tooltip {
    position: absolute; z-index: 5; min-width: 150px; padding: 10px 14px; border-radius: 14px; pointer-events: none;
    background: var(--p-paper); color: var(--p-ink); font-size: .84em; box-shadow: 0 10px 28px rgba(43, 85, 122, .28);
}
.plat-tooltip strong { display: block; margin-bottom: 4px; }
.plat-tip-row { display: flex; align-items: center; gap: 8px; }
.plat-tip-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.plat-tip-row b { margin-left: auto; padding-left: 14px; }
.plat-tip-extra { display: block; color: var(--p-muted); font-size: .95em; }

.plat-legend { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0 40px; padding: 0; list-style: none; font-size: .9em; color: var(--p-muted); }
.plat-legend li { display: flex; align-items: center; gap: 10px; }
.plat-legend li.is-off { opacity: .4; text-decoration: line-through; }
.plat-key { display: inline-block; width: 34px; height: 3px; border-radius: 3px; background: var(--p-accent); }
.plat-key.is-band { height: 14px; width: 40px; border-radius: 2px; background: rgba(116, 120, 189, .25); }

.plat-compare { display: grid; grid-template-columns: minmax(150px, .5fr) minmax(0, 2.4fr) minmax(130px, .5fr); gap: 20px; align-items: start; }
.plat-compare .plat-card-title { grid-column: 1 / -1; margin-bottom: 0; }
.plat-checks { align-self: end; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: .92em; }
.plat-legend-col { align-self: center; font-size: .92em; color: var(--p-muted); }
.plat-legend-col p { margin: 0 0 16px; }
.plat-legend.is-col { flex-direction: column; margin: 0; gap: 14px; }
.plat-legend.is-col .plat-key { height: 3px; }
.plat-empty { margin: 40px 0; text-align: center; color: var(--p-muted); }

.plat-checks label, .plat-goals label { display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.plat-checks input, .plat-goals input { position: absolute; opacity: 0; width: 20px; height: 20px; }
.plat-check { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--p-active); background: var(--p-inner); }
input:checked + .plat-check { background: var(--p-active); }
input:checked + .plat-check::after { content: ''; width: 5px; height: 10px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
input:indeterminate + .plat-check { background: var(--p-active); }
input:indeterminate + .plat-check::after { content: ''; width: 10px; height: 2px; background: #fff; }
input:focus-visible + .plat-check { outline: 3px solid var(--p-accent); outline-offset: 2px; }

/* Treatment Planner */
.plat-planner { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.7fr); gap: clamp(14px, 1.6vw, 24px); align-items: start; }
.plat-planner-side, .plat-planner-main { display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 24px); }
.plat-goals { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: .94em; }
.plat-textarea, .plat-input, .plat-select {
    width: 100%; border: 0; border-radius: 14px; background: var(--p-paper); color: var(--p-ink); font: inherit; font-size: .9em; padding: 12px 14px;
}
.plat-textarea { resize: vertical; min-height: 120px; margin-bottom: 14px; }
.plat-textarea.is-short { min-height: 70px; }
.plat-notes { margin: 14px 0 0; padding: 0; list-style: none; font-size: .88em; }
.plat-notes li { padding: 8px 0; border-top: 1px solid var(--p-line); }
.plat-notes time { display: block; color: var(--p-muted); font-size: .9em; }

.plat-table-wrap.is-paper { border-radius: 28px; background: var(--p-paper); padding: 6px 18px 6px 52px; box-shadow: 0 8px 22px rgba(129, 132, 194, .2); position: relative; }
.plat-table.is-plan td, .plat-table.is-plan th { padding: 14px 10px; }
.plat-table.is-plan td:first-child { position: relative; }
.plat-table.is-plan strong { display: block; font-weight: 500; }
.plat-table.is-plan small { color: var(--p-muted); font-size: .82em; }
.plat-dot { position: absolute; left: -33px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--p-paper); border: 3px solid var(--p-active); z-index: 1; }
.plat-table.is-plan tr.is-done .plat-dot { background: var(--p-active); }
.plat-table.is-plan tbody tr:not(:last-child) td:first-child::after { content: ''; position: absolute; left: -26.5px; top: 50%; height: 100%; width: 3px; background: var(--p-active); }
.plat-table.is-plan tbody tr:first-child td:first-child::before { content: none; }
.plat-status { padding: 4px 16px; border: 0; border-radius: 999px; background: var(--p-pill); color: var(--p-muted); font: inherit; font-size: .92em; cursor: pointer; }
.plat-status.is-ok { background: #c6e5bf; color: #14502b; }

.plat-drugs { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.plat-drug { display: flex; flex-direction: column; gap: 4px; padding: 14px 20px; border-radius: 14px; background: var(--p-paper); box-shadow: 0 6px 16px rgba(129, 132, 194, .15); font-size: .94em; }
.plat-drug small { color: var(--p-muted); }
.plat-drugform { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.plat-drugform .plat-input { flex: 1 1 200px; width: auto; }
.plat-drugform[hidden] { display: none; }

/* Clinical Report */
.plat-report { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: clamp(14px, 1.6vw, 24px); align-items: start; }
.plat-gen { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px; border: 0; border-radius: 999px; background: var(--p-paper); color: var(--p-ink); font: inherit; font-size: .84em; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; cursor: pointer; box-shadow: 0 4px 12px rgba(129, 132, 194, .2); }
.plat-gen:hover { background: var(--p-active); color: #fff; }
.plat-gen.is-busy i { animation: plat-spin 1s linear infinite; }
@keyframes plat-spin { to { transform: rotate(360deg); } }
.plat-paper { max-height: 640px; overflow-y: auto; padding: 24px clamp(18px, 2.4vw, 36px) 28px; border-radius: 28px; background: var(--p-paper); font-size: .9em; line-height: 1.6; }
.plat-paper p { margin: 0 0 10px; }
.plat-paper ul { margin: 0 0 14px; padding-left: 20px; }
.plat-paper h4 { margin: 20px 0 6px; color: var(--p-ink); }
.plat-made { font-size: .84em; color: var(--p-muted); }
.plat-made b { color: var(--p-ink); }
.plat-made b span { color: var(--p-active); }
.plat-org { margin: 22px 0 14px !important; font-weight: 600; font-size: 1.05em; color: #14693a; }
.plat-org i { font-size: 1.1em; }
.plat-fine { margin-top: 18px !important; font-size: .82em; color: var(--p-muted); }
.plat-paper-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.plat-paper-actions h4 { width: 100%; margin: 0 0 4px; }
.plat-preview.is-full { position: fixed; z-index: 1050; inset: 12px; border-radius: 28px; overflow: auto; background: var(--p-bg); }
.plat-preview.is-full .plat-paper { max-height: none; }
body.plat-noscroll { overflow: hidden; }

/* Research */
.plat-search { position: relative; width: min(100%, 300px); }
.plat-search .plat-input { padding-right: 38px; }
.plat-search i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--p-muted); pointer-events: none; }
.plat-exports { display: flex; gap: 8px; }
.plat-file { display: grid; justify-items: center; gap: 0; padding: 0; border: 0; background: none; color: var(--p-ink); cursor: pointer; line-height: 1; }
.plat-file i { font-size: 1.7em; }
.plat-file small { margin-top: -15px; font-size: .5em; font-weight: 700; }
.plat-file:hover { color: var(--p-accent); }
.plat-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.plat-pages { display: flex; gap: 6px; }
.plat-page { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--p-ink); font: inherit; font-size: .88em; cursor: pointer; }
.plat-page.is-active { background: var(--p-pill); }

.plat-builder { display: grid; grid-template-columns: minmax(200px, .5fr) minmax(0, 2.2fr); gap: 18px; }
.plat-criteria { display: flex; flex-direction: column; gap: 6px; }
.plat-select {
    border-radius: 0; background: transparent; border-bottom: 1px solid var(--p-line); padding: 10px 0; font-size: .92em;
    appearance: none; -webkit-appearance: none; padding-right: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231c3b66' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 4px center; cursor: pointer;
}
.plat-select.is-input { background-image: none; cursor: text; }
.plat-select option { color: #1c3b66; }
.plat-criteria .plat-btn { margin-top: 12px; align-self: flex-start; white-space: nowrap; padding-inline: 16px; }
.plat-pc-top { display: grid; grid-template-columns: auto 1fr; gap: 20px 30px; margin-bottom: 20px; }
.plat-big { display: flex; align-items: flex-end; gap: 12px; margin: 0; }
.plat-big b { font-size: 3.6em; line-height: 1; font-weight: 400; color: var(--p-muted); }
.plat-big small { color: var(--p-muted); padding-bottom: 8px; }
.plat-chips-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plat-chips-list li { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 14px; border-radius: 999px; background: var(--p-pill); font-size: .74em; }
.plat-chips-list li.is-empty { background: none; color: var(--p-muted); padding-left: 0; }
.plat-chips-list button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--p-ink); cursor: pointer; font-size: 1.2em; }
.plat-chips-list button:hover { background: rgba(255, 255, 255, .55); }
.plat-pc-bottom { display: grid; grid-template-columns: 1fr 1.2fr 1.1fr; gap: 24px; align-items: start; }
.plat-hist { width: 100%; height: auto; }
.plat-hist rect { fill: var(--p-active); }
.plat-hist text { fill: var(--p-muted); font-size: 8px; font-family: inherit; }
.plat-donut { display: flex; align-items: center; gap: 14px; }
.plat-donut svg { width: 96px; flex: none; }
.plat-donut ul { margin: 0; padding: 0; list-style: none; font-size: .74em; display: flex; flex-direction: column; gap: 6px; }
.plat-donut li { display: flex; align-items: center; gap: 6px; }
.plat-donut li i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.plat-donut li b { font-weight: 400; margin-left: 6px; color: var(--p-muted); }
.plat-pc-save { display: flex; flex-direction: column; align-items: stretch; }
.plat-pc-save label h4 { margin-bottom: 6px; }
.plat-pc-save .plat-btn { align-self: flex-end; margin-top: 4px; }
.plat-error { margin: -6px 0 8px; color: #b0242f; font-size: .84em; }

/* Settings */
.plat-settings { display: grid; grid-template-columns: minmax(200px, .5fr) minmax(0, 1.6fr); gap: clamp(18px, 2.4vw, 40px); align-items: start; padding: clamp(18px, 2.4vw, 36px); }
.plat-subnavs { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.plat-subnav { padding: 12px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--p-ink); font: inherit; font-size: .92em; text-align: left; cursor: pointer; }
.plat-subnav:hover { background: rgba(155, 158, 214, .2); }
.plat-subnav.is-active { background: var(--p-pill); }
.plat-version { margin: clamp(30px, 6vw, 90px) 0 0 16px; color: var(--p-muted); font-size: .84em; opacity: .8; }
.plat-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; border-bottom: 1px solid var(--p-line); font-size: .94em; }
.plat-setting label { cursor: default; }
.plat-value { color: var(--p-ink); text-align: right; }
.plat-switch { position: relative; flex: none; width: 54px; height: 30px; padding: 0; border: 0; border-radius: 999px; background: var(--p-pill); box-shadow: inset 0 2px 5px rgba(43, 85, 122, .18); cursor: pointer; transition: background .25s; }
.plat-switch.is-on { background: var(--p-active); }
.plat-knob { position: absolute; top: 4px; left: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--p-accent); font-size: .78em; box-shadow: 0 2px 6px rgba(43, 85, 122, .3); transition: transform .25s; }
.plat-switch.is-on .plat-knob { transform: translateX(24px); }
.plat-range { display: inline-flex; align-items: flex-end; gap: 10px; }
.plat-range small { font-size: .8em; }
.plat-range big { font-size: 1.5em; line-height: 1; }
.plat-range input { width: 130px; accent-color: var(--p-accent); }

/* Notifica */
.plat-toast {
    position: fixed; z-index: 1100; left: 50%; bottom: 24px; max-width: calc(100vw - 32px); padding: 12px 22px; border-radius: 999px;
    background: #1c3b66; color: #fff; font-size: 15px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
    opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.plat-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Tema scuro e alto contrasto (dalle impostazioni) */
.plat[data-theme="dark"] {
    --p-bg: #161a30;
    --p-card-a: #232a4e;
    --p-card-b: #1c2342;
    --p-inner: #2a3260;
    --p-ink: #e8ebf8;
    --p-muted: #a3accf;
    --p-line: rgba(255, 255, 255, .14);
    --p-pill: #3a4382;
    --p-active: #6f74c9;
    --p-accent: #a9acef;
    --p-paper: #20274a;
    --p-shadow: 0 14px 34px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.plat[data-theme="dark"] .plat-logo img { filter: brightness(0) invert(1); }
.plat[data-theme="dark"] .plat-pill.is-ok { background: #25573a; color: #d4f3dc; }
.plat[data-theme="dark"] .plat-pill.is-warn { background: #5c4d17; color: #f8ebb5; }
.plat[data-theme="dark"] .plat-pill.is-bad { background: #6d2a31; color: #fbd6da; }
.plat[data-theme="dark"] .plat-status.is-ok { background: #25573a; color: #d4f3dc; }
.plat[data-theme="dark"] .plat-kpi-value.is-low, .plat[data-theme="dark"] .plat-kpi-value.is-ok,
.plat[data-theme="dark"] .plat-dl .is-ok, .plat[data-theme="dark"] .plat-profile .is-ok { color: #7fd69c; }
.plat[data-theme="dark"] .plat-kpi-value.is-mid, .plat[data-theme="dark"] .plat-profile .is-warn { color: #e8c050; }
.plat[data-theme="dark"] .plat-kpi-value.is-high, .plat[data-theme="dark"] .plat-profile .is-bad { color: #ff8a93; }
.plat[data-theme="dark"] .plat-org { color: #7fd69c; }
.plat[data-theme="dark"] .plat-tooltip { background: #2d366b; }
.plat[data-theme="dark"] .plat-spot::after { box-shadow: 0 0 0 2px var(--p-accent); }
.plat[data-theme="dark"] .plat-body img { filter: invert(.88) hue-rotate(180deg); }
.plat[data-theme="dark"] .plat-select option { background: #1c2342; color: #e8ebf8; }
.plat[data-theme="dark"] .plat-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23e8ebf8' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }

.plat.is-contrast { --p-muted: var(--p-ink); --p-line: currentColor; }
.plat.is-contrast .plat-card, .plat.is-contrast .plat-pillbox, .plat.is-contrast .plat-tab { box-shadow: inset 0 0 0 2px var(--p-ink); }
.plat.is-contrast .plat-btn, .plat.is-contrast .plat-pill { box-shadow: inset 0 0 0 1.5px var(--p-ink); }

/* Responsive */
@media (max-width: 1199.98px) {
    .plat-twin { grid-template-columns: minmax(0, 1fr); }
    .plat-twin-side { flex-direction: row; }
    .plat-twin-side > .plat-card { flex: 1; }
    .plat-risk-chart { grid-column: 1 / -1; }
    .plat-risk-factors { grid-column: 1 / -1; }
    .plat-planner, .plat-report { grid-template-columns: minmax(0, 1fr); }
    .plat-builder { grid-template-columns: minmax(0, 1fr); }
    .plat-compare { grid-template-columns: minmax(0, 1fr); }
    .plat-compare .plat-card-title { margin-bottom: 4px; }
    .plat-checks { flex-direction: row; flex-wrap: wrap; align-self: start; }
    .plat-legend-col { display: none; }
}

@media (max-width: 991.98px) {
    .plat { grid-template-columns: minmax(0, 1fr); }
    .plat-side { flex-direction: row; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 28px; }
    .plat-logo { flex: none; padding: 0 6px; }
    .plat-logo img { width: 96px; }
    .plat-nav { flex-direction: row; flex: 1; margin: 0; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
    .plat-nav button { width: auto; flex: none; padding: 9px 14px; gap: 8px; font-size: .86em; white-space: nowrap; }
    .plat-logout { display: none; }
    .plat-main { border-radius: 28px; }
    .plat-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .plat-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plat-action { min-height: 110px; }
    .plat-settings { grid-template-columns: minmax(0, 1fr); }
    .plat-subnavs { flex-direction: row; flex-wrap: wrap; }
    .plat-version { display: none; }
    .plat-pc-bottom { grid-template-columns: minmax(0, 1fr); }
    .plat-pc-top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767.98px) {
    .demo-section { padding-top: 84px; }
    .plat-side { flex-direction: column; align-items: stretch; min-width: 0; }
    .plat-logo img { width: 110px; }
    .plat-nav { width: 100%; }
    .plat-main { padding: 16px 12px 20px; }
    .plat-head { flex-direction: column; }
    .plat-hello { font-size: 1.5em; }
    .plat-pills { width: 100%; flex-direction: column; }
    .plat-pillbox { width: 100%; }
    .plat-twin-side { flex-direction: column; }
    .plat-body-card { grid-template-columns: minmax(0, 1fr); }
    .plat-body-info { padding: 0 16px 18px; }
    .plat-risk { grid-template-columns: minmax(0, 1fr); }
    .plat-legend { margin-left: 0; }
    .plat-factors li { grid-template-columns: 6.2em 1fr 2.6em; }
    .plat-table-wrap.is-paper { padding: 4px 8px 4px 40px; }
    .plat-table.is-plan th, .plat-table.is-plan td { padding: 12px 6px; white-space: normal; }
    .plat-table.is-plan td:nth-child(2) { white-space: nowrap; }
    .plat-status { padding: 4px 10px; font-size: .84em; }
    .plat-card { border-radius: 26px; padding: 16px; }
    .plat-paper { max-height: 520px; }
    .plat-setting { flex-wrap: wrap; }
    .plat-actions { gap: 10px; }
}

/* Stampa */
@media print {
    .plat-side, .plat-head, .plat-tabs, .plat-paper-actions, .plat-gen { display: none !important; }
}
