/* ====== DESIGN TOKENS ====== */
:root {
    --bg: #FAF9F6;
    /* Pale warm background */
    --txt: #1C2240;
    /* Navy text */
    --muted: #6E7486;
    /* Muted text */
    --brand: #1D3557;
    /* Engineering blue */
    --accent: #E9C46A;
    /* Sand accent */
    --line: #E7E6E3;
    /* Hairline */
    --card: #FFFFFF;
    /* Cards */
    --radius: 14px;
    --shadow: 0 12px 30px rgba(0, 0, 0, .06);
    --container: 1160px;
}

/* ====== BASE ====== */
* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--txt);
    font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial
}

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

a {
    color: var(--brand);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

h1,
h2,
h3 {
    font-family: ui-serif, 'Georgia', 'Times New Roman', serif;
    letter-spacing: .2px
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 22px
}

.muted {
    color: var(--muted)
}

.pill {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--muted)
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer
}

.btn-primary {
    background: var(--brand);
    color: #fff
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--accent)
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px
}

/* ====== CTA ====== */
.btn-tech-outline {
    display: inline-block;
    padding: 12px 24px;
    border: 2px solid #2a4172;
    color: #2a4172;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-tech-outline:hover {
    background: #2a4172;
    color: #fff;
}

/* ====== HEADER ====== */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffffd9;
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--line)
}

.navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.navbar img {
    max-height: 44px;
}

.nav {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.brand img {
    width: 100px;
    height: auto;
    object-fit: contain
}

.nav a {
    color: var(--txt);
    margin: 0 12px
}

.lang {
    display: flex;
    gap: 8px
}

.lang button {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--txt);
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer
}

.lang .active {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(29, 53, 87, .15)
}

/* ====== HERO ====== */
.hero {
    position: relative;
    color: #fff;
    isolation: isolate;
    overflow: hidden;
    background: url("../img/std/p1.jpg") center/cover no-repeat;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    /* Overlay blu profondo con gradiente */
    background: linear-gradient(180deg, rgba(20, 36, 70, 0.7), rgba(13, 25, 50, 0.85));
    z-index: 0;
}

.hero .inner {
    position: relative;
    z-index: 1;
    padding: 100px 0 80px;
}

.hero h1 {
    font-size: clamp(42px, 7vw, 72px);
    font-weight: 700;
    color: #e9c46a;
    /* oro sabbia */
    line-height: 1.1;
}

.hero p {
    color: #dfe7fa;
    max-width: 720px;
    margin-bottom: 24px;
}

.hero .cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero .tagline {
    display: inline-block;
    background: #00000035;
    border: 1px solid #ffffff33;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 10px
}

/* ====== SECTIONS ====== */
section {
    padding: 70px 0
}

h2 {
    font-size: clamp(24px, 3.4vw, 36px);
    margin: 0 0 10px
}

.lead {
    color: var(--muted);
    margin: 0 0 28px;
    max-width: 880px
}

.split {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 28px
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px
}

@media (max-width:980px) {
    .split {
        grid-template-columns: 1fr
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr
    }
}

/* ====== CARDS ====== */
.service .head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px
}

.service .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(233, 196, 106, .25)
}

.service ul {
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--muted)
}

/* ====== TESTIMONIAL ====== */
.testi {
    position: relative;
    background: linear-gradient(180deg, #4a5670 0%, #2c354e 100%);
    color: #fff;
    padding: 100px 0 90px;
    text-align: center;
}

.testi h2 {
    color: var(--accent);
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 8px;
}

.testi .lead {
    color: #cbd3e3;
    margin-bottom: 50px;
}

.testi .grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    justify-content: center;
}

.testi .card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.testi .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.testi .card p {
    color: #f4f5f8;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 14px;
}

.testi .note {
    color: #e9c46a;
    /* oro sabbia */
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
}


/* ====== FOOTER ====== */
footer {
    border-top: 1px solid var(--line);
    padding: 26px 0;
    color: var(--muted)
}

.note {
    font-size: 13px;
    color: var(--muted)
}

/* micro-interactions */
.card:hover {
    transform: translateY(-2px);
    transition: transform .2s ease
}

/* ====== FORM STYLING ====== */
form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--txt);
}

input,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--txt);
    font-size: 15px;
    font-family: inherit;
}

textarea {
    grid-column: 1 / -1;
    /* occupa tutta la riga */
    min-height: 120px;
    resize: vertical;
}

form .privacy {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}

form button {
    grid-column: 1 / -1;
    justify-self: start;
}

@media (max-width: 700px) {
    form {
        grid-template-columns: 1fr;
    }
}

/* --- Animazione card servizi --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stato iniziale */
.card.service,
#cases .card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Stato visibile */
.card.service.visible,
#cases .card.visible {
    opacity: 1;
    transform: translateY(0);
    animation: fadeUp 0.6s ease forwards;
}

/* --- Animazione testimonianze --- */
@keyframes fadeSideLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeSideRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Stato iniziale (invisibile) */
.testi .card {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

/* Stato visibile (fade + slide) */
.testi .card.visible.left {
    animation: fadeSideLeft 0.7s ease forwards;
}

.testi .card.visible.right {
    animation: fadeSideRight 0.7s ease forwards;
}

/* =======================
   COOKIE MODAL
======================== */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-modal-content {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px 26px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: #223055;
}

.cookie-modal-actions {
    margin-top: 16px;
    text-align: center;
}

.google-form iframe {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========================
   CONTACT BUTTON – ALPA STYLE
   ========================== */
.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(29, 53, 87, 0.2);
}

.btn-contact:hover {
    background: #274b7a;
    box-shadow: 0 6px 16px rgba(29, 53, 87, 0.25);
    transform: translateY(-1px);
}

.btn-contact:active {
    background: #18345a;
    box-shadow: 0 2px 8px rgba(29, 53, 87, 0.25);
    transform: translateY(0);
}

.btn-contact:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ====== reCAPTCHA Badge – restyle AlpA Consulting ====== */
.grecaptcha-badge {
    z-index: 9999 !important;
    bottom: 18px !important;
    right: 18px !important;
    transform: scale(0.85);
    transform-origin: bottom right;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    filter: grayscale(0.2) brightness(0.95);
}

/* Hover: effetto soft in tema AlpA */
.grecaptcha-badge:hover {
    transform: scale(0.88);
    box-shadow: 0 6px 20px rgba(29, 53, 87, 0.25) !important;
    filter: none;
}

/* Tema chiaro coerente con background AlpA */
.grecaptcha-badge iframe {
    border-radius: 10px !important;
    filter: contrast(1.05) saturate(1.1);
}

/* ==========================
    ADATTAMENTI PER TABLET
   ========================== */

@media (max-width: 992px) {
    #contact .container.split {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #contact .container.split .card,
    #contact .container.split .google-form {
        max-width: 100% !important;
        flex: none !important;
    }

    #contact iframe {
        height: 950px !important;
    }

    .grid-3 {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .grid-3 .card {
        width: 100% !important;
        margin: 0 auto;
    }

    .testi .container.content {
        padding: 40px 20px !important;
    }

    .testi h2 {
        text-align: center;
    }

    .testi p.lead {
        text-align: center;
    }
}

/* ==========================
    OTTIMIZZAZIONE MOBILE
   ========================== */
@media (max-width: 768px) {

    .grecaptcha-badge {
        right: auto !important;
        left: 10px !important;
        bottom: 10px !important;
        transform: scale(0.8);
    }

    /* --- Navbar --- */
    header,
    .navbar,
    nav {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 6px;
        padding: 8px 0 12px;
        height: 8vh;
    }

    .navbar img.logo {
        height: 40px;
    }

    #form iframe {
        height: 1050px;
    }

    .google-form iframe {
        height: 950px;
    }

    /* Le voci di menu diventano riga separata */
    .bullets,
    .pill {
        display: none;
    }

    /* Pulsanti lingua in alto a destra */
    .lang {
        position: absolute;
        top: 10px;
        right: 16px;
        gap: 4px;
    }

    .lang button {
        font-size: 12px;
        padding: 3px 8px;
    }

    /* Nasconde slogan e sotto-elementi */
    .navbar p,
    .navbar .slogan,
    .navbar small {
        display: none !important;
    }

    .lang {
        margin-top: 4px;
        justify-content: center;
        gap: 6px;
        transform: scale(0.9);
    }

    /* Riduce padding e spazi della navbar */
    header,
    .navbar,
    nav {
        padding: 10px 0;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
        margin-top: 6px;
    }

    .lang {
        margin-top: 6px;
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    /* --- Hero --- */
    .hero .inner {
        padding: 110px 20px 80px;
        text-align: center;
    }

    .hero h1 {
        font-size: clamp(30px, 8vw, 42px);
        line-height: 1.2;
        margin-bottom: 14px;
    }

    .hero p {
        font-size: 15px;
        line-height: 1.55;
        margin-bottom: 24px;
        padding: 0 6px;
    }

    .hero .cta {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .hero .cta a,
    .hero .cta button {
        width: 85%;
        text-align: center;
    }

    /* --- Sezione Dicono di noi --- */
    .testi {
        padding: 80px 20px;
        background: linear-gradient(180deg, #4a5670 0%, #2c354e 100%);
    }

    .testi h2 {
        font-size: 26px;
        margin-bottom: 30px;
    }

    .testi .grid-3 {
        display: flex;
        flex-direction: column;
        gap: 24px;
        align-items: center;
    }

    .testi .card {
        width: 100%;
        max-width: 95%;
        padding: 26px 18px;
        background: #101a33;
        border: 1px solid #223055;
        border-radius: 14px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .testi .card p {
        font-size: 15px;
        line-height: 1.5;
    }

    .testi .note {
        font-size: 14px;
        margin-top: 10px;
        color: #e9c46a;
    }

    /* --- Footer o sezioni generiche --- */
    section {
        padding: 60px 0 !important;
    }

    section h2 {
        font-size: 26px;
    }

    section p.lead {
        font-size: 15px;
    }
}