:root {
    --md-sys-color-primary: #0061a4;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d1e4ff;
    --md-sys-color-on-primary-container: #001d36;
    --md-sys-color-secondary: #535f70;
    --md-sys-color-secondary-container: #d7e3f7;
    --md-sys-color-tertiary: #6b5778;
    --md-sys-color-surface: #fdfcff;
    --md-sys-color-surface-variant: #dfe2eb;
    --md-sys-color-outline: #73777f;
    --md-sys-shape-corner-large: 24px;
    --md-sys-shape-corner-extra-large: 32px;
    --md-sys-shape-corner-full: 9999px;
    --md-sys-elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --md-sys-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --md-sys-elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

.hero-wrapper {
    position: relative;
    padding: 8rem 0 6rem;
    overflow: hidden;
    background: var(--md-sys-color-surface);
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.badge-pillola {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    padding: 0.5rem 1.25rem;
    border-radius: var(--md-sys-shape-corner-full);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.display-hero {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #00a3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.headline-hero {
    font-size: 1.5rem;
    color: var(--md-sys-color-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.4;
}

.azioni-hero {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-md3 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    height: 3.5rem; /* Large touch target */
    border-radius: var(--md-sys-shape-corner-full);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    border: none;
    cursor: pointer;
}

.btn-primary-large {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-1);
}

.btn-primary-large:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-2px);
}

.btn-tonal-large {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-primary-container);
}

.btn-tonal-large:hover {
    background: #c2d7f5; /* Slightly darker tonal */
    transform: translateY(-2px);
}

.btn-text {
    background: transparent;
    color: var(--md-sys-color-primary);
    padding: 0 1rem;
}

.btn-text:hover {
    background: rgba(0, 97, 164, 0.08);
}

.btn-inverse {
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-primary);
}

/* Sfondo Animato */
.sfondo-animato {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #d1e4ff;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #eaddff;
    bottom: -50px;
    right: -50px;
    animation-delay: 2s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: #c2e7ff;
    top: 40%;
    left: 60%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

/* Accesso Rapido */
.sezione-accesso-rapido {
    margin-top: -3rem;
    position: relative;
    z-index: 10;
    padding-bottom: 4rem;
}

.titolo-sezione {
    font-size: 1.75rem;
    color: var(--md-sys-color-on-primary-container);
    margin-bottom: 2rem;
    font-weight: 600;
}

.griglia-bottoni {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.card-bottone {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-bottone:hover {
    background: #fff;
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-4px);
    border-color: var(--md-sys-color-primary);
}

.icona-wrapper {
    width: 48px;
    height: 48px;
    background: var(--md-sys-color-secondary-container);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--md-sys-color-on-primary-container);
    font-size: 1.5rem;
}

.etichetta-bottone {
    font-weight: 600;
    color: #1a1c1e;
    font-size: 1.1rem;
}

.freccia-hover {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--md-sys-color-primary);
    font-size: 1.5rem;
}

.card-bottone:hover .freccia-hover {
    opacity: 1;
    transform: translateX(0);
}

/* Applicazioni */
.griglia-applicazioni {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card-app {
    background: #fff;
    border-radius: var(--md-sys-shape-corner-large);
    padding: 1.5rem;
    border: 1px solid var(--md-sys-color-surface-variant);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s;
}

.card-app:hover {
    border-color: var(--app-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.app-icon-box {
    width: 56px;
    height: 56px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--app-color);
    flex-shrink: 0;
}

.app-content h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: #1a1c1e;
}

.app-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--md-sys-color-secondary);
    line-height: 1.4;
}

.app-status {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--app-color);
    background: rgba(0,0,0,0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Servizi Highlight */
.sezione-servizi-highlight {
    background: var(--md-sys-color-surface-variant);
    padding: 4rem 0;
    border-radius: var(--md-sys-shape-corner-extra-large);
    margin: 2rem 0;
}

.header-servizi {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.scroll-servizi {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card-servizio-moderna {
    background: var(--md-sys-color-surface);
    padding: 2rem;
    border-radius: var(--md-sys-shape-corner-large);
    transition: transform 0.2s;
}

.card-servizio-moderna:hover {
    transform: translateY(-5px);
}

.card-servizio-moderna .icona-grande {
    font-size: 2.5rem;
    color: var(--md-sys-color-primary);
    margin-bottom: 1rem;
    display: block;
}

.card-servizio-moderna h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.card-servizio-moderna p {
    color: var(--md-sys-color-secondary);
    margin: 0;
}

/* CTA Box */
.cta-box {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.cta-content h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.cta-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .display-hero {
        font-size: 3.5rem;
    }
    
    .cta-box {
        padding: 2rem;
        flex-direction: column;
        text-align: center;
    }
    
    .header-servizi {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}