/* ==========================================================================
   download.css — «Scarica l'app»
   Caricato DOPO style.css: tutte le sovrascritture stanno qui, style.css non
   si tocca. Copre: attributo html[data-os], pillola beta, blocco download
   dell'hero, sezione #download, barra fissa, cookie banner compatto,
   navbar su mobile, ritocchi hero <=480px.
   Contratto: scratchpad/CONTRATTO-download.md. Tavole: Main, Sezione-iPhone,
   Sezione-Android, Sticky, Desktop.
   ========================================================================== */

:root {
    --dl-bg: #0D1117;
    --dl-surface: #161B22;
    --dl-blue: #4A90D9;
    --dl-blue-soft: #7FB2E8;
    --dl-crimson: #D44054;
    --dl-text: #E2E8F0;
    --dl-text-strong: #F0F2F5;
    --dl-text-2: #B0B8C8;
    --dl-text-3: #94A3B8;
    --dl-focus: #7FB2E8;
}

/* --------------------------------------------------------------------------
   1. Visibilità per sistema operativo (html[data-os], impostato da download.js)
      Senza JS (html senza data-os) e su desktop: entrambi i .dl-primary visibili,
      .dl-alt e .dl-steps nascosti.
   -------------------------------------------------------------------------- */
html[data-os="ios"] [data-os-show="android"],
html[data-os="android"] [data-os-show="ios"] {
    display: none;
}

.dl-alt,
.dl-steps {
    display: none;
}

html[data-os="ios"] .dl-alt[data-os-show="ios"],
html[data-os="android"] .dl-alt[data-os-show="android"] {
    display: flex;
}

html[data-os="ios"] .dl-steps[data-os-show="ios"],
html[data-os="android"] .dl-steps[data-os-show="android"] {
    display: block;
}

/* Su desktop i due requisiti stanno uno accanto all'altro, separati da un punto mediano */
html[data-os="desktop"] .dl-req [data-os-show="ios"]::after,
html:not([data-os]) .dl-req [data-os-show="ios"]::after {
    content: " · ";
}

/* --------------------------------------------------------------------------
   2. Pillola beta (hero e sezione)
   -------------------------------------------------------------------------- */
.beta-pill {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(139, 29, 46, 0.30);
    border: 1px solid rgba(212, 64, 84, 0.50);
    box-sizing: border-box;
    color: #F4B8C1;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.beta-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2ECC71;
    flex: none;
}

.hero-text .beta-pill {
    margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   3. Pulsanti di download (hero e sezione)
   -------------------------------------------------------------------------- */
.dl-primary {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 66px;
    padding: 10px 16px 10px 12px;
    border-radius: 18px;
    background: var(--dl-blue);
    border: 0;
    color: #0D1117;
    box-sizing: border-box;
    box-shadow: 0 14px 32px rgba(74, 144, 217, 0.32);
    text-align: left;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.dl-primary:hover {
    color: #0D1117;
    background: #5A9DE0;
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(74, 144, 217, 0.40);
}

.dl-primary:active {
    transform: translateY(0);
}

.dl-primary-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(13, 17, 23, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    color: #0D1117;
}

.dl-primary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.dl-primary-text strong {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: 19px;
    line-height: 1.15;
    color: #0D1117;
}

.dl-primary-text small {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: #10213A;
}

.dl-chevron {
    flex: none;
    color: #0D1117;
}

/* Link secondario «Hai un Android? / Hai un iPhone?» */
.dl-alt {
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-height: 48px;
    padding: 4px 8px;
    box-sizing: border-box;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--dl-text);
    text-align: center;
    text-decoration: none;
}

.dl-alt:hover {
    color: #FFFFFF;
}

.dl-alt span {
    color: var(--dl-blue-soft);
}

.dl-alt-chevron {
    flex: none;
    color: var(--dl-blue-soft);
}

/* Requisiti */
.dl-req {
    margin: 2px 0 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    color: var(--dl-text-3);
}

.dl-req a {
    color: var(--dl-text-2);
    text-decoration: underline;
    text-underline-offset: 3px;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    margin: -12px 0;
    vertical-align: middle;
}

.dl-req a:hover {
    color: #FFFFFF;
}

/* Blocco download nell'hero */
.hero-download {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    max-width: 460px;
    margin-top: 0;
}

/* --------------------------------------------------------------------------
   4. Hero: allineamento a sinistra sotto 1024px, sottotitolo, logo
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
    .hero-section .hero-text {
        align-items: flex-start;
        text-align: left;
    }

    .hero-section .hero-logo-wrapper {
        margin-bottom: 1rem;
    }

    .hero-section .hero-text .hero-subtitle {
        margin: 0 0 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   5. Sezione #download
   -------------------------------------------------------------------------- */
.dl-section {
    scroll-margin-top: 80px;
    padding: 32px 0 28px;
    background:
        radial-gradient(120% 34% at 50% 0%, rgba(139, 29, 46, 0.34), rgba(13, 17, 23, 0) 62%),
        radial-gradient(80% 24% at 100% 62%, rgba(74, 144, 217, 0.16), rgba(13, 17, 23, 0) 70%),
        radial-gradient(90% 22% at 0% 92%, rgba(139, 29, 46, 0.20), rgba(13, 17, 23, 0) 70%),
        var(--dl-bg);
    color: var(--dl-text);
    overflow: hidden;
}

/* Larghezza piena del telefono: batte i 350/390px di .container */
.dl-section .dl-wrap {
    max-width: none;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
}

.dl-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dl-title {
    margin: 16px 0 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-weight: 800;
    font-size: 34px;
    line-height: 1.06;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    color: var(--dl-text-strong);
}

.dl-title-accent {
    color: var(--dl-crimson);
}

.dl-lead {
    margin: 12px 0 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--dl-text-2);
}

/* Selettore iPhone / Android */
.dl-switch {
    margin-top: 22px;
    display: flex;
    padding: 4px;
    gap: 4px;
    border-radius: 999px;
    background: var(--dl-surface);
    border: 1px solid rgba(74, 144, 217, 0.22);
    box-sizing: border-box;
}

.dl-switch-btn {
    flex: 1;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--dl-text-2);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dl-switch-btn[aria-pressed="true"] {
    background: var(--dl-blue);
    color: #0D1117;
    font-weight: 700;
}

.dl-detected {
    margin: 8px 0 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    color: var(--dl-text-3);
}

/* Vuoto: fuori dalla vista ma ancora nell'albero di accessibilità,
   così la regione aria-live resta affidabile */
.dl-detected:empty {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.dl-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dl-copy > .dl-req {
    margin-top: 8px;
}

/* Passi di installazione */
.dl-steps {
    margin-top: 26px;
    padding: 20px;
    border-radius: 20px;
    background: var(--dl-surface);
    border: 1px solid rgba(74, 144, 217, 0.18);
    box-sizing: border-box;
}

.dl-steps h3 {
    margin: 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
    color: var(--dl-text-strong);
}

.dl-steps ol {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dl-steps li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.dl-step-n {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.16);
    border: 1px solid rgba(74, 144, 217, 0.45);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: 15px;
    color: var(--dl-blue-soft);
}

.dl-step-body {
    flex: 1;
    min-width: 0;
}

.dl-step-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--dl-text-strong);
}

.dl-step-text {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--dl-text-2);
}

.dl-secondary {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1.5px solid rgba(74, 144, 217, 0.6);
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 600;
    color: var(--dl-text);
    text-decoration: none;
    text-align: center;
}

.dl-secondary:hover {
    color: #FFFFFF;
    background: rgba(74, 144, 217, 0.10);
}

.dl-secondary svg {
    flex: none;
    color: var(--dl-blue-soft);
}

.dl-copy > .dl-alt {
    margin-top: 10px;
}

.dl-help {
    margin: 2px 0 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.45;
    color: var(--dl-text-3);
}

.dl-help a {
    color: var(--dl-text-2);
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.dl-help a:hover {
    color: #FFFFFF;
}

/* Telefono decorativo, pillole, QR */
.dl-visual {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.dl-phone {
    width: 220px;
    max-height: 430px;
    flex: none;
    border-radius: 38px;
    border: 8px solid #1C2129;
    background: #000;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 60px rgba(212, 64, 84, 0.18);
}

.dl-phone img {
    display: block;
    width: 100%;
    height: auto;
}

.dl-pills {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.dl-pills li {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(74, 144, 217, 0.14);
    border: 1px solid rgba(74, 144, 217, 0.35);
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 600;
    color: var(--dl-text);
}

/* QR: solo desktop e solo con i due link pronti (dl-links-ready) */
.dl-qr {
    display: none;
}

.dl-qr-card {
    margin: 0;
    width: 260px;
    padding: 24px;
    box-sizing: border-box;
    border-radius: 24px;
    background: var(--dl-surface);
    border: 1px solid rgba(74, 144, 217, 0.18);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dl-qr-card img {
    display: block;
    width: 200px;
    height: 200px;
    border-radius: 16px;
    background: #FFFFFF;
}

/* strong e span stanno dentro figcaption: una colonna, non una riga */
.dl-qr-card figcaption {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dl-qr-card strong {
    margin-top: 18px;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: 18px;
    color: var(--dl-text-strong);
}

.dl-qr-card span {
    margin-top: 4px;
    font-size: 14px;
    color: var(--dl-text-2);
}

/* Tablet: una colonna, ma più comoda */
@media (min-width: 768px) {
    .dl-section {
        padding: 56px 0 48px;
    }

    .dl-section .dl-wrap {
        max-width: 560px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .dl-title {
        font-size: 44px;
    }
}

/* Desktop: due colonne */
@media (min-width: 1024px) {
    .dl-section {
        padding: 96px 0;
        background:
            radial-gradient(70% 60% at 20% 0%, rgba(139, 29, 46, 0.34), rgba(13, 17, 23, 0) 65%),
            radial-gradient(50% 55% at 100% 70%, rgba(74, 144, 217, 0.18), rgba(13, 17, 23, 0) 70%),
            var(--dl-bg);
    }

    .dl-section .dl-wrap {
        max-width: 1200px;
        padding-left: 24px;
        padding-right: 24px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 80px;
    }

    .dl-copy {
        width: 576px;
        flex: none;
        align-items: flex-start;
    }

    .dl-title {
        margin-top: 22px;
        font-size: 64px;
        line-height: 1.04;
    }

    .dl-lead {
        margin-top: 22px;
        max-width: 540px;
        font-size: 18px;
        line-height: 1.55;
    }

    .dl-switch,
    .dl-detected,
    .dl-steps,
    .dl-pills {
        display: none;
    }

    .dl-actions {
        margin-top: 32px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }

    .dl-copy > .dl-req {
        margin-top: 18px;
        text-align: left;
        font-size: 14px;
    }

    .dl-help {
        margin-top: 24px;
        text-align: left;
    }

    /* Due pulsanti affiancati (desktop / senza JS): iPhone pieno, Android a contorno */
    html[data-os="desktop"] .dl-primary[data-os-show="android"],
    html:not([data-os]) .dl-primary[data-os-show="android"] {
        background: transparent;
        border: 1px solid rgba(74, 144, 217, 0.5);
        box-shadow: none;
        color: var(--dl-text);
    }

    html[data-os="desktop"] .dl-primary[data-os-show="android"]:hover,
    html:not([data-os]) .dl-primary[data-os-show="android"]:hover {
        background: rgba(74, 144, 217, 0.10);
        color: #FFFFFF;
    }

    html[data-os="desktop"] .dl-primary[data-os-show="android"] .dl-primary-text strong,
    html:not([data-os]) .dl-primary[data-os-show="android"] .dl-primary-text strong {
        color: var(--dl-text);
    }

    html[data-os="desktop"] .dl-primary[data-os-show="android"] .dl-primary-text small,
    html:not([data-os]) .dl-primary[data-os-show="android"] .dl-primary-text small {
        color: var(--dl-text-2);
    }

    html[data-os="desktop"] .dl-primary[data-os-show="android"] .dl-primary-icon,
    html:not([data-os]) .dl-primary[data-os-show="android"] .dl-primary-icon,
    html[data-os="desktop"] .dl-primary[data-os-show="android"] .dl-chevron,
    html:not([data-os]) .dl-primary[data-os-show="android"] .dl-chevron {
        color: var(--dl-blue-soft);
    }

    .dl-section .dl-primary {
        flex: 1 1 240px;
        min-width: 0;
        max-width: 300px;
        min-height: 60px;
        padding: 8px 16px;
        gap: 12px;
        border-radius: 16px;
    }

    .dl-section .dl-primary-icon {
        width: 24px;
        height: 24px;
        background: none;
        border-radius: 0;
    }

    .dl-section .dl-primary-text strong {
        font-size: 18px;
    }

    .dl-section .dl-chevron {
        display: none;
    }

    .dl-visual {
        position: relative;
        margin-top: 0;
        width: 544px;
        min-height: 520px;
        flex: none;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 24px;
    }

    .dl-phone {
        position: absolute;
        left: 292px;
        top: 10px;
        width: 236px;
        height: 500px;
        max-height: none;
        transform: rotate(7deg);
        z-index: 0;
    }

    html.dl-links-ready .dl-qr {
        position: relative;
        z-index: 1;
        display: flex;
        gap: 24px;
    }

    .dl-qr-card {
        flex: none;
    }
}

/* --------------------------------------------------------------------------
   6. Navbar: bottone «Scarica l'app» e hamburger comodi al tocco (mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
    .navbar .navbar-cta {
        display: flex;
        align-items: center;
        margin-left: auto;
        margin-right: 4px;
    }

    .navbar .navbar-cta .btn-store-nav {
        display: inline-flex;
        align-items: center;
        height: 44px;
        padding: 0 16px;
        border-radius: 999px;
        background: rgba(74, 144, 217, 0.16);
        border: 1px solid rgba(74, 144, 217, 0.45);
        box-sizing: border-box;
        color: var(--dl-text);
        font-weight: 600;
        font-size: 14px;
        line-height: 1;
        white-space: nowrap;
    }

    .navbar .navbar-cta .btn-store-nav:hover {
        background: rgba(74, 144, 217, 0.26);
        color: #FFFFFF;
    }

    .navbar .hamburger {
        width: 44px;
        height: 44px;
        margin-right: -8px;
        padding: 0;
        align-items: center;
        justify-content: center;
    }
}

/* Il nome non deve mai andare a capo: misurato il 04/11, a 320-360 e a
   414-430 px la barra saliva a 90-109px invece di 76. */
@media (max-width: 767px) {
    .navbar .navbar-logo {
        font-size: 1.125rem;
        white-space: nowrap;
        min-width: 0;
    }

    .navbar .navbar-logo img {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 374px) {
    .navbar .nav-cta-extra {
        display: none;
    }
}

/* viewport-fit=cover: in orizzontale la navbar non finisce sotto il notch */
.navbar {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    box-sizing: border-box;
}

@media (max-width: 400px) {
    .navbar .navbar-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar .navbar-logo {
        font-size: 1.125rem;
    }

    .navbar .navbar-logo img {
        width: 32px;
        height: 32px;
    }
}

/* --------------------------------------------------------------------------
   7. Barra fissa (mobile). download.js toglie [hidden] e aggiunge .is-visible
   -------------------------------------------------------------------------- */
.dl-sticky {
    display: none;
    position: fixed;
    left: calc(12px + env(safe-area-inset-left));
    right: calc(12px + env(safe-area-inset-right));
    /* --dl-sticky-lift: altezza del banner cookie quando è aperto (download.js) */
    bottom: calc(12px + env(safe-area-inset-bottom) + var(--dl-sticky-lift, 0px));
    z-index: 1600;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 12px;
    border-radius: 20px;
    background: rgba(22, 27, 34, 0.96);
    border: 1px solid rgba(74, 144, 217, 0.25);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.25s ease, transform 0.25s ease, bottom 0.25s ease;
}

.dl-sticky.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 767px) {
    html[data-os="ios"] .dl-sticky:not([hidden]),
    html[data-os="android"] .dl-sticky:not([hidden]) {
        display: flex;
    }
}

.dl-sticky img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex: none;
}

.dl-sticky-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.dl-sticky-text strong {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.15;
    color: var(--dl-text-strong);
    white-space: nowrap;
}

.dl-sticky-text span {
    font-size: 13px;
    line-height: 1.2;
    color: var(--dl-text-2);
}

.dl-sticky-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    background: var(--dl-blue);
    color: #0D1117;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    flex: none;
    box-sizing: border-box;
}

.dl-sticky-cta:hover {
    color: #0D1117;
    background: #5A9DE0;
}

.dl-sticky-close {
    width: 44px;
    height: 44px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--dl-text-3);
}

.dl-sticky-close:hover {
    color: #FFFFFF;
}

@media (max-width: 400px) {
    .dl-alt {
        font-size: 14px;
    }

    .dl-alt-chevron {
        display: none;
    }
}

@media (max-width: 400px) {
    .dl-sticky {
        gap: 8px;
        padding-left: 10px;
    }

    .dl-sticky-cta {
        padding: 0 16px;
    }
}

/* --------------------------------------------------------------------------
   8. Cookie banner compatto (mobile): una riga, <=96px a 375px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .cookie-banner {
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: calc(100% - 24px);
        padding: 12px 14px;
        border-radius: 16px;
    }

    .cookie-banner .cookie-banner-content {
        flex-wrap: nowrap;
        gap: 12px;
    }

    .cookie-banner .cookie-banner-content p {
        font-size: 13px;
        line-height: 1.4;
    }

    .cookie-banner .btn-cookie-accept {
        flex: none;
        min-height: 44px;
        padding: 0 16px;
    }
}

/* --------------------------------------------------------------------------
   9. Hero su telefono piccolo (<=480px): il pulsante deve stare sopra y=620
      a 375x667 e il blocco download tutto visibile a 390x844.
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .hero-section {
        align-items: flex-start;
        padding: 4.5rem 0 2rem;
    }

    .hero-section #hero-logo {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .hero-section .hero-logo-wrapper {
        margin-bottom: 12px;
    }

    .hero-section .hero-tagline {
        font-size: 1.625rem;
        line-height: 1.1;
        margin-bottom: 0.75rem;
    }

    .hero-section .hero-text .hero-subtitle {
        font-size: 0.9375rem;
        line-height: 1.45;
        margin: 0 0 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   10. Desktop: pulsanti dell'hero affiancati
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .hero-download {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
        max-width: none;
    }

    .hero-download .dl-req {
        flex-basis: 100%;
        margin-top: 2px;
        text-align: left;
    }

    html[data-os="desktop"] .hero-download .dl-primary[data-os-show="android"],
    html:not([data-os]) .hero-download .dl-primary[data-os-show="android"] {
        background: transparent;
        border: 1px solid rgba(74, 144, 217, 0.5);
        box-shadow: none;
        color: var(--dl-text);
    }

    html[data-os="desktop"] .hero-download .dl-primary[data-os-show="android"] .dl-primary-text strong,
    html:not([data-os]) .hero-download .dl-primary[data-os-show="android"] .dl-primary-text strong {
        color: var(--dl-text);
    }

    html[data-os="desktop"] .hero-download .dl-primary[data-os-show="android"] .dl-primary-text small,
    html:not([data-os]) .hero-download .dl-primary[data-os-show="android"] .dl-primary-text small {
        color: var(--dl-text-2);
    }

    html[data-os="desktop"] .hero-download .dl-primary[data-os-show="android"] .dl-primary-icon,
    html:not([data-os]) .hero-download .dl-primary[data-os-show="android"] .dl-primary-icon {
        color: var(--dl-blue-soft);
    }

    .hero-download .dl-primary {
        flex: 1 1 240px;
        min-width: 0;
        max-width: 300px;
        min-height: 60px;
        padding: 8px 16px;
        gap: 12px;
        border-radius: 16px;
    }

    .hero-download .dl-primary-icon {
        width: 24px;
        height: 24px;
        background: none;
        border-radius: 0;
    }

    .hero-download .dl-primary-text strong {
        font-size: 18px;
    }

    .hero-download .dl-chevron {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   11. Accessibilità: focus visibile e movimento ridotto
   -------------------------------------------------------------------------- */
.dl-primary:focus-visible,
.dl-alt:focus-visible,
.dl-secondary:focus-visible,
.dl-switch-btn:focus-visible,
.dl-req a:focus-visible,
.dl-help a:focus-visible,
.dl-sticky-cta:focus-visible,
.dl-sticky-close:focus-visible,
.navbar-cta .btn-store-nav:focus-visible,
.hamburger:focus-visible,
.cookie-banner a:focus-visible,
.btn-cookie-accept:focus-visible {
    outline: 3px solid var(--dl-focus);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .dl-primary,
    .dl-switch-btn,
    .dl-sticky {
        transition: none;
    }

    .dl-primary:hover,
    .dl-primary:active {
        transform: none;
    }

    .dl-sticky,
    .dl-sticky.is-visible {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   11. Correzioni dopo la revisione del 04/11
   -------------------------------------------------------------------------- */
/* Il titolo dell'hero si scrive a macchina: senza altezza riservata il
   pulsante di download scende mentre l'utente sta per toccarlo.
   Righe misurate a testo completo (04/11, line-height 1.1):
   <=480px 4 righe (26px); 481-767px 5 righe (40px); 768px 3 righe (40px);
   769-1023px 4 righe (56px). Regole a cascata solo con max-width, così
   anche le larghezze frazionarie (zoom, scala Android) cadono in una fascia.
   I confini 480 e 768 coincidono con quelli del font in style.css. */
@media (max-width: 1023.98px) {
    .hero-section .hero-tagline { min-height: 4.4em; }
}
@media (max-width: 768px) {
    .hero-section .hero-tagline { min-height: 3.3em; }
}
@media (max-width: 767.98px) {
    .hero-section .hero-tagline { min-height: 5.5em; }
}
@media (max-width: 480px) {
    .hero-section .hero-tagline { min-height: 4.4em; }
}

/* Barra fissa nascosta quando il menu mobile è aperto (il pannello vive
   dentro la navbar, z-index effettivo 1000). Anche via JS per i browser
   senza :has(). */
body:has(#mobile-nav-panel.open) .dl-sticky {
    display: none;
}

/* Il tap-target di «Come si installa» (44px, margine -12px) non deve
   coprire il fondo del link «Hai un Android/iPhone?» sopra. */
.hero-download .dl-req {
    margin-top: 12px;
}

/* Senza JS: niente selettore inerte, si vedono i passi di entrambi i sistemi */
html:not([data-os]) .dl-switch {
    display: none;
}
html:not([data-os]) .dl-steps {
    display: block;
}

/* --------------------------------------------------------------------------
   12. Badge degli store (04/11, richiesta dell'utente: grafica ufficiale)
   - Android: badge ufficiale «Disponibile su Google Play» (PNG di Google,
     ritagliato ai bordi: assets/images/badge-google-play-it.png).
   - iPhone: proporzioni e logo del badge Apple ufficiale (logo preso da
     developer.apple.com/assets/elements/badges/download-on-the-app-store.svg);
     il testo dice TestFlight, perché l'app non è ancora sull'App Store e il
     badge «Scarica su App Store» va usato solo per l'App Store.
   Le misure del badge Apple sono in em: 1em = altezza / 40, come l'SVG
   originale (alto 40 unità).
   `:is(…, #dl-badge-boost)` alza la specificità sopra le regole dei vecchi
   pulsanti blu senza !important (l'id non esiste: serve solo al peso).
   -------------------------------------------------------------------------- */
.dl-badge {
    --dl-badge-h: 60px;
    box-sizing: border-box;
    height: var(--dl-badge-h);
    font-size: calc(var(--dl-badge-h) / 40);
    line-height: 1;
    text-decoration: none;
    flex: none;
}

.dl-badge-sm {
    --dl-badge-h: 44px;
    display: inline-flex;
}

/* L'ancora resta .dl-primary (visibilità per sistema invariata): qui solo
   l'aspetto, mai display. */
.dl-primary:is(.dl-badge, #dl-badge-boost) {
    flex: none;
    align-self: flex-start;
    width: auto;
    max-width: none;
    min-width: 0;
    min-height: 0;
    gap: 0;
    box-shadow: none;
    transform: none;
    transition: opacity 0.15s ease;
}

.dl-primary:is(.dl-badge, #dl-badge-boost):hover {
    transform: none;
    box-shadow: none;
    opacity: 0.88;
}

/* --- Apple: nero, bordo grigio #A6A6A6, angoli e spaziature dell'originale */
.dl-badge-apple:is(.dl-badge, #dl-badge-boost) {
    align-items: center;
    padding: 0 13.5em 0 8.4em;
    gap: 6.6em;
    border-radius: 6.75em;
    border: max(1px, 0.75em) solid #A6A6A6;
    background: #000000;
    color: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.dl-badge-apple:is(.dl-badge, #dl-badge-boost):hover {
    background: #000000;
    color: #FFFFFF;
}

.dl-badge-logo {
    display: block;
    flex: none;
    width: 17.72em;
    height: 21.78em;
    margin-top: -1em;
}

.dl-badge-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.6em;
    white-space: nowrap;
}

.dl-badge .dl-badge-small,
.dl-alt .dl-badge .dl-badge-small {
    font-size: 8.6em;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #FFFFFF;
}

.dl-badge .dl-badge-big,
.dl-alt .dl-badge .dl-badge-big {
    font-size: 17em;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}

/* --- Google Play: l'immagine ufficiale, a tutta altezza */
.dl-badge-play:is(.dl-badge, #dl-badge-boost) {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    align-items: stretch;
}

.dl-badge-play:is(.dl-badge, #dl-badge-boost):hover {
    background: none;
}

.dl-badge-play img {
    display: block;
    height: 100%;
    width: auto;
}

/* --- «Hai un Android? [badge]» / «Hai un iPhone? [badge]» */
.dl-alt-badge:is(.dl-alt, #dl-badge-boost) {
    justify-content: flex-start;
    gap: 12px;
    padding: 2px 0;
    min-height: 48px;
    color: var(--dl-text-2);
    font-size: 14px;
    font-weight: 600;
}

.dl-alt-badge:is(.dl-alt, #dl-badge-boost):hover {
    color: #FFFFFF;
}

.dl-alt-badge:is(.dl-alt, #dl-badge-boost):hover .dl-badge {
    opacity: 0.88;
}

.dl-alt-badge .dl-alt-label {
    color: inherit;
}

/* Hero: tutto allineato a sinistra, primario e riga alternativa ben separati */
.hero-download:is(.hero-download, #dl-badge-boost) {
    gap: 10px;
}

/* Sezione su telefono: badge centrati come il selettore e i requisiti */
@media (max-width: 1023px) {
    .dl-section .dl-primary:is(.dl-badge, #dl-badge-boost) {
        align-self: center;
    }

    .dl-section .dl-alt-badge:is(.dl-alt, #dl-badge-boost) {
        justify-content: center;
    }
}

/* Desktop: i due badge affiancati alla stessa altezza */
@media (min-width: 1024px) {
    .dl-actions:is(.dl-actions, #dl-badge-boost) {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 16px;
    }

    .hero-download:is(.hero-download, #dl-badge-boost) {
        gap: 16px;
        align-items: center;
    }

    .dl-primary:is(.dl-badge, #dl-badge-boost) {
        align-self: center;
    }

    html[data-os="desktop"] .dl-primary.dl-badge-play:is(.dl-badge, #dl-badge-boost),
    html:not([data-os]) .dl-primary.dl-badge-play:is(.dl-badge, #dl-badge-boost) {
        background: none;
        border: 0;
    }
}

/* Hero su telefono: requisiti allineati a sinistra come i badge */
@media (max-width: 1023px) {
    .hero-download .dl-req:is(.dl-req, #dl-badge-boost) {
        text-align: left;
    }
}

/* Telefoni da 320-350px: nome e «Scarica» nella barra in alto non devono
   toccarsi (misurato il 04/11 a 320px: si sovrapponevano). */
@media (max-width: 350px) {
    .navbar .navbar-logo {
        font-size: 15px;
        gap: 6px;
    }

    .navbar .navbar-cta .btn-store-nav {
        padding: 0 12px;
    }
}

/* --------------------------------------------------------------------------
   13. Primo schermo più pulito (04/11, «così è orrendo»)
   -------------------------------------------------------------------------- */
/* La foto dello stadio è quadrata: l'animazione di style.css la dimensiona
   «100% auto», cioè sulla LARGHEZZA. Su uno schermo verticale copre solo
   una fascia di ~400px dell'hero e il suo bordo superiore si vede come un
   taglio netto. In verticale la si dimensiona sull'ALTEZZA. */
@media (max-aspect-ratio: 1/1) {
    .hero-section:is(.hero-section, #dl-badge-boost) {
        animation-name: fsHeroKenBurnsAlto;
    }
}

@keyframes fsHeroKenBurnsAlto {
    0% { background-size: auto 100%; background-position: center 40%; }
    100% { background-size: auto 110%; background-position: center 60%; }
}

/* Titolo: bianco pieno, ombra per staccarlo dai fasci, righe bilanciate
   (niente «SARDO» da sola) */
.hero-section .hero-tagline:is(.hero-tagline, #dl-badge-boost) {
    color: #FFFFFF;
    text-shadow: 0 2px 24px rgba(13, 17, 23, 0.85);
    text-wrap: balance;
}

/* Sottotitolo più leggibile sopra la foto */
.hero-section .hero-subtitle:is(.hero-subtitle, #dl-badge-boost) {
    color: #C3CEDD;
    text-shadow: 0 1px 12px rgba(13, 17, 23, 0.85);
}

/* Alone del logo nei colori del brand (era oro, unico giallo della pagina) */
.hero-section #hero-logo.loaded {
    filter: blur(0px) drop-shadow(0 0 22px rgba(212, 64, 84, 0.38));
}

.hero-download .dl-req:is(.dl-req, #dl-badge-boost) {
    text-shadow: 0 1px 10px rgba(13, 17, 23, 0.95);
}
