/* Pagina di presentazione (diarioglicemico.com): telefono prima, poi PC */

body.benvenuto {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
}
.benvenuto [hidden] {
    display: none !important;
}

/* ===== Barra in alto ===== */
.bv-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    padding-top: calc(10px + var(--sa-top, env(safe-area-inset-top)));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.bv-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.bv-brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}
.bv-nav {
    display: none;
}
.bv-azioni {
    display: flex;
    gap: 8px;
}
.bv-azioni .btn {
    min-height: 42px;
    padding: 0 16px;
}
.solo-pc {
    display: none !important;
}

/* ===== Presentazione ===== */
main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}
.bv-hero {
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding: 36px 0 24px;
}
main {
    overflow-x: clip; /* le forme colorate non creano scorrimento orizzontale */
}
.bv-etichetta {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
}
body.dark .bv-etichetta {
    color: var(--text);
}
.bv-hero h1 {
    margin: 16px 0 12px;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: -0.8px;
    font-weight: 800;
}
.bv-hero h1 span {
    color: var(--brand);
}
.bv-sottotitolo {
    margin: 0 0 22px;
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-2);
}
.bv-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn.bv-grande {
    min-height: 54px;
    font-size: 16px;
    padding: 0 26px;
    text-decoration: none;
    justify-content: center;
}
.bv-punti {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    color: var(--text-2);
}
.bv-punti li::before {
    content: "✓";
    color: var(--ok);
    font-weight: 800;
    margin-right: 10px;
}

/* ===== Sezioni ===== */
.bv-sezione {
    padding: 44px 0 8px;
    scroll-margin-top: 70px;
}
.bv-sezione h2 {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -0.4px;
    font-weight: 800;
}
.bv-intro {
    margin: 0 0 22px;
    font-size: 16px;
    color: var(--text-2);
}
.bv-griglia {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.bv-card {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.bv-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 800;
}
.bv-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-2);
}
.bv-icona {
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: var(--brand-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.bv-icona svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--brand);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body.dark .bv-icona svg {
    stroke: var(--text);
}

/* Come si inizia */
.bv-passi ol {
    list-style: none;
    counter-reset: passo;
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.bv-passi li {
    counter-increment: passo;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 2px 14px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.bv-passi li::before {
    content: counter(passo);
    grid-row: span 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-contrast);
    font-weight: 800;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bv-passi li b {
    font-size: 16px;
}
.bv-passi li span {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.5;
}

/* Professionisti */
.bv-pro {
    display: grid;
    gap: 20px;
    margin-top: 44px;
    padding: 28px 20px;
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.bv-pro h2 {
    margin-top: 14px;
}
.bv-pro p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-2);
}
.bv-nota {
    font-weight: 700;
    color: var(--ok-text) !important;
}
.bv-lista-pro {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}
.bv-lista-pro li {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 14px;
    font-weight: 600;
}

/* Domande */
.bv-faq {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}
.bv-faq details {
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 0 18px;
}
.bv-faq summary {
    min-height: 56px;
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
}
.bv-faq summary::-webkit-details-marker {
    display: none;
}
.bv-faq summary::after {
    content: "+";
    margin-left: auto;
    padding-left: 12px;
    font-size: 22px;
    color: var(--brand);
}
.bv-faq details[open] summary::after {
    content: "–";
}
.bv-faq p {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-2);
}
.bv-faq a {
    color: var(--brand);
    font-weight: 700;
}

.bv-finale {
    margin: 48px 0 8px;
    padding: 32px 20px;
    border-radius: 26px;
    background: var(--brand);
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
body.dark .bv-finale {
    background: #3c3489;
}
.bv-finale h2 {
    margin: 0;
    font-size: 24px;
}
.bv-finale .btn {
    background: #fff;
    color: #3c3489;
}

.bv-footer {
    max-width: 1180px;
    margin: 40px auto 0;
    padding: 24px 16px calc(28px + var(--sa-bottom, env(safe-area-inset-bottom)));
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}
.bv-footer a {
    color: var(--text-2);
    font-weight: 700;
}
.bv-avviso {
    flex-basis: 100%;
}

/* ===== Tablet e PC ===== */
@media (min-width: 720px) {
    .bv-griglia {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bv-cta {
        flex-direction: row;
    }
    .solo-pc {
        display: inline-flex !important;
    }
    .bv-passi ol {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .bv-passi li {
        grid-template-columns: 1fr;
    }
    .bv-passi li::before {
        grid-row: auto;
        margin-bottom: 10px;
    }
}
@media (min-width: 1000px) {
    .bv-bar {
        padding: 12px 32px;
    }
    .bv-nav {
        display: flex;
        gap: 28px;
    }
    .bv-nav a {
        color: var(--text-2);
        font-weight: 700;
        font-size: 15px;
        text-decoration: none;
    }
    .bv-nav a:hover {
        color: var(--brand);
    }
    main {
        padding: 0 32px;
    }
    .bv-hero {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 48px;
        padding: 72px 0 40px;
    }
    .bv-hero-testo {
        max-width: 600px;
    }
    .bv-hero h1 {
        font-size: 52px;
    }
    .bv-sottotitolo {
        font-size: 19px;
    }
    .bv-sezione {
        padding-top: 72px;
    }
    .bv-sezione h2 {
        font-size: 34px;
    }
    .bv-griglia {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
    .bv-pro {
        grid-template-columns: 1.3fr 1fr;
        align-items: center;
        gap: 40px;
        padding: 48px;
        margin-top: 72px;
    }
    .bv-footer {
        padding-left: 32px;
        padding-right: 32px;
    }
}

/* ===== Immagini dell'app ===== */
.bv-vetrina {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 520px;
}
.bv-cornice {
    position: relative;
    z-index: 2;
    margin: 0;
    width: 250px;
    padding: 9px;
    border-radius: 40px;
    background: #1e1b3a;
    box-shadow: 0 30px 70px rgba(30, 27, 58, 0.3), inset 0 0 0 2px #3d3961;
}
.bv-cornice img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 31px;
}
.bv-cornice.piccola {
    width: 230px;
    flex-shrink: 0;
}
.bv-browser {
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(30, 27, 58, 0.22);
    border: 1px solid var(--border);
}
.bv-browser-barra {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.bv-browser-barra i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
}
.bv-browser-barra span {
    margin-left: 10px;
    padding: 3px 12px;
    border-radius: 8px;
    background: var(--surface);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}
.bv-browser img {
    display: block;
    width: 100%;
    height: auto;
}
.solo-largo {
    display: none;
}
/* forme colorate sullo sfondo */
.bv-blob {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.55;
}
.bv-blob.b1 {
    width: 300px;
    height: 300px;
    background: #9d96f0;
    top: 10%;
    left: 5%;
    animation: bv-blob 14s ease-in-out infinite alternate;
}
.bv-blob.b2 {
    width: 260px;
    height: 260px;
    background: #6fe0b8;
    bottom: 5%;
    right: 5%;
    animation: bv-blob 17s ease-in-out infinite alternate-reverse;
}
body.dark .bv-blob {
    opacity: 0.25;
}
.bv-chip-flottante {
    position: absolute;
    z-index: 3;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.bv-chip-flottante b {
    color: var(--ok-text);
    font-size: 17px;
}
.bv-chip-flottante.c1 {
    top: 58%;
    left: 0;
    animation: bv-fluttua 6s ease-in-out infinite;
}
.bv-chip-flottante.c2 {
    bottom: 12%;
    right: 0;
    animation: bv-fluttua 7s ease-in-out 1s infinite;
}
.bv-fluttua {
    animation: bv-fluttua 7s ease-in-out infinite;
}

/* ===== Numeri ===== */
.bv-numeri {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
    padding: 24px 18px;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}
.bv-numeri b {
    display: block;
    font-size: 34px;
    font-weight: 800;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}
body.dark .bv-numeri b {
    color: var(--text);
}
.bv-numeri span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}
.bv-didascalia {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Vetrine alternate (immagine + testo) ===== */
.bv-vetrina-riga {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding-top: 56px;
}
.bv-vetrina-testo h2 {
    margin: 14px 0 10px;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
}
.bv-vetrina-testo p {
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-2);
}
.bv-spunte {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}
.bv-spunte li::before {
    content: "✓";
    color: var(--ok);
    font-weight: 800;
    margin-right: 10px;
}
.bv-pro-destra {
    display: grid;
    gap: 16px;
}

/* ===== Animazioni ===== */
@keyframes bv-fluttua {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes bv-blob {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(40px, -30px) scale(1.15); }
}
@keyframes bv-entra {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}
.bv-hero-testo > * {
    animation: bv-entra 0.7s ease-out both;
}
.bv-hero-testo > *:nth-child(2) { animation-delay: 0.08s; }
.bv-hero-testo > *:nth-child(3) { animation-delay: 0.16s; }
.bv-hero-testo > *:nth-child(4) { animation-delay: 0.24s; }
.bv-hero-testo > *:nth-child(5),
.bv-hero-testo > *:nth-child(6) { animation-delay: 0.32s; }
.bv-vetrina {
    animation: bv-entra 0.9s ease-out 0.2s both;
}
/* elementi che compaiono scorrendo (la classe "visto" la mette benvenuto.js) */
.js-anim .rivela {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.js-anim .rivela.visto {
    opacity: 1;
    transform: none;
}
.js-anim .rivela .bv-card,
.js-anim .rivela .bv-passi li,
.js-anim .rivela li {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.js-anim .rivela.visto .bv-card,
.js-anim .rivela.visto li {
    opacity: 1;
    transform: none;
}
.js-anim .rivela.visto .bv-card:nth-child(2), .js-anim .rivela.visto li:nth-child(2) { transition-delay: 0.08s; }
.js-anim .rivela.visto .bv-card:nth-child(3), .js-anim .rivela.visto li:nth-child(3) { transition-delay: 0.16s; }
.js-anim .rivela.visto .bv-card:nth-child(4), .js-anim .rivela.visto li:nth-child(4) { transition-delay: 0.24s; }
.js-anim .rivela.visto .bv-card:nth-child(5), .js-anim .rivela.visto li:nth-child(5) { transition-delay: 0.32s; }
.js-anim .rivela.visto .bv-card:nth-child(6) { transition-delay: 0.4s; }
@media (hover: hover) {
    .bv-card {
        transition: transform 0.25s, box-shadow 0.25s;
    }
    .bv-card:hover {
        transform: translateY(-4px) !important;
        box-shadow: 0 14px 34px rgba(30, 27, 58, 0.14);
    }
}
/* Chi ha chiesto meno movimento al sistema: niente animazioni */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .js-anim .rivela, .js-anim .rivela .bv-card, .js-anim .rivela li {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== Disposizione su schermi grandi ===== */
@media (min-width: 720px) {
    .bv-numeri {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 32px;
    }
    .bv-numeri b {
        font-size: 44px;
    }
    .bv-vetrina-riga {
        flex-direction: row;
        gap: 64px;
        padding-top: 88px;
    }
    .bv-vetrina-riga.inversa {
        flex-direction: row-reverse;
    }
    .bv-vetrina-testo h2 {
        font-size: 34px;
    }
    .bv-cornice.piccola {
        width: 280px;
    }
}
@media (min-width: 1000px) {
    .bv-vetrina {
        width: 560px;
        min-height: 600px;
        flex-shrink: 0;
    }
    .solo-largo {
        display: block;
        position: absolute;
        z-index: 1;
        width: 520px;
        top: 70px;
        right: -40px;
        transform: perspective(1200px) rotateY(-12deg);
    }
    .bv-cornice {
        width: 270px;
        margin-right: 220px;
    }
    .bv-chip-flottante.c1 {
        left: -30px;
    }
    .bv-chip-flottante.c2 {
        right: 40px;
    }
}
