/* CSS Variables for Consistency (ANPA & API Colors) */
:root {
    --color-green-primary: #1e5631;
    /* Deep Agricultural Green */
    --color-green-light: #2e7d32;
    /* Vibrant Green */
    --color-green-accent: #e8f5e9;
    /* Background Light Green */

    --color-blue-primary: #1565c0;
    /* Institutional Blue API/INPS */
    --color-blue-light: #1e88e5;
    --color-blue-accent: #e3f2fd;

    --color-orange-primary: #f57c00;
    /* Accent Orange for CTA/Immigration */
    --color-orange-accent: #fff3e0;

    --color-text-dark: #2c3e50;
    --color-text-mute: #546e7a;
    --color-bg-white: #ffffff;
    --color-bg-light: #f7f9fa;
    --color-border: #e0e0e0;

    --font-family: 'Inter', sans-serif;
    --transition-fast: 0.2s ease-in-out;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* offset per l'header sticky */
}

body {
    font-family: var(--font-family);
    color: var(--color-text-dark);
    line-height: 1.6;
    background-color: var(--color-bg-white);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img,
iframe {
    max-width: 100%;
    border: none;
    display: block;
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--color-bg-light);
}

.text-center {
    text-align: center;
}

.highlight-green {
    color: var(--color-green-light);
}

.highlight-blue {
    color: var(--color-blue-primary);
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--color-text-dark);
}

.section-subtitle {
    color: var(--color-green-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: block;
    font-weight: 600;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.section-desc {
    color: var(--color-text-mute);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--color-green-light);
    color: white;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.2);
}

.btn-primary:hover {
    background-color: var(--color-green-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 125, 50, 0.3);
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: var(--color-bg-white);
    border-color: var(--color-bg-white);
}

.btn-outline:hover {
    background-color: var(--color-bg-white);
    color: var(--color-green-primary);
    transform: translateY(-2px);
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: height, padding var(--transition-smooth);
    height: 80px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    max-height: 45px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text strong {
    font-size: 1.2rem;
    color: var(--color-green-primary);
    line-height: 1;
}

.logo-text span {
    font-size: 0.8rem;
    color: var(--color-text-mute);
    font-weight: 500;
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text-mute);
    position: relative;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-green-light);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--color-green-light);
    transition: width var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Hamburger Menu (Mobile) */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text-dark);
    border-radius: 3px;
    transition: all var(--transition-smooth);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: url('https://images.unsplash.com/photo-1592982537447-6f2cfb6982ed?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat;
    margin-top: 0;
    /* Header is fixed over it */
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(20, 50, 25, 0.85) 0%, rgba(30, 86, 49, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 800px;
    animation: fadeInDown 1s ease-out;
}

.hero-title {
    color: white;
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero-title .highlight-green {
    color: #a5d6a7;
    /* Lighter green for dark background */
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    color: var(--color-text-mute);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.features-list {
    margin-top: 30px;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--color-text-dark);
}

.features-list span {
    color: var(--color-green-light);
    font-size: 1.2rem;
}

.about-image-wrapper {
    position: relative;
}

.about-image {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    height: auto;
    object-fit: cover;
}

.experience-card {
    position: absolute;
    bottom: -30px;
    left: -30px;
    background-color: var(--color-bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 5px solid var(--color-green-light);
}

.exp-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-green-primary);
    /* verde primario per maggior contrasto */
    line-height: 1;
}

.exp-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-dark);
    line-height: 1.2;
}

/* Notizie e Bandi */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.news-card {
    background-color: var(--color-bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-green-light);
}

.news-date {
    background-color: var(--color-green-light);
    color: white;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
    border-bottom-right-radius: var(--radius-md);
}

.news-content {
    padding: 25px 30px 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: var(--color-text-dark);
    line-height: 1.4;
}

.news-card:hover .news-title {
    color: var(--color-green-primary);
}

.news-excerpt {
    color: var(--color-text-mute);
    font-size: 0.95rem;
    margin-bottom: 25px;
    flex-grow: 1;
}

.news-card .btn {
    align-self: flex-start;
    margin-top: auto;
}

/* Spinner e stati di caricamento per Bandi */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.nessun-bando {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background-color: var(--color-bg-light);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--color-border);
}

.nessun-bando h3 {
    color: var(--color-text-dark);
    margin-bottom: 10px;
}

.nessun-bando p {
    color: var(--color-text-mute);
}

/* Services */
.services-grid {
    display: grid;
    /* Forza 4 colonne su schermi normali */
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 50px;
}

.service-card {
    background-color: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 2;
}

.border-green::before {
    background-color: var(--color-green-light);
}

.border-blue::before {
    background-color: var(--color-blue-primary);
}

.border-cyan::before {
    background-color: #00bcd4;
    /* Ciano / Azzurro chiaro */
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.icon-green {
    background-color: var(--color-green-accent);
    color: var(--color-green-light);
}

.icon-blue {
    background-color: var(--color-blue-accent);
    color: var(--color-blue-primary);
}

.icon-cyan {
    background-color: #e0f7fa;
    color: #00838f;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.card-text {
    color: var(--color-text-mute);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* Stile Tendine Servizi (Accordion) */
.card-accordions {
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-accordion {
    background-color: var(--color-bg-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.service-accordion[open] {
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-green-light);
}

.service-accordion summary {
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-dark);
    cursor: pointer;
    list-style: none;
    position: relative;
    user-select: none;
}

.service-accordion summary::-webkit-details-marker {
    display: none;
}

.service-accordion summary::after {
    content: '+';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--color-green-light);
    font-weight: 400;
}

.service-accordion[open] summary::after {
    content: '-';
}

.accordion-content {
    padding: 0 15px 15px 15px;
    font-size: 0.85rem;
    color: var(--color-text-mute);
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact Details */
.contact-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
}

.info-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: flex-start;
}

.info-icon {
    font-size: 1.5rem;
    background-color: var(--color-bg-light);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.info-item strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.info-item p,
.info-item a {
    color: var(--color-text-mute);
}

.info-item a:hover {
    color: var(--color-green-light);
}

.hours-box {
    background-color: var(--color-bg-light);
    padding: 30px;
    border-radius: var(--radius-md);
    margin-top: 40px;
    border-left: 4px solid var(--color-blue-primary);
}

.hours-title {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.hours-table {
    width: 100%;
    border-collapse: collapse;
}

.hours-table td {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
}

.hours-table tr.closed td {
    color: var(--color-orange-primary);
    font-weight: 600;
}

.map-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 500px;
}

/* Contact Form */
.form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--color-bg-white);
    padding: 50px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text-dark);
    transition: all var(--transition-fast);
    background-color: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-green-light);
    background-color: var(--color-bg-white);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.error-msg {
    color: #d32f2f;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #d32f2f;
    background-color: #fff8f8;
}

.form-group.has-error .error-msg {
    display: block;
}

/* Custom Checkbox */
.checkbox-group {
    margin-top: 10px;
    margin-bottom: 30px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text-mute);
    line-height: 1.4;
}

.checkbox-container input {
    width: auto;
    margin-top: 3px;
    cursor: pointer;
}

.checkbox-container a {
    color: var(--color-blue-primary);
    text-decoration: underline;
}

.form-success-alert {
    margin-top: 20px;
    padding: 15px 20px;
    background-color: var(--color-green-accent);
    color: var(--color-green-primary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-green-light);
    animation: fadeInUp 0.5s ease-out;
}

.hidden {
    display: none;
}

/* Footer (Nuovo Stile Compatto/Fisiosan) */
.footer-minimal {
    background-color: var(--color-green-primary);
    color: #fff;
    padding: 40px 0 20px;
    font-family: var(--font-family);
    border-top: 4px solid var(--color-green-light);
}

.footer-minimal-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Brand e Logo */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logo {
    height: 40px;
    width: auto;
    border-radius: 4px;
    background-color: white;
    /* Per staccare il verde sul blu scuro */
    padding: 4px;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
}

.footer-brand-text strong {
    font-size: 1.1rem;
    color: white;
    line-height: 1.1;
    margin-bottom: 2px;
}

.footer-brand-text span {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Sezione Contatti Icone/Testo */
.footer-contacts-wrap {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.fc-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all var(--transition-fast);
}

.fc-icon svg {
    width: 18px;
    height: 18px;
}

.footer-contact-item:hover .fc-icon {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.fc-text {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.fc-text a {
    color: #cbd5e1;
}

.fc-text a:hover {
    color: #fff;
}

/* Social Links */
.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    color: #94a3b8;
    transition: color var(--transition-fast);
}

.footer-social a:hover {
    color: #fff;
}

/* Bottom Copy */
.footer-minimal-bottom {
    text-align: center;
    padding-top: 20px;
    font-size: 0.75rem;
    color: #64748b;
}

.footer-minimal-bottom a {
    color: #94a3b8;
}

.footer-minimal-bottom a:hover {
    color: #fff;
}

/* Responsive Design */
@media (max-width: 992px) {

    .about-grid,
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .experience-card {
        left: 20px;
        bottom: -20px;
    }

    .form-wrapper {
        padding: 30px;
    }
}

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section {
        padding: 50px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .nav-container {
        padding: 0 15px;
    }

    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        /* Altezza header chiuso */
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        /* 100% dell'altezza dello schermo meno l'header */
        background-color: var(--color-bg-white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 50px;
        transition: 0.3s ease;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        z-index: 998;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0;
    }

    .nav-list li {
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 15px 0;
        font-size: 1.2rem;
        width: 100%;
    }

    .nav-link.active::after {
        display: none;
    }

    .header-actions .btn {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .about-layout,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .about-image-wrapper {
        margin-top: 30px;
    }

    .services-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .footer-minimal-content {
        flex-direction: column;
        gap: 30px;
    }

    .footer-contacts-wrap {
        flex-direction: column;
        gap: 20px;
    }

    .footer-social {
        align-items: center;
        width: 100%;
        justify-content: center;
    }
}

/* Hamburger Animations */
.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}