/* Importa font da Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #007bff; /* Blu vibrante */
    --secondary-color: #6c757d; /* Grigio soft */
    --accent-color: #28a745; /* Verde per azioni positive */
    --dark-bg: #212529; /* Sfondo scuro per header/footer */
    --light-bg: #f8f9fa; /* Sfondo chiaro per sezioni */
    --text-color-dark: #343a40;
    --text-color-light: #ffffff;
    --border-radius: 10px;
    --box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    color: var(--text-color-dark);
    background-color: var(--light-bg);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

ul {
    list-style: none;
}

/* Header */
.main-header {
    background-color: var(--dark-bg);
    color: var(--text-color-light);
    padding: 1.2rem 0;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color-light);
}

.logo-highlight {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-color-light);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    left: 0;
    bottom: 0;
    transition: width 0.3s ease-in-out;
}

.nav-links a:hover::after {
    width: 100%;
}

.auth-buttons .btn {
    margin-left: 1.5rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.login-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn.login-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.btn.signup-btn {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn.signup-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}

.btn.primary-btn {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn.primary-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}

.btn.service-btn {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 5px;
}

.btn.service-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 30px;
    height: 3px;
    background-color: var(--text-color-light);
    margin: 6px 0;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6rem 2rem;
    background: linear-gradient(to right, #e0f7fa, #c2e9fb); /* Gradiente di azzurro */
    min-height: 85vh;
    gap: 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 50%;
    filter: blur(80px);
    animation: blob1 10s infinite ease-in-out alternate;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -70px;
    right: -70px;
    width: 250px;
    height: 250px;
    background-color: rgba(0, 123, 255, 0.08);
    border-radius: 50%;
    filter: blur(90px);
    animation: blob2 12s infinite ease-in-out alternate-reverse;
}

@keyframes blob1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, 30px) scale(1.1); }
}

@keyframes blob2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, -20px) scale(1.05); }
}

.hero-content {
    flex: 1;
    max-width: 650px;
    text-align: left;
    z-index: 10;
}

.hero-content h1 {
    font-size: 3.8rem;
    color: var(--text-color-dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.search-box {
    display: flex;
    gap: 1rem;
    background-color: var(--text-color-light);
    border-radius: var(--border-radius);
    padding: 0.8rem;
    box-shadow: var(--box-shadow);
    max-width: 550px;
}

.search-box input {
    flex-grow: 1;
    padding: 0.8rem 1.2rem;
    border: none;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
    outline: none;
    transition: box-shadow 0.3s ease;
}

.search-box input:focus {
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.search-box .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
}

.search-message {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--secondary-color);
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.search-message.visible {
    opacity: 1;
}

.search-message.error {
    color: #dc3545; /* Rosso per errore */
}
.search-message.success {
    color: var(--accent-color); /* Verde per successo */
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transform: translateY(0);
    transition: transform 0.6s ease-out;
}

.hero-section.animate .hero-image img {
    transform: translateY(-10px);
}

/* Sections common styles */
section {
    padding: 6rem 2rem;
    text-align: center;
}

section h2 {
    font-size: 2.8rem;
    color: var(--text-color-dark);
    margin-bottom: 3.5rem;
    font-weight: 700;
}

/* Services Section */
.services-section {
    background-color: var(--text-color-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background-color: var(--light-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.service-icon {
    font-size: 4.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.8rem;
    color: var(--dark-bg);
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-card p {
    font-size: 1.05rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    flex-grow: 1; /* Per allineare i bottoni */
}

/* How It Works Section */
.how-it-works-section {
    background: linear-gradient(to right, #f0f8ff, #e8f5ff); /* Gradiente più soft */
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    background-color: var(--text-color-light);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.step-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: var(--text-color-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 5px solid var(--light-bg);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.step-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-top: 1.5rem; /* Spazio sotto il numero */
    margin-bottom: 1.5rem;
}

.step-card h3 {
    font-size: 1.6rem;
    color: var(--dark-bg);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.step-card p {
    font-size: 1rem;
    color: var(--secondary-color);
}


/* Call to Action Section */
.cta-section {
    background: linear-gradient(to right, var(--primary-color), #0056b3);
    color: var(--text-color-light);
    padding: 5rem 2rem;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color-light);
}

.cta-content p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* Footer */
.main-footer {
    background-color: var(--dark-bg);
    color: var(--text-color-light);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
}

.footer-brand {
    flex: 1;
    min-width: 200px;
    text-align: left;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-links, .social-media {
    flex: 1;
    min-width: 150px;
    text-align: left;
}

.footer-links h4, .social-media h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-links ul li {
    margin-bottom: 0.7rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--text-color-light);
}

.social-media a {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 1rem;
    transition: color 0.3s ease;
}

.social-media a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 992px) {
    .navbar {
        padding: 0 1.5rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        background-color: var(--dark-bg);
        position: absolute;
        top: 80px; /* Altezza dell'header */
        left: 0;
        padding: 1rem 0;
        box-shadow: var(--box-shadow);
        z-index: 999;
    }

    .nav-links.nav-active {
        display: flex;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .auth-buttons {
        display: none;
    }

    .burger {
        display: block;
    }

    .burger.toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .burger.toggle .line2 {
        opacity: 0;
    }
    .burger.toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 4rem 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .search-box {
        max-width: 100%;
    }

    .hero-image {
        margin-top: 2rem;
    }

    .services-grid, .steps-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .cta-content h2 {
        font-size: 2.2rem;
    }

    .cta-content p {
        font-size: 1.1rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-brand, .footer-links, .social-media {
        text-align: center;
        width: 100%;
        margin-bottom: 2rem;
    }
    .social-media a {
        margin: 0 0.5rem;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .search-box {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.5rem;
    }
    .search-box input {
        width: 100%;
    }
    .search-box .btn {
        width: 100%;
        padding: 0.75rem 1.2rem;
    }
    .btn {
        padding: 0.7rem 1.4rem;
        font-size: 0.9rem;
    }
}