/*
 * Pagina Smart Access / controllo accessi (front/2021/controlloaccessi.php).
 * Tutto sotto .sa e con prefisso sa-: la pagina convive con bootstrap e style.css del sito.
 * Font: "Poppins" 300-700 da fonts-landing.css, Sora solo per il titolo dell'hero.
 */
@font-face {
    font-family: "Sora";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("Sora-Bold.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.sa {
    --sa-orange: #FF5300;
    --sa-orange-dark: #E04800;
    --sa-peach-soft: #FFF3EC;
    --sa-ink: #14121F;
    --sa-ink-2: #4A4857;
    --sa-muted: #6F6D79;
    --sa-surface: #FAFAFA;
    --sa-line: #E7E5E0;
    --sa-radius-xl: 32px;
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.55;
    color: var(--sa-ink);
    -webkit-font-smoothing: antialiased;
}

.sa h1,
.sa h2,
.sa h3,
.sa p,
.sa ul {
    margin: 0;
    padding: 0;
}

.sa img {
    display: block;
    max-width: 100%;
    height: auto;
}

.sa b {
    font-weight: 600;
}

.sa-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.sa-section {
    padding: 56px 0;
}

.sa-display {
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.08;
    font-size: clamp(34px, 4.4vw, 56px);
    color: var(--sa-ink);
}

.sa h3 {
    font-weight: 600;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.sa-lead {
    font-size: clamp(18px, 1.6vw, 21px);
    line-height: 1.5;
    color: var(--sa-ink-2);
}

.sa-head {
    max-width: 780px;
    margin: 0 auto 40px;
    text-align: center;
}

.sa-head p {
    margin-top: 14px;
}

/* Bottoni pill */
.sa-btn,
.sa-btn:hover {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 14px 26px;
    font: 600 16px/1 "Poppins", sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, background .15s;
}

.sa-btn:hover {
    transform: translateY(-1px);
}

.sa-btn-primary,
.sa-btn-primary:hover {
    background: var(--sa-orange);
    color: #fff;
}

.sa-btn-primary:hover {
    background: var(--sa-orange-dark);
}

.sa-btn-dark,
.sa-btn-dark:hover {
    background: var(--sa-ink);
    color: #fff;
}

.sa-link,
.sa-link:hover {
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--sa-ink);
}

.sa-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.sa-btn:focus-visible,
.sa-link:focus-visible,
.sa-bento-side:focus-visible {
    outline: 3px solid var(--sa-ink);
    outline-offset: 3px;
}

/* ===== Hero: card arrotondata, testo a sx, foto a dx ===== */
.sa-hero {
    padding: 24px 0 40px;
}

.sa-hero-card {
    position: relative;
    border-radius: var(--sa-radius-xl);
    overflow: hidden;
    min-height: 580px;
    display: flex;
    align-items: center;
    background: #A2A8A4;
}

.sa-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 520px;
    padding: 64px 0 64px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.sa-hero-copy h1 {
    font-family: "Sora", "Poppins", sans-serif;
    font-weight: 700;
    font-size: clamp(56px, 8vw, 104px);
    letter-spacing: -.045em;
    line-height: .98;
    color: var(--sa-ink);
}

.sa-tag {
    font-size: 15px;
    font-weight: 600;
    color: var(--sa-ink);
    opacity: .75;
}

.sa-hero-sub {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.sa-hero-copy .sa-lead {
    max-width: 400px;
    color: var(--sa-ink);
}

.sa-hero-copy .sa-btn {
    align-self: flex-start;
    margin-top: 8px;
}

/* Foto a destra (lettore + mano sempre interi): il bordo sinistro sfuma nel grigio del tavolo, dove sta il testo */
.sa-hero-media {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 84%;
    aspect-ratio: 1731 / 909;
}

/* Il frame ha sempre le proporzioni della foto: la linea di scansione (in coordinate della foto) resta sul lettore */
.sa-hero-frame {
    position: absolute;
    inset: 0;
}

.sa-hero-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%), linear-gradient(180deg, transparent 0%, #000 26%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0%, #000 22%), linear-gradient(180deg, transparent 0%, #000 26%);
    mask-composite: intersect;
}

.sa-scan {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .sa-scan {
        display: none;
    }
}

/* ===== Affidati ===== */
.sa-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: center;
}

.sa-split-media {
    border-radius: var(--sa-radius-xl);
    overflow: hidden;
    background: var(--sa-surface);
    aspect-ratio: 1260 / 1060;
}

.sa-split-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sa-split-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.sa-split-copy .sa-display {
    font-size: clamp(34px, 3.8vw, 52px);
}

.sa-split-copy p {
    font-size: 19px;
    line-height: 1.5;
}

.sa-dots {
    list-style: none;
    display: grid;
    gap: 14px;
    padding-left: 4px !important;
    font-size: 18px;
}

.sa-dots li {
    position: relative;
    padding-left: 24px;
}

.sa-dots li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sa-ink);
}

.sa-btn-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px;
    margin-top: 12px;
}

.sa-split-copy .sa-btn {
    padding: 16px 30px;
}

/* ===== Servizi (bento) ===== */
.sa-bento {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 20px;
}

.sa-bento-main {
    grid-row: 1 / 3;
    background: var(--sa-surface);
    border-radius: var(--sa-radius-xl);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sa-bento-main p {
    color: var(--sa-ink-2);
}

.sa-bento-main small {
    color: var(--sa-muted);
    font-size: 13px;
}

.sa-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto !important;
}

.sa-chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px 8px 8px;
    font-size: 14px;
    font-weight: 500;
}

.sa-chip-ic {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sa-peach-soft);
    color: var(--sa-orange);
    display: grid;
    place-items: center;
}

.sa-bento-side,
.sa-bento-side:hover {
    position: relative;
    background: var(--sa-surface);
    border-radius: var(--sa-radius-xl);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: var(--sa-ink);
    transition: transform .15s;
}

.sa-bento-side:hover {
    transform: translateY(-2px);
}

.sa-bento-side p {
    color: var(--sa-ink-2);
    font-size: 16px;
    flex: 1;
}

.sa-bento-sky,
.sa-bento-sky:hover {
    background: #E3F4FD;
}

.sa-tag-new {
    position: absolute;
    top: 28px;
    right: 28px;
    background: #fff;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 700;
}

.sa-icon-bubble {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: #fff;
    display: grid;
    place-items: center;
    color: var(--sa-orange);
}

/* ===== Novità spogliatoio: blocco a schede (come App Plus). Su desktop la scheda attiva segue lo
   scorrimento; su mobile il titolo della sezione scorre via e restano fermi immagine e voci.
   Altezza della sezione e "top" del blocco li calcola lo script della view. Sfondi .webp in webp-overrides.css ===== */
.sa-ts-sticky {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 64px;
    align-items: center;
    position: sticky;
    top: 93px;
}

.sa-ts-head {
    grid-column: 1 / -1;
    margin-bottom: 32px;
    max-width: none;
}

.sa-eyebrow {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.sa-ts-head .sa-display em {
    font-style: normal;
    color: var(--sa-orange);
}

.sa-ts-head .sa-lead {
    margin: 14px auto 0;
    max-width: 920px;
}

.sa-ts-head .sa-btn {
    margin-top: 24px;
}

.sa-ts-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transform: translateX(36px);
}

.sa-ts-dots i {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--sa-line);
    transition: height .3s, background .3s;
}

.sa-ts-dots i.sa-on {
    height: 24px;
    background: var(--sa-ink);
}

.sa-ts-media {
    display: grid;
    width: min(100%, calc((100vh - 93px - 400px) * 10 / 11));
    min-width: 280px;
    justify-self: center;
}

.sa-ts-pane {
    grid-area: 1 / 1;
    border-radius: var(--sa-radius-xl);
    overflow: hidden;
    opacity: 0;
    transition: opacity .45s;
    aspect-ratio: 10 / 11;
}

.sa-ts-pane.sa-on {
    opacity: 1;
}

.sa-ts-pane > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sa-ts-pane--cielo {
    background: #C9E9FB url("../img/Controllo_Accessi/smart_access/spogliatoio_sfondo.jpg") center / cover no-repeat;
    display: grid;
    place-items: center;
    padding: 12%;
}

.sa-ts-pane--cielo > img {
    height: auto;
    filter: drop-shadow(0 24px 30px rgba(20, 60, 120, .22));
}

.sa-ts-pane--vetro {
    position: relative;
    display: grid;
    place-items: center;
    padding: 9%;
    background: #C9E9FB url("../img/Controllo_Accessi/smart_access/spogliatoio_vetro_sfondo.jpg") center / cover no-repeat;
}

.sa-ts-pane--vetro > img {
    position: relative;
    z-index: 1;
}

.sa-ts-pane--borsellino {
    position: relative;
}

/* icone animate sopra i bottoni Docce e Phon del borsellino (coordinate della foto 1000x1100) */
.sa-ico-anim {
    position: absolute;
    height: auto;
    overflow: visible;
}

.sa-ico-doccia {
    left: 37.26%;
    top: 39.06%;
    width: 10.78%;
}

.sa-ico-phon {
    left: 67.75%;
    top: 39.33%;
    width: 11.81%;
}

.sa-spruzzo {
    fill: #FFE4D4;
    opacity: 0;
    animation: sa-spruzzo 1.6s ease-in calc(var(--i) * .25s) infinite;
}

@keyframes sa-spruzzo {
    0% { transform: translate(0, 0); opacity: 0; }
    20% { opacity: .75; }
    100% { transform: translate(-12px, 12px); opacity: 0; }
}

.sa-ico-phon .sa-corpo {
    transform-box: fill-box;
    transform-origin: 70% 80%;
    animation: sa-phon 2.4s ease-in-out infinite;
}

@keyframes sa-phon {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-4deg); }
    75% { transform: rotate(3deg); }
}

.sa-aria {
    stroke: #FFE4D4;
    stroke-width: 3.6;
    stroke-linecap: round;
    opacity: 0;
    animation: sa-aria 1.3s ease-out calc(var(--i) * .2s) infinite;
}

@keyframes sa-aria {
    0% { transform: translate(0, 0); opacity: 0; }
    25% { opacity: 1; }
    100% { transform: translate(-13px, 8px); opacity: 0; }
}

/* gocce che scivolano sul vetro */
.sa-gocce {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sa-goccia {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s, 16px);
    height: calc(var(--s, 16px) * 1.2);
    margin-left: calc(var(--s, 16px) / -2);
    border-radius: 50% 50% 48% 48% / 40% 40% 60% 60%;
    background: radial-gradient(circle at 38% 30%, rgba(255, 255, 255, .95) 0 14%, rgba(255, 255, 255, .35) 32%, rgba(70, 130, 190, .3) 62%, rgba(255, 255, 255, .55) 100%);
    box-shadow: 0 3px 4px rgba(20, 60, 120, .28), inset 0 -2px 3px rgba(20, 60, 120, .3);
    animation: sa-goccia 7s cubic-bezier(.55, 0, .75, .6) var(--d, 0s) infinite;
}

.sa-goccia::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 60%;
    width: calc(var(--s, 16px) * .38);
    height: 0;
    margin-left: calc(var(--s, 16px) * -.19);
    border-radius: 99px;
    background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .4));
    animation: sa-scia 7s cubic-bezier(.55, 0, .75, .6) var(--d, 0s) infinite;
}

@keyframes sa-goccia {
    0%, 30% { transform: translateY(0); opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translateY(var(--h, 600px)); opacity: 0; }
}

@keyframes sa-scia {
    0%, 30% { height: 0; }
    100% { height: calc(var(--h, 600px) * .7); }
}

.sa-ts-list {
    list-style: none;
    display: grid;
    gap: 4px;
    align-self: start;
    margin: 0;
    padding: 8px 0 0;
}

.sa-ts-item h3 {
    margin: 0;
}

.sa-ts-item h3 button {
    border: 0;
    background: none;
    padding: 6px 0;
    cursor: pointer;
    text-align: left;
    font: 700 clamp(28px, 3.2vw, 44px) / 1.12 "Poppins", system-ui, sans-serif;
    letter-spacing: -.035em;
    color: var(--sa-muted);
    opacity: .55;
    transition: color .3s, opacity .3s;
}

.sa-ts-item h3 button:hover {
    opacity: .8;
}

.sa-ts-item h3 button:focus-visible {
    outline: 2px solid var(--sa-ink);
    outline-offset: 4px;
    border-radius: 6px;
}

.sa-ts-item.sa-on h3 button {
    color: var(--sa-ink);
    opacity: 1;
}

.sa-ts-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .35s ease;
}

.sa-ts-item.sa-on .sa-ts-body {
    grid-template-rows: 1fr;
}

.sa-ts-body > div {
    overflow: hidden;
    max-width: 480px;
}

.sa-ts-body p {
    font-size: 17px;
    color: var(--sa-ink-2);
    padding-top: 8px;
}

.sa-ts-body b {
    color: var(--sa-ink);
    font-weight: 600;
}

.sa-ts-body > div > :last-child {
    margin-bottom: 20px;
}

.sa-ts-steps,
.sa-ts-feats,
.sa-ts-ways {
    list-style: none;
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 12px 0 0;
}

.sa-ts-ways {
    gap: 8px;
    padding-top: 10px;
}

.sa-ts-steps li,
.sa-ts-feats li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: start;
}

.sa-ts-steps span {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--sa-orange-dark);
    text-align: center;
}

.sa-ts-feats svg {
    color: var(--sa-ink);
    margin-top: 2px;
}

.sa-ts-steps p,
.sa-ts-feats p {
    padding-top: 0;
}

.sa-ts-ways li {
    font-size: 15px;
    line-height: 1.5;
    color: var(--sa-ink-2);
}

/* durante la misura dell'altezza (script) niente transizioni */
.sa-ts-misura .sa-ts-body,
.sa-ts-misura .sa-ts-pane {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .sa-ts-pane,
    .sa-ts-body,
    .sa-ts-dots i {
        transition: none;
    }

    .sa-goccia,
    .sa-goccia::before,
    .sa-spruzzo,
    .sa-aria,
    .sa-ico-phon .sa-corpo {
        animation: none;
    }

    .sa-spruzzo,
    .sa-aria {
        opacity: .8;
    }
}

/* ===== Perché scegliere ===== */
.sa-why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.sa-why-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.sa-why-media {
    width: 100%;
    aspect-ratio: 6 / 5;
    border-radius: var(--sa-radius-xl);
    overflow: hidden;
    background: var(--sa-surface);
    margin-bottom: 10px;
}

.sa-why-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 55%;
}

.sa-why-lilla img {
    object-position: 0 50%;
}

.sa-why-cutout {
    background: linear-gradient(180deg, #9FB7CA 0%, #A6BAC7 30%, #AEBBC1 60%, #C3C5C3 80%, #D9D3C6 100%);
}

/* Scontornato a tutta altezza, appoggiato in basso: il taglio della testa coincide col bordo della card */
.sa-why-cutout img {
    object-position: 50% 100%;
}

.sa-why-card h3 {
    font-size: clamp(24px, 2.2vw, 30px);
    font-weight: 700;
    letter-spacing: -.02em;
}

.sa-why-card p {
    flex: 1;
}

.sa-why-card .sa-link {
    margin-top: 4px;
}

/* ===== Tornelli ===== */
.sa-products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.sa-product {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sa-product-thumb {
    background: #C8C9CD;
    border-radius: var(--sa-radius-xl);
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.sa-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 60%;
    transition: transform .4s;
}

.sa-product:hover .sa-product-thumb img {
    transform: scale(1.03);
}

.sa-product-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.sa-product-head svg {
    color: var(--sa-orange);
    flex: none;
}

.sa-product p {
    color: var(--sa-ink-2);
    font-size: 16px;
}

.sa-products-cta {
    margin-top: 40px;
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .sa-split,
    .sa-why-grid,
    .sa-bento,
    .sa-products {
        grid-template-columns: 1fr;
    }

    .sa-hero {
        padding-top: 16px;
    }

    .sa-hero-card {
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
        background: none;
        border-radius: 0;
        overflow: visible;
    }

    .sa-hero-media {
        order: -1;
        position: relative;
        width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: var(--sa-radius-xl);
        overflow: hidden;
        background: #A2A8A4;
    }

    .sa-hero-frame {
        inset: auto;
        top: 0;
        height: 100%;
        width: 142.8%;
        left: -40%;
    }

    .sa-hero-frame img {
        -webkit-mask-image: none;
        mask-image: none;
    }

    .sa-hero-copy {
        max-width: none;
        padding: 28px 4px 0;
        gap: 16px;
        text-align: center;
    }

    .sa-hero-copy .sa-lead {
        max-width: none;
    }

    .sa-hero-copy .sa-btn {
        align-self: center;
    }

    .sa-split {
        gap: 40px;
    }

    /* schede spogliatoio: titolo sopra, poi immagine a pila con i pallini, poi le voci */
    .sa-ts-sticky {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 14px;
        align-content: start;
    }

    .sa-ts-dots {
        grid-row: 2;
        grid-column: 1;
        justify-self: start;
        align-self: center;
        transform: none;
        gap: 8px;
    }

    .sa-ts-dots i.sa-on {
        height: 20px;
    }

    .sa-ts-media {
        grid-row: 2;
        grid-column: 1;
        width: min(84%, calc((100svh - 93px - 455px) * 10 / 11));
        min-width: 220px;
        max-width: 440px;
        padding-top: 12%;
    }

    .sa-ts-pane {
        transform: translateY(115%);
        transform-origin: 50% 0;
        pointer-events: none;
        transition: transform .6s cubic-bezier(.2, .75, .25, 1), opacity .5s ease;
    }

    .sa-ts-pane.sa-on {
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }

    .sa-ts-pane.sa-prev {
        transform: translateY(-10%) scale(.88);
        opacity: .4;
    }

    .sa-ts-pane.sa-old {
        transform: translateY(-18%) scale(.76);
        opacity: 0;
    }

    .sa-ts-pane:nth-child(2) {
        z-index: 2;
    }

    .sa-ts-pane:nth-child(3) {
        z-index: 3;
    }

    .sa-ts-body p,
    .sa-ts-steps li,
    .sa-ts-feats li {
        line-height: 1.5;
    }

    .sa-ts-body .sa-ts-note {
        display: none;
    }

    .sa-ts-body > div > :last-child {
        margin-bottom: 12px;
    }

    .sa-ts-list {
        grid-row: 3;
        text-align: center;
        gap: 0;
        padding-top: 0;
    }

    .sa-ts-item h3 button {
        text-align: center;
        font-size: 26px;
        padding: 4px 0;
    }

    .sa-ts-body > div {
        max-width: 520px;
        margin: 0 auto;
        text-align: left;
    }

    .sa-bento {
        grid-template-rows: auto;
    }

    .sa-bento-main {
        grid-row: auto;
    }
}

@media (max-width: 560px) {
    .sa-hero-media {
        aspect-ratio: 1 / 1;
    }

    .sa-hero-frame {
        width: 190.4%;
        left: -57%;
    }

    .sa-wrap {
        padding: 0 16px;
    }

    .sa-section {
        padding: 40px 0;
    }

    .sa-bento-main {
        padding: 28px;
    }
}
