/* --- Impostazioni Globali e Variabili --- */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css');

:root {
    --primary-color: #263a78; /* Blu scuro, professionale */
    --secondary-color: #00a8e8; /* Blu acceso per accenti e CTA */
    --dark-color: #1a1a1a; /* Nero morbido per il testo */
    --light-color: #f4f4f4; /* Grigio chiaro per sfondi */
    --white-color: #ffffff;
    --font-family: 'Poppins', sans-serif;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Rispetta la preferenza di sistema "riduci le animazioni": ferma le animazioni
   e transizioni decorative (dashboard, marquee, hover) invece di continuare a
   farle girare in loop. Vale per tutto il sito, incluse le pagine servizio. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

html {
    scroll-behavior: smooth;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--white-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; margin-bottom: 1rem; }
p { margin-bottom: 1rem; color: #949799; }

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

/* Stile per gli item bento che sono link */
a.bento-item {
    color: inherit;
}

/* --- Header e Navbar --- */
.header {
    background-color: var(--white-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    height: var(--header-height);
    transition: height 0.3s ease, box-shadow 0.3s ease;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 40px; /* Puoi aggiustare l'altezza come preferisci */
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    color: #555;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-button:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.icon-to-light {
    display: none;
}

:root[data-theme="dark"] .icon-to-dark {
    display: none;
}

:root[data-theme="dark"] .icon-to-light {
    display: inline-block;
}

.cta-button {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* --- Sezione Hero --- */
.hero-section {
    background-color: #020617; /* Blu molto scuro come base */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    min-height: 600px;
    padding-top: var(--header-height);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white-color);
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, var(--primary-color) 0%, transparent 25%),
        radial-gradient(circle at 90% 30%, var(--secondary-color) 0%, transparent 25%),
        radial-gradient(circle at 50% 80%, var(--primary-color) 0%, transparent 20%);
    background-size: 100% 100%;
    filter: blur(120px) brightness(0.8);
    animation: animate-gradient 20s ease-in-out infinite alternate;
    z-index: 0;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    color: rgba(255, 255, 255, 0.9);
}

.cta-button-main {
    background-color: transparent;
    color: var(--white-color);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    border: 2px solid var(--secondary-color);
}

.cta-button-main:hover {
    background-color: var(--secondary-color);
    color: var(--white-color);
    transform: translateY(-3px);
    border-color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 168, 232, 0.7);
}

/* --- Sezioni Generiche --- */
section {
    padding: 6rem 0;
}

.services-section { background-color: var(--light-color); }
.services-section h2, .services-section .section-subtitle { text-align: center; }
.section-subtitle { max-width: 600px; margin: 0 auto 3rem auto; }

/* --- Griglia Servizi --- */
/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 1.5rem;
    margin-top: 3rem;
}

.bento-item {
    position: relative;
    background: var(--white-color);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    display: flex;
    flex-direction: column;
    width: 100%; /* Assicura che l'item riempia il link */
    overflow: hidden;
    isolation: isolate; /* contiene il glow nel proprio stacking context */
}

.bento-item:hover,
.bento-item:focus-visible {
    transform: translateY(-8px);
    cursor: pointer;
    border-color: color-mix(in srgb, var(--card-color, var(--primary-color)) 45%, transparent);
    box-shadow:
        0 20px 40px -16px color-mix(in srgb, var(--card-color, var(--primary-color)) 40%, transparent),
        0 4px 20px rgba(0, 0, 0, 0.06);
}

.bento-item:focus-visible {
    outline: 2px solid var(--card-color, var(--secondary-color));
    outline-offset: 3px;
}

/* Bagliore colorato d'ambiente, visibile solo in hover/focus */
.bento-glow {
    position: absolute;
    inset: -45% -45% auto auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, var(--card-color, var(--secondary-color)) 0%, transparent 70%);
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.4s ease;
    z-index: -1;
    pointer-events: none;
}

.bento-item:hover .bento-glow,
.bento-item:focus-visible .bento-glow {
    opacity: 0.18;
}

.strength-icon-badge {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.35s ease;
}

.bento-item:hover .strength-icon-badge,
.bento-item:focus-visible .strength-icon-badge {
    transform: scale(1.08) rotate(-4deg);
}

.strength-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-color: var(--icon-color, var(--primary-color));
    -webkit-mask-image: var(--icon-url);
    mask-image: var(--icon-url);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.card-title-overlay .strength-icon-badge {
    margin-bottom: 0;
}

.bento-item h3 {
    font-size: 1.3rem; /* Ridotto per evitare overflow */
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.bento-item p {
    font-size: 0.9rem; /* Ridotto per evitare overflow */
    line-height: 1.5;  /* Leggermente ridotto per compattezza */
    margin-bottom: 0;  /* Rimuove il margine per guadagnare spazio verticale */
}

/* CTA persistente: leggibile e utilizzabile anche su touch, non richiede hover */
.bento-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: auto;
    padding-top: 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #888;
    letter-spacing: 0.2px;
}

.cta-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--card-color, var(--primary-color)) 12%, transparent);
    color: var(--card-color, var(--primary-color));
    font-size: 0.8rem;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.bento-item:hover .cta-arrow,
.bento-item:focus-visible .cta-arrow {
    background: var(--card-color, var(--primary-color));
    color: var(--white-color);
    transform: translateX(4px);
}

.card-title-overlay .cta-arrow {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

/* Specific item placement */
.bento-item.item-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
}

.card-title-overlay {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 2.5rem;
    background: var(--white-color);
    border-top: 1px solid #e9ecf3;
    flex-shrink: 0; /* Evita che il titolo si rimpicciolisca */
}

.card-title-overlay h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-title-overlay .bento-cta {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
}

.bento-item.item-2 { grid-column: 3 / 4; grid-row: 1 / 2; }
.bento-item.item-3 { grid-column: 3 / 4; grid-row: 2 / 3; }
.bento-item.item-4 { grid-column: 1 / 2; grid-row: 3 / 4; }
.bento-item.item-5 { grid-column: 2 / 4; grid-row: 3 / 4; }

/* --- Sezione Chi Siamo --- */
.about-section { background-color: var(--white-color); }
.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}
.about-text { flex: 1; }

.about-values {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.about-values li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.about-values i {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(38, 58, 120, 0.08);
    color: var(--primary-color);
    font-size: 1.1rem;
}

.about-values strong {
    display: block;
    color: var(--dark-color);
    margin-bottom: 0.2rem;
}

.about-values span {
    font-size: 0.9rem;
    color: #6b6f76;
}

/* --- Visual "Chi Siamo" (coerente con le dashboard delle pagine servizio) --- */
.about-visual { flex: 1; }

.about-visual-card {
    position: relative;
    background: linear-gradient(145deg, #0b101e, #1a2235);
    border: 1px solid rgba(0, 168, 232, 0.2);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.about-visual-glow {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 20% 20%, rgba(38, 58, 120, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 168, 232, 0.35) 0%, transparent 40%);
    filter: blur(60px);
    z-index: 0;
}

.about-visual-logo {
    position: relative;
    z-index: 1;
    width: 96px;
    height: 96px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.about-visual-stats {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.about-visual-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-family: var(--font-family);
}

.about-visual-stat i {
    color: var(--secondary-color);
    width: 1.5rem;
    text-align: center;
}

@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
        gap: 2.5rem;
    }
}

/* --- Sezione Tecnologie Marquee --- */
.tech-section {
    padding: 0;
    overflow-x: hidden;
    position: relative;
    background-color: var(--white-color);
}

.tech-section::before,
.tech-section::after {
    content: '';
    position: absolute;
    top: 0;
    width: 10rem;
    height: 100%;
    z-index: 2;
}

.tech-section::before {
    left: 0;
    background: linear-gradient(to right, var(--white-color), transparent);
}

.tech-section::after {
    right: 0;
    background: linear-gradient(to left, var(--white-color), transparent);
}

.tech-marquee {
    display: flex;
    width: fit-content;
    animation: marquee 60s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 4rem 0;
    gap: 1.5rem; /* Spazio tra i gruppi di categorie */
    margin-right: 1.5rem; /* Stesso spazio anche nel punto di giunzione tra i due blocchi duplicati del loop:
                             va sul margine (non su un gap del genitore) per non alterare la matematica del
                             translateX(-50%), che deve corrispondere esattamente alla larghezza di un blocco. */
}

.tech-category-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 2rem;
    border-radius: 50px; /* Forma a pillola */
    background-color: var(--light-color);
    transition: background-color 0.3s ease;
}

.tech-icon {
    height: 32px; /* Ridotta l'altezza come richiesto */
    width: 32px;  /* Ridotta la larghezza come richiesto */
    object-fit: contain;
}

/* Colori per categoria - Light Mode */
.category-frontend { background-color: #eaf8ff; }
.category-backend { background-color: #e9ecf3; }
.category-cloud-sistemi { background-color: #fff0e7; }
.category-security { background-color: #fdebec; }
.category-ai-iot { background-color: #f2eefe; }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes animate-gradient {
    from {
        transform: scale(1.0) rotate(0deg);
    }
    to {
        transform: scale(1.4) rotate(15deg);
    }
}

/* --- CTA Finale --- */
.final-cta-section {
    background-color: var(--primary-color);
    color: var(--white-color);
    text-align: center;
}
.final-cta-section h2 { font-size: 2.2rem; }
.final-cta-section p { color: rgba(255, 255, 255, 0.9); }

/* --- Footer --- */
.footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 4rem 0 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-col {
    flex: 1;
    min-width: 220px;
}

.footer-col h3, .footer-col h4 {
    color: var(--white-color);
    margin-bottom: 1rem;
}

.footer-col p, .footer-col a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: var(--secondary-color);
}

.social-icons a {
    color: var(--light-color);
    font-size: 1.5rem;
    margin-right: 1rem;
}

.social-icons a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #444;
    font-size: 0.9rem;
    color: #aaa;
}

/* --- Animazioni allo scroll --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Pagina Servizio Singolo --- */
.service-page-hero {
    padding: 6rem 0 4rem 0;
    text-align: center;
    background-color: var(--light-color);
}

.service-page-hero h1 {
    font-size: 3.2rem;
    color: var(--primary-color);
}

.sticky-scroll-section {
    padding: 4rem 0 6rem 0;
}

.sticky-scroll-container {
    display: flex;
    gap: 4rem;
}

.scroll-pane {
    flex: 2; /* Takes up more space */
    display: flex;
    flex-direction: column;
    gap: 10rem; /* Creates space between steps for scrolling */
}

.scroll-step {
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    min-height: 300px; /* Ensure step has enough height */
}

.scroll-step.is-active {
    border-color: rgba(38, 58, 120, 0.2);
    background-color: #fcfcfc;
}

.scroll-step h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tech-tags {
    margin-top: 2rem;
}

.tech-tags h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 0.75rem;
}

.tech-tags ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tags li {
    background-color: var(--light-color);
    color: #555;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.sticky-pane {
    flex: 1;
    position: sticky;
    top: calc(var(--header-height) + 4rem); /* Stick below the header */
    height: fit-content;
    max-height: calc(100vh - var(--header-height) - 4rem);
}

.sticky-pane-content {
    background: var(--primary-color);
    color: var(--white-color);
    padding: 3rem 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.sticky-pane-content i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    transition: transform 0.3s ease;
}

.sticky-pane-content h4 {
    font-size: 1.3rem;
    line-height: 1.4;
    color: var(--white-color);
}

.scroll-step.is-active .sticky-pane-content i {
    transform: scale(1.1);
}

/* --- Modal per Consulenza --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, .6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: overlay-show 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 16px 70px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 900px; /* Più largo per ospitare il calendario */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: content-show 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10;
}

.modal-close-button:hover {
    color: var(--dark-color);
}

.modal-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modal-header p {
    margin-bottom: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-top: 1.5rem;
}

.consultation-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(38, 58, 120, 0.2);
}

.form-submit-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.form-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.form-privacy-notice {
    font-size: 0.8rem;
    color: #949799;
    text-align: center;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.form-privacy-notice a {
    text-decoration: underline;
}

/* --- AI Concierge Modal --- */
.modal-content.ai-concierge {
    max-width: 600px; /* More compact for conversation */
    padding: 0;
    overflow: hidden;
}

.modal-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #eee;
}

.modal-progress-bar .progress {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.4s ease-in-out;
}

.concierge-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(38, 58, 120, 0.2);
}

.concierge-avatar i {
    font-size: 1.8rem;
}

.modal-content.ai-concierge .modal-body {
    padding: 2.5rem 2.5rem 1.5rem 2.5rem;
}

.concierge-goal-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    margin-bottom: 1.25rem;
    background-color: var(--light-color);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.concierge-goal-pill i {
    font-size: 0.7rem;
    color: var(--secondary-color);
}

.concierge-question {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.concierge-question h3 {
    font-size: 1.6rem;
    line-height: 1.4;
    margin-bottom: 0;
    color: var(--dark-color);
    font-weight: 600;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-button {
    width: 100%;
    padding: 1rem;
    text-align: left;
    background-color: var(--light-color);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-button:hover {
    background-color: #eaf8ff;
    border-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateX(5px);
}

.modal-content.ai-concierge .consultation-form {
    gap: 1rem;
}

.concierge-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0 1.5rem 0;
    animation: success-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #00c896;
    color: var(--white-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 200, 150, 0.35);
}

.concierge-success h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

.concierge-success p {
    max-width: 420px;
    color: #666;
    margin-bottom: 2rem;
}

.concierge-success .form-submit-button {
    max-width: 220px;
}

@keyframes success-pop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-footer {
    padding: 1rem 2.5rem;
    background-color: #f9fafb;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-start;
}

.back-button {
    background: none;
    border: none;
    color: #888;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.back-button:hover {
    color: var(--dark-color);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .hero-content h1 { font-size: 2.8rem; }
    h2 { font-size: 2rem; }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .bento-grid {
        grid-template-columns: 1fr; /* Stack items in a single column */
    }

    .bento-item.item-1,
    .bento-item.item-2,
    .bento-item.item-3,
    .bento-item.item-4,
    .bento-item.item-5 {
        grid-column: auto; /* Reset column span */
        grid-row: auto; /* Reset row span */
    }

    .card-title-overlay {
        padding: 1.25rem 1.5rem;
    }

    .card-title-overlay .cta-label {
        display: none; /* Solo la freccia: evita overflow accanto a icona e titolo */
    }
    .about-image { margin-top: 2rem; }

    .menu-button kbd {
        display: none;
    }

    .sticky-scroll-container {
        flex-direction: column;
    }
    .sticky-pane {
        position: relative;
        top: 0;
        order: -1; /* Move the "sticky" pane to the top */
        margin-bottom: 3rem;
        max-height: none;
    }
    .scroll-pane {
        gap: 4rem; /* Reduce gap on mobile */
    }
}

/* --- Tema Scuro (Globale) ---
   Si attiva quando data-theme="dark" sull'elemento <html>. L'attributo viene
   impostato da uno script inline (in base a localStorage o, in assenza di una
   scelta salvata, a prefers-color-scheme) e aggiornato dal toggle manuale. */
:root[data-theme="dark"] {
    --primary-color-dark: #00a8e8; /* Blu acceso diventa primario */
    --secondary-color-dark: #263a78; /* Blu scuro per accenti */
    --bg-color-dark: #121212; /* Sfondo principale */
    --surface-color-dark: #1e1e1e; /* Sfondo per card e header */
    --text-primary-dark: #e0e0e0;
    --text-secondary-dark: #a0a0a0;
    color-scheme: dark;

    & body {
        background-color: var(--bg-color-dark);
        color: var(--text-primary-dark);
    }

    & p {
        color: var(--text-secondary-dark);
    }

    /* Header */
    & .header {
        background-color: var(--surface-color-dark);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    & .cta-button {
        background-color: var(--primary-color-dark);
        color: #000;
    }
    & .cta-button:hover {
        background-color: var(--secondary-color-dark);
        color: var(--text-primary-dark);
    }
    & .theme-toggle-button {
        border-color: #444;
        color: var(--text-primary-dark);
    }
    & .theme-toggle-button:hover {
        background-color: #333;
        border-color: #555;
    }

    /* Hero */
    & .hero-content p {
        color: rgba(224, 224, 224, 0.9);
    }
    & .cta-button-main {
        background-color: var(--white-color);
        color: var(--secondary-color-dark);
        border-color: transparent;
    }
    & .cta-button-main:hover {
        background-color: var(--secondary-color-dark);
        color: var(--white-color);
        border-color: var(--secondary-color-dark);
    }

    /* Sezioni */
    & .services-section {
        background-color: #181818;
    }
    & .bento-item {
        background: var(--surface-color-dark);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }
    & .bento-item:hover,
    & .bento-item:focus-visible {
        box-shadow:
            0 20px 40px -16px color-mix(in srgb, var(--card-color, var(--primary-color-dark)) 45%, transparent),
            0 8px 25px rgba(0, 0, 0, 0.6);
    }
    & .bento-item i, & .bento-item h3, & .about-text a {
        color: var(--primary-color-dark);
    }
    & .bento-cta {
        color: var(--text-secondary-dark);
    }
    & .card-title-overlay {
        background: var(--surface-color-dark);
        border-top-color: #333;
    }
    & .card-title-overlay h3 {
        color: var(--primary-color-dark);
    }

    & .about-section {
        background-color: var(--bg-color-dark);
    }
    & .about-values strong {
        color: var(--text-primary-dark);
    }
    & .about-values span {
        color: var(--text-secondary-dark);
    }
    & .about-values i {
        background: rgba(0, 168, 232, 0.15);
        color: var(--primary-color-dark);
    }
    & .about-image img {
        filter: grayscale(1) brightness(0.8);
    }
    & .about-content:hover .about-image img {
        filter: grayscale(0) brightness(0.8);
    }
    & .final-cta-section {
        background-color: var(--surface-color-dark);
    }
    & .final-cta-section h2 {
        color: var(--primary-color-dark);
    }

    /* Marquee Dark */
    & .tech-section {
        background-color: var(--bg-color-dark);
    }
    & .tech-section::before {
        background: linear-gradient(to right, var(--bg-color-dark), transparent);
    }
    & .tech-section::after {
        background: linear-gradient(to left, var(--bg-color-dark), transparent);
    }
    & .tech-category-group {
        background-color: var(--surface-color-dark);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    /* Colori per categoria - Dark Mode (più satura/contrastata rispetto allo sfondo, altrimenti si vede troppo poco) */
    & .category-frontend { background-color: rgba(0, 168, 232, 0.25); border-color: rgba(0, 168, 232, 0.35); }
    & .category-backend { background-color: rgba(74, 98, 200, 0.3); border-color: rgba(74, 98, 200, 0.4); }
    & .category-cloud-sistemi { background-color: rgba(243, 135, 45, 0.25); border-color: rgba(243, 135, 45, 0.35); }
    & .category-security { background-color: rgba(220, 53, 69, 0.3); border-color: rgba(220, 53, 69, 0.4); }
    & .category-ai-iot { background-color: rgba(111, 66, 193, 0.3); border-color: rgba(111, 66, 193, 0.4); }

    /* Footer */
    & .footer {
        background-color: #000;
    }
    & .footer-bottom {
        border-top: 1px solid #333;
    }

    & .menu-button {
        border-color: #444;
        color: var(--text-primary-dark);
    }
    & .menu-button:hover {
        background-color: #333;
        border-color: #555;
    }
    & .menu-button kbd {
        background-color: #333;
        border-color: #555;
        color: var(--text-secondary-dark);
    }

    & [cmdk-dialog] {
        background: var(--surface-color-dark);
        box-shadow: 0 16px 70px rgba(0, 0, 0, 0.5);
    }
    & [cmdk-input] {
        color: var(--text-primary-dark);
        border-bottom-color: #333;
    }
    & [cmdk-item][aria-selected="true"] {
        background: rgba(255, 255, 255, 0.1);
    }
    & [cmdk-item] i {
        color: var(--text-secondary-dark);
    }
    & [cmdk-group-heading] {
        color: var(--text-secondary-dark);
    }
    & [cmdk-empty] {
        color: var(--text-secondary-dark);
    }

    /* Modal Dark */
    & .modal-content {
        background: var(--surface-color-dark);
    }
    & .modal-close-button {
        color: var(--text-secondary-dark);
    }
    & .modal-close-button:hover {
        color: var(--text-primary-dark);
    }
    & .modal-header {
        border-bottom-color: #333;
    }
    & .modal-header h2 {
        color: var(--primary-color-dark);
    }

    /* Dark Mode for AI Concierge */
    & .modal-content.ai-concierge {
        background-color: #181818;
        background-image: none;
    }
    & .modal-progress-bar {
        background-color: rgba(255,255,255,0.05);
    }
    & .modal-progress-bar .progress {
        background: linear-gradient(90deg, var(--secondary-color-dark), var(--primary-color-dark));
    }
    & .concierge-question h3 {
        color: var(--text-primary-dark);
    }
    & .concierge-goal-pill {
        background-color: rgba(255, 255, 255, 0.06);
    }
    & .option-button {
        background-color: rgba(30, 30, 30, 0.7);
        border-color: #444;
        color: var(--text-primary-dark);
    }
    & .option-button::after {
        color: var(--primary-color-dark);
    }
    & .option-button:hover {
        background-color: var(--surface-color-dark);
        border-color: var(--primary-color-dark);
        color: var(--primary-color-dark);
        box-shadow: 0 0 25px rgba(0, 168, 232, 0.15), 0 4px 10px rgba(0, 168, 232, 0.1);
    }
    & .modal-content.ai-concierge .form-group input,
    & .modal-content.ai-concierge .form-group textarea {
        background-color: rgba(30, 30, 30, 0.7);
    }
    & .modal-footer {
        background-color: var(--bg-color-dark);
        border-top-color: #333;
    }
    & .back-button {
        color: #777;
    }
    & .back-button:hover {
        color: var(--text-primary-dark);
    }

    /* Pagina Servizio Singolo Dark */
    & .service-page-hero {
        background-color: var(--surface-color-dark);
    }
    & .service-page-hero h1 {
        color: var(--primary-color-dark);
    }
    & .scroll-step.is-active {
        border-color: rgba(0, 168, 232, 0.2);
        background-color: #222;
    }
    & .scroll-step h3 {
        color: var(--primary-color-dark);
    }
    & .tech-tags li {
        background-color: #333;
        color: var(--text-primary-dark);
    }
    & .sticky-pane-content {
        background: var(--surface-color-dark);
    }
    & .sticky-pane-content i {
        color: var(--primary-color-dark);
    }
    & .form-group label {
        color: var(--text-primary-dark);
    }

    & .form-group input,
    & .form-group textarea {
        background-color: #2a2a2a;
        border-color: #444;
        color: var(--text-primary-dark);
    }

    & .form-group input:focus,
    & .form-group textarea:focus {
        border-color: var(--primary-color-dark);
        box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.2);
    }

    & .form-privacy-notice {
        color: var(--text-secondary-dark);
    }
}

:root:not([data-theme="dark"]) {
    color-scheme: light;
}

/* --- Header Actions & Command Palette --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: transparent;
    border: 1px solid #e5e7eb;
    color: #555;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-button:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.menu-button kbd {
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid #e5e7eb;
    border-bottom-width: 2px;
}

/* CMDK Styles */
[cmdk-root] {
    font-family: var(--font-family);
}

[cmdk-dialog-overlay] {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, .5);
    backdrop-filter: blur(4px);
    animation: overlay-show 150ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
}

[cmdk-dialog] {
    z-index: 2001;
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 640px;
    background: var(--white-color);
    border-radius: 12px;
    box-shadow: 0 16px 70px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: content-show 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

[cmdk-input] {
    width: 100%;
    font-size: 1.1rem;
    padding: 1.5rem;
    border: none;
    outline: none;
    border-bottom: 1px solid #eee;
    background: transparent;
}

[cmdk-list] {
    height: min(300px, calc(var(--cmdk-list-height)));
    max-height: 400px;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0.5rem;
}

[cmdk-item] {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s ease;
}

[cmdk-item][aria-selected="true"] { background: var(--light-color); }
[cmdk-item] i { color: #949799; width: 20px; text-align: center; }
[cmdk-group-heading] { font-size: 0.8rem; color: #949799; text-transform: uppercase; padding: 0.75rem 1rem; font-weight: 600; letter-spacing: 0.5px; }
[cmdk-empty] { text-align: center; padding: 2rem; color: #949799; }

@keyframes overlay-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes content-show { from { opacity: 0; transform: translateX(-50%) scale(0.96); } to { opacity: 1; transform: translateX(-50%) scale(1); } }