/* Reset e impostazioni base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    font-family: 'Montserrat', sans-serif;
    background-color: #ffffff;
    color: #111111;
    line-height: 1.6;
}

/* Margine di sicurezza per l'ancoraggio sotto la navbar fissa */
header[id], section[id] {
    scroll-margin-top: 85px;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 5%;
}

/* --- Fascia di navigazione --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: #ffffff;
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease, padding 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 10px 5%;
}

.navbar .logo img {
    height: 68px;
    width: auto;
    display: block;
    transition: height 0.3s ease;
}

.navbar.scrolled .logo img {
    height: 56px;
}

.navbar .menu {
    display: flex;
    align-items: center;
}

.navbar .menu a {
    text-decoration: none;
    color: #111111;
    margin-left: 32px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    transition: color 0.3s ease;
}

.navbar .menu a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: #111111;
    transition: width 0.3s ease;
}

.navbar .menu a:hover::after,
.navbar .menu a.active::after {
    width: 100%;
}

/* Pulsante menu mobile */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #111111;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* --- Sezione Hero (#home) --- */
.hero {
    position: relative;
    height: calc(100vh - 98px);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1531482615713-2afd69097998?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    filter: grayscale(100%) contrast(105%);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
    padding: 0 20px;
}

/* Animazione comparsa sfumata dall'alto */
.fade-in-top {
    opacity: 0;
    transform: translateY(-45px);
    animation: fadeInTop 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeInTop {
    0% {
        opacity: 0;
        transform: translateY(-45px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 3.8rem;
    font-weight: 900;
    line-height: 1.12;
    margin-bottom: 32px;
    letter-spacing: -1px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

/* --- Pulsanti --- */
.btn {
    display: inline-block;
    padding: 15px 36px;
    background-color: #ffffff;
    color: #111111;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: 2px solid #ffffff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #111111;
    color: #ffffff;
    border-color: #111111;
    transform: translateY(-2px);
}

.btn-dark {
    background-color: #111111;
    color: #ffffff;
    border-color: #111111;
}

.btn-dark:hover {
    background-color: #ffffff;
    color: #111111;
}

/* --- Sezioni interne (#corsi, #chisiamo, #contatti) --- */
.section {
    padding: 90px 0;
    background-color: #ffffff;
}

.section-alt {
    background-color: #f4f4f4;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    text-align: center;
    margin-bottom: 14px;
}

.section-subtitle {
    text-align: center;
    color: #555555;
    max-width: 640px;
    margin: 0 auto 50px;
    font-size: 1.05rem;
}

/* Griglia Corsi */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.card {
    background-color: #ffffff;
    border: 2px solid #111111;
    padding: 32px 26px;
    border-radius: 4px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 6px 6px 0 #111111;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.card p {
    color: #444444;
    font-size: 0.95rem;
}

/* Chi Siamo */
.about-box {
    max-width: 780px;
    margin: 24px auto 0;
    text-align: center;
    font-size: 1.08rem;
    color: #333333;
}

.about-box p + p {
    margin-top: 18px;
}

/* Modulo Contatti */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    border: 2px solid #cccccc;
    border-radius: 4px;
    transition: border-color 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #111111;
}

.alert-success {
    max-width: 600px;
    margin: 0 auto 24px;
    padding: 15px 20px;
    background-color: #111111;
    color: #ffffff;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
}

/* Footer */
.footer {
    background-color: #111111;
    color: #ffffff;
    text-align: center;
    padding: 28px 0;
    font-size: 0.9rem;
}

.footer a {
    color: #ffffff;
    text-decoration: underline;
    margin-left: 8px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .navbar .menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #ffffff;
        flex-direction: column;
        align-items: center;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        border-bottom: 1px solid transparent;
        transition: max-height 0.35s ease, padding 0.35s ease;
    }

    .navbar .menu.active {
        max-height: 260px;
        padding: 20px 0;
        border-bottom-color: #eaeaea;
    }

    .navbar .menu a {
        margin: 12px 0;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .section {
        padding: 65px 0;
    }
}
