/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0b2e38;
    --primary-dark: #051920;
    --primary-light: #eaf6fa;
    --secondary: #2f4a54;
    --secondary-light: #dcebef;
    --accent: #0093bd;
    --accent-hover: #007597;
    --accent-light: #9ad5e2;
    --accent-haccp: #1a7a5a;
    --accent-haccp-light: #d4ede4;
    --bg: #ffffff;
    --bg-alt: #f4f9fb;
    --text: #1a1a1a;
    --text-light: #55606a;
    --text-muted: #7c8a91;
    --border: #dce8ed;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 24px -6px rgba(0,0,0,0.12), 0 4px 8px -4px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 40px -8px rgba(0,0,0,0.15);
    --max-width: 1200px;
    --header-h: 72px;
    --gradient-primary: linear-gradient(145deg, #0b2e38 0%, #163f4b 100%);
    --gradient-accent: linear-gradient(135deg, #0093bd 0%, #4fc3dd 100%);
    --gradient-dark: linear-gradient(145deg, #051920 0%, #0b2e38 100%);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    padding-top: var(--header-h);
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

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

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

.logo img { height: 42px; width: auto; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-menu a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: calc(100% - 32px);
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary-light);
    color: var(--accent);
    text-decoration: none;
}

.nav-menu a.nav-cta {
    background: var(--gradient-accent);
    color: #fff;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    margin-left: 8px;
}

.nav-menu a.nav-cta::after {
    display: none;
}

.nav-menu a.nav-cta:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 147, 189, 0.4);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    transform: translateX(-50%) scaleX(1);
    background: var(--accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* ===== HERO ===== */
.hero {
    background:
        linear-gradient(160deg, rgba(0,147,189,0.45) 0%, rgba(11,46,56,0.9) 100%),
        url('/img/banner_sicurezza_lavoro_v3.svg') center center / cover no-repeat,
        var(--gradient-primary);
    color: #fff;
    padding: 100px 0 90px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 36px;
    line-height: 1.7;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 147, 189, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 147, 189, 0.45);
    text-decoration: none;
    color: #fff;
}

/* ===== TABS ===== */
.tabs-section {
    padding: 72px 0;
    background: var(--bg-alt);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 36px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: none;
    background: var(--bg-alt);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tab-btn:hover { color: var(--text); background: var(--bg-alt); }

.tab-btn.active {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 147, 189, 0.35);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== COURSE GRID ===== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-card {
    display: block;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    text-decoration: none;
    color: inherit;
    border-color: transparent;
}

.course-card-body {
    padding: 24px;
}

.course-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--accent-hover);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-haccp {
    background: var(--accent-haccp);
    color: #fff;
}

.course-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.35;
    color: var(--text);
}

.course-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.course-duration {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

/* ===== FEATURES ===== */
.features {
    padding: 80px 0;
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 48px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

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

.feature-card {
    text-align: center;
    padding: 36px 24px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    color: var(--accent-hover);
    display: inline-block;
    background: var(--accent-light);
    padding: 12px;
    border-radius: 14px;
    line-height: 1;
}

.feature-card h3 { margin-bottom: 8px; font-size: 1.1rem; color: var(--text); }

.feature-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.65;
}

/* ===== PAGE HEADER ===== */
.page-header {
    background: linear-gradient(145deg, var(--bg-alt) 0%, #e3f2f7 100%);
    padding: 56px 0 48px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0,147,189,0.07) 0%, transparent 70%);
    pointer-events: none;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
}

.page-header p {
    color: var(--text-light);
    margin-top: 8px;
    font-size: 1.05rem;
    position: relative;
}

/* ===== PAGE CONTENT ===== */
.page-content { padding: 56px 0 72px; }

.content-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 860px;
    box-shadow: var(--shadow);
}

.content-card h2 { font-size: 1.5rem; margin-bottom: 8px; color: var(--text); }
.content-card h3 { font-size: 1.2rem; margin: 28px 0 12px; color: var(--text); }
.content-card hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.content-card p { margin-bottom: 12px; color: var(--text-light); line-height: 1.75; }
.content-card ul { margin: 12px 0; padding-left: 20px; }
.content-card li { margin-bottom: 6px; color: var(--text-light); line-height: 1.6; }

.address { font-size: 1.1rem; font-weight: 500; color: var(--text) !important; }

/* ===== CONTACT ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.contact-info {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 32px;
    align-self: start;
}

.contact-info h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: #fff;
}

.contact-info p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 8px;
}

.contact-info a {
    color: var(--accent);
}

.contact-info a:hover {
    color: #fff;
}

.contact-form-wrap { min-width: 0; }

.contact-form {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg);
    color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 147, 189, 0.1);
}

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

.checkbox-group { margin-bottom: 16px; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-light);
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

/* ===== ALERTS ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.alert-success {
    background: #d4ede4;
    color: #1a7a5a;
    border: 1px solid #a8d5c4;
}

.alert-error {
    background: #fde8e8;
    color: #991b1b;
    border: 1px solid #fbc8c8;
}

.alert-error ul { margin: 0; padding-left: 18px; }
.alert-error li { margin-bottom: 4px; }

/* ===== COURSE DETAIL ===== */
.course-detail .course-desc {
    font-size: 1.1rem;
    line-height: 1.75;
    margin-bottom: 24px;
    color: var(--text);
}

.course-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.meta-item {
    background: var(--bg-alt);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.meta-item strong {
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== SCHEDA ===== */
.scheda-grid { max-width: 100%; }

.scheda-col h3 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.scheda-list {
    list-style: none;
    padding: 0 !important;
    columns: 2;
    column-gap: 20px;
}

.scheda-list li {
    break-inside: avoid;
    margin-bottom: 10px;
    padding-left: 0;
}

.scheda-list a {
    display: block;
    padding: 12px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    transition: all 0.25s;
    line-height: 1.4;
}

.scheda-list a:hover {
    background: var(--primary-light);
    border-color: var(--accent);
    transform: translateX(4px);
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--gradient-dark);
    color: #b0bccf;
    padding: 56px 0 0;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-hover), var(--accent), var(--accent-light));
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding-bottom: 36px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.footer-col p { font-size: 0.9rem; line-height: 1.7; color: #8a9ab5; }
.footer-col a { color: #8a9ab5; transition: color 0.2s; }
.footer-col a:hover { color: #fff; text-decoration: none; }

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

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

.footer-col li a {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 24px 0;
    text-align: center;
    font-size: 0.85rem;
    color: #5a6a8a;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .scheda-list { columns: 1; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero { padding: 72px 0 64px; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1.05rem; }

    .nav-menu {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(255,255,255,0.99);
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
        box-shadow: var(--shadow-xl);
        gap: 4px;
    }

    .nav-menu.open { display: flex; }

    .nav-toggle { display: flex; }

    .form-row { grid-template-columns: 1fr; }

    .page-header h1 { font-size: 1.7rem; }
    .content-card {
        padding: 28px 24px;
    }

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

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

    .features h2 { font-size: 1.6rem; }

    .page-content { padding: 40px 0 56px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero { padding: 56px 0 48px; }
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: 0.95rem; }
    .tab-btn { flex: 1 1 calc(50% - 4px); text-align: center; }
    .features-grid { grid-template-columns: 1fr; }
    .course-meta { grid-template-columns: 1fr; }
    .footer-grid { gap: 24px; }
    .contact-form { padding: 24px; }
}
