/* ITS Logistica Lazio - Modern CSS */
:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8a;
    --secondary: #e74c3c;
    --accent: #f39c12;
    --text: #333;
    --text-light: #666;
    --white: #fff;
    --gray-light: #f8f9fa;
    --gray: #e9ecef;
    --shadow: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    color: var(--text);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p { margin-bottom: 1rem; }

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

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary), #c0392b);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
    color: var(--white);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    transition: var(--transition);
}

header.scrolled {
    background: var(--white);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 60px;
    transition: var(--transition);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-links a {
    padding: 12px 20px; /* Minimo 44px touch target */
    color: var(--primary);
    font-weight: 500;
    border-radius: var(--radius);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--gray-light);
    color: var(--secondary);
}

.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: min(250px, calc(100vw - 40px));
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    padding: 10px 0;
}

.nav-links .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background: var(--gray-light);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 15px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.85), rgba(45, 90, 138, 0.8)),
                url('../img/hero-new.jpg') center/cover no-repeat fixed;
    color: var(--white);
    text-align: center;
    padding: 120px 20px 80px;
    overflow: hidden;
}

/* WebP support for hero background */
.webp .hero {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.85), rgba(45, 90, 138, 0.8)),
                url('../img/hero-new.webp') center/cover no-repeat fixed;
}

.no-webp .hero {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.85), rgba(45, 90, 138, 0.8)),
                url('../img/hero-new.jpg') center/cover no-repeat fixed;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, var(--white), transparent);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero h1 {
    color: var(--white);
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero .btn-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s both;
}

/* Animated Badge */
.badge-enrollment {
    display: inline-block;
    background: var(--secondary);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Styles */
section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    border-radius: 2px;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 20px auto 0;
}

/* Features Grid */
.features {
    background: var(--gray-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
}

.feature-card h3 {
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-light);
}

/* Courses Section */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 40px;
}

.course-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.course-image {
    height: clamp(180px, 25vw, 250px);
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.course-card:hover .course-image img {
    transform: scale(1.1);
}

.course-content {
    padding: 30px;
}

.course-content h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.course-content p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.course-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Stats Section */
.stats {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-item h3 {
    font-size: 3.5rem;
    color: var(--white);
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.about-image::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    border: 3px solid var(--secondary);
    border-radius: var(--radius);
    z-index: -1;
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, var(--secondary), #c0392b);
    color: var(--white);
    text-align: center;
}

.cta h2 {
    color: var(--white);
    margin-bottom: 20px;
}

.cta p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.contact-card {
    background: var(--gray-light);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
}

.contact-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.contact-card p {
    color: var(--text-light);
    line-height: 1.8;
}

.contact-card a {
    color: var(--primary);
    font-weight: 500;
}

.contact-card a:hover {
    color: var(--secondary);
}

/* Footer */
footer {
    background: var(--primary);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col p {
    opacity: 0.8;
    line-height: 1.8;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    color: var(--white);
    opacity: 0.8;
    display: block;
    padding: 10px 0;
    min-height: 44px;
}

.footer-col ul a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-logo img {
    height: 50px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 48px;
    height: 48px; /* Minimo 44px touch target */
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    text-align: center;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Page Hero (Internal Pages) */
.page-hero {
    padding: 160px 20px 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    text-align: center;
}

.page-hero h1 {
    color: var(--white);
    margin-bottom: 15px;
}

.page-hero p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--white);
    opacity: 0.8;
}

.breadcrumb a:hover {
    opacity: 1;
}

.breadcrumb span {
    opacity: 0.6;
}

/* Content Sections */
.content-section {
    padding: 80px 0;
}

.content-section.alt {
    background: var(--gray-light);
}

.content-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.content-box h3 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray);
}

.content-box ul {
    margin-left: 20px;
}

.content-box ul li {
    margin-bottom: 10px;
    color: var(--text-light);
}

/* Accordion */
.accordion-item {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.accordion-header {
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition);
}

.accordion-header:hover {
    background: var(--gray-light);
}

.accordion-header::after {
    content: '+';
    font-size: 1.5rem;
    transition: var(--transition);
}

.accordion-item.active .accordion-header::after {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-body {
    padding: 0 25px 25px;
    color: var(--text-light);
}

/* Document List */
.doc-list {
    list-style: none;
    margin: 0;
}

.doc-list li {
    padding: 15px 0;
    border-bottom: 1px solid var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-list li:last-child {
    border-bottom: none;
}

.doc-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 500;
}

.doc-list a:hover {
    color: var(--secondary);
}

.doc-list .date {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    min-height: 48px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Responsive */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        order: -1;
    }
}

@media (max-width: 768px) {
    /* Hero background scroll per mobile */
    .hero {
        background-attachment: scroll;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        transition: var(--transition);
        gap: 10px;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-links a {
        padding: 16px 20px;
        min-height: 48px;
    }

    .nav-links .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 20px;
        min-width: unset;
        width: 100%;
    }

    .menu-toggle {
        display: flex;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
        margin-bottom: 30px;
    }

    .social-links {
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    section {
        padding: 60px 0;
    }

    /* Card padding ridotto */
    .feature-card {
        padding: 30px 20px;
    }

    .bando-card {
        padding: 25px 20px;
    }

    .content-box {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .hero .btn-group {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 25px 15px;
    }

    .bando-card {
        padding: 20px 15px;
    }

    .content-box {
        padding: 25px 15px;
    }

    .footer-grid {
        gap: 25px;
    }

    .bandi-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .courses-grid {
        gap: 20px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-white { color: var(--white); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }

/* Animation on scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

/* Image Credits */
.image-credits {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
}

.image-credits a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.image-credits a:hover {
    color: var(--accent-color);
}

/* ============================================
   ACCESSIBILITÀ - Focus States
   ============================================ */
:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

/* Skip Link per accessibilità */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    z-index: 9999;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--radius) 0;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   BANDI SECTION (usato in index e fondazione)
   ============================================ */
.bandi-section {
    background: var(--gray-light);
}

.bandi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.bando-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.bando-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.bando-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.bando-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.bando-card .badge-scaduto {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.btn-small {
    padding: 12px 24px;
    font-size: 0.85rem;
}

.bando-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.bando-buttons .btn-small {
    margin-right: 0;
    margin-bottom: 0;
}

/* Corso Detail (usato in fondazione) */
.corso-detail {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.corso-detail h3 {
    color: var(--primary);
    margin-bottom: 20px;
}

.corso-detail p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Soci Banner (usato in fondazione) */
.soci-banner {
    background: var(--white);
    padding: 40px 0;
    overflow: hidden;
}

.soci-title {
    text-align: center;
    margin-bottom: 30px;
}

.soci-title h3 {
    color: var(--primary);
}

.soci-slider {
    display: flex;
    gap: 60px;
    animation: scroll 20s linear infinite;
}

.soci-slider img {
    height: 60px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition);
}

.soci-slider img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   MOBILE IMPROVEMENTS - Breakpoint 320px (iPhone SE)
   ============================================ */
@media (max-width: 320px) {
    .container {
        padding: 0 12px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .hero {
        padding: 100px 12px 60px;
    }

    .btn {
        padding: 14px 20px;
        width: 100%;
    }

    section {
        padding: 30px 0;
    }

    .logo img {
        height: 40px;
    }

    .feature-card,
    .bando-card,
    .content-box {
        padding: 20px 12px;
    }

    .footer-grid {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    section {
        padding: 40px 0;
    }

    .logo img {
        height: 45px;
    }
}

@media (max-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important; /* Previene auto-zoom iOS */
    }

    .soci-slider {
        gap: 30px;
    }
}
