/* --- Reset & Global Styles --- */
:root {
    --primary-color: #FF6B6B; /* Un rosso-corallo vivace */
    --secondary-color: #4ECDC4; /* Un verde acqua fresco */
    --background-color: #F7FFF7; /* Un bianco-verde molto chiaro */
    --text-color: #292F36; /* Un grigio scuro quasi nero */
    --heading-font: 'Pacifico', cursive;
    --body-font: 'Poppins', sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    line-height: 1.2;
    font-weight: 600;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    font-weight: 700;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

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

.btn-secondary:hover {
    background-color: transparent;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-3px);
}

/* --- Navbar --- */
.navbar {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--heading-font);
    font-size: 2rem;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-logo img {
    height: 45px;
    width: auto;
    display: block;
    animation: pulse 2.5s infinite ease-in-out;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.lang-switcher .flag {
    cursor: pointer;
    margin: 0 5px;
    transition: transform 0.2s ease;
}

.lang-switcher .flag:hover {
    transform: scale(1.1);
}

/* --- Hero Section --- */
.hero {
    background-image: linear-gradient(rgba(247, 255, 247, 0.2), rgba(247, 255, 247, 0.2)), url('assets/body3.png');
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: center;
    text-align: center;
    min-height: 350px;
}

.hero-title {
    margin-bottom: 0rem;
    margin-top: 0rem;
    text-align: center;
    font-family: 'Amatic SC', cursive;
    text-transform: uppercase;
    font-size: 4rem;
    font-weight: 700;
    padding-top: 2rem;
    animation: pulse 2.5s infinite ease-in-out;
}

/* --- Books Section --- */
.books-section {
    padding: 0 0 80px;
}

.intro-text {
    text-align: center;
    font-size: 1.8rem;
    max-width: 700px;
    margin: 10px auto 20px auto;
    line-height: 1.1;
    font-family: 'Amatic SC', cursive;
    font-weight: 700;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 80px 40px;
}

.book-card {
    background-color: transparent;
    box-shadow: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.book-card:hover {
    transform: translateY(-10px);
}

.book-cover {
    height: 280px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.book-cover img {
    height: 100%;
    width: auto;
    display: block;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.book-cover-stack {
    position: relative;
    width: 200px;
    height: 280px;
    margin: 0 auto;
}

.book-cover-stack img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-cover-stack .book-cover-front {
    z-index: 2;
    transform: rotate(5deg);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
}

.book-cover-stack .book-cover-back {
    z-index: 1;
    transform: rotate(-5deg) translateX(-45px) translateY(-15px);
    box-shadow: -5px -5px 15px rgba(0, 0, 0, 0.2);
}

.book-card:hover .book-cover-stack .book-cover-front {
    transform: rotate(2deg) scale(1.05);
    box-shadow: 7px 7px 20px rgba(0, 0, 0, 0.3);
}

.book-card:hover .book-cover-stack .book-cover-back {
    transform: rotate(-7deg) translateX(-51px) translateY(-50px) scale(1.05);
    box-shadow: -7px -7px 20px rgba(0, 0, 0, 0.3);
}

.book-info {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-top: -60px;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    z-index: 1;
}

.book-info .btn {
    align-self: center;
}

.book-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.book-description {
    flex-grow: 1;
    margin-bottom: 25px;
}

/* --- About Section --- */
.about-section {
    padding: 80px 0;
    background-color: white;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image img {
    width: 100%;
    max-width: 300px;
    border-radius: 50%;
    box-shadow: var(--shadow);
    border: 5px solid var(--secondary-color);
}

/* --- Survey Section --- */
.sondaggio-section {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
}

.sondaggio-section p {
    max-width: 600px;
    margin: 0 auto 30px auto;
    font-size: 1.1rem;
}


/* --- Contact Section --- */
.contact-section {
    padding: 80px 0;
    text-align: center;
}

.contact-section p {
    max-width: 500px;
    margin: 0 auto 30px auto;
    font-size: 1.1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: white;
    color: var(--primary-color);
    transform: scale(1.05);
}

.social-link svg {
    stroke: var(--primary-color);
    transition: stroke 0.3s ease;
}

.social-link:hover svg {
    stroke: var(--primary-color);
}

/* --- Footer --- */
.footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 20px 0;
}

/* --- Keyframe Animations --- */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.07);
    }
    100% {
        transform: scale(1);
    }
}

/* --- Survey & Thank You Page Styles --- */
.survey-page-section, .thank-you-section {
    padding: 60px 0;
}

.survey-header, .thank-you-header {
    text-align: center;
    margin-bottom: 40px;
}

.survey-header p, .thank-you-header p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* --- Form Styles --- */
.survey-page-section form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.survey-page-section fieldset {
    border: none;
    margin-bottom: 35px;
    padding: 0;
}

.survey-page-section legend {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
    width: 100%;
}

.survey-page-section label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 1rem;
}

.survey-page-section label[for] {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
}

.survey-page-section input[type="checkbox"],
.survey-page-section input[type="radio"] {
    margin-right: 12px;
    flex-shrink: 0;
    width: 1.2em;
    height: 1.2em;
    accent-color: var(--secondary-color);
}

.survey-page-section input[type="number"],
.survey-page-section input[type="email"],
.survey-page-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--body-font);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.survey-page-section input[type="number"]:focus,
.survey-page-section input[type="email"]:focus,
.survey-page-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.survey-page-section textarea {
    resize: vertical;
    min-height: 100px;
}

.survey-page-section form .btn {
    width: 100%;
    font-size: 1.2rem;
    padding: 15px 30px;
}

.subcategory-group {
    padding-left: 25px;
    margin-top: 15px;
    border-left: 3px solid #f0f0f0;
}

/* --- Thank You Page Styles --- */
.cta-section {
    max-width: 800px;
    margin: 20px auto 0 auto;
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.cta-section h2 {
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 15px;
}

.cta-section p {
    margin-bottom: 25px;
}

.share-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eee;
}

.share-section .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-covers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.cta-covers a {
    display: block;
    transition: transform 0.3s ease;
}

.cta-covers a:hover {
    transform: scale(1.08) translateY(-5px);
}

.cta-covers img {
    height: 200px;
    width: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* --- Animations on Scroll --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 75px; /* Altezza approssimativa della navbar */
        gap: 0;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }

    .nav-menu.active {
        left: 0;
    }
    .nav-item {
        margin: 16px 0;
    }

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

    .section-title {
        font-size: 2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-image {
        order: -1; /* Move image above text on mobile */
        margin-bottom: 30px;
    }

    .about-image img {
        margin: 0 auto;
    }
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 450px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.modal-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.modal-close-btn {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.modal-close-btn:hover {
    background-color: transparent;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}