/* ============================================
   VARIABILI CSS E RESET
   ============================================ */
:root {
    /* Colori principali */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Colori neutri */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Tipografia */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', serif;
    
    /* Spacing (sistema 8px) */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    
    /* Transizioni */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: #ffffff;
    overflow-x: hidden;
    animation: fadeIn 0.8s ease-in-out;
}

/* ============================================
   UTILITÀ GENERALI
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
    animation: fadeInUp 0.8s backwards;
    animation-delay: 0.2s;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    min-width: 140px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.4);
}

/* Resetta l'aspetto del pulsante della copertina */
.book-cover-button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* Aggiunge uno stile di focus personalizzato e accessibile */
.book-cover-button:focus .book-cover {
  box-shadow: 
    0 0 0 3px var(--primary-dark),
    0 20px 40px rgba(0, 0, 0, 0.3);
  transform: rotateY(-10deg) rotateX(2deg) scale(1.05);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #e39353 0%, #b52626 100%);
}

.hero-background {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: var(--space-8) 0;
}

.hero-content .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-4);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-family: var(--font-display);
    color: white;
    margin-bottom: var(--space-4);
    line-height: 1.1;
}

.title-main {
    display: block;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
}

.title-sub {
    display: block;
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 400;
    opacity: 0.9;
    margin-top: var(--space-2);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-2);
    font-weight: 300;
}

.hero-author {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-8);
}

.hero-cta {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* Book 3D Effect */
.hero-book {
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-cover {
    position: relative;
    width: 240px;
    height: 320px;
    transform-style: preserve-3d;
    transform: rotateY(-15deg) rotateX(5deg);
    transition: var(--transition);
    cursor: pointer;
}

.book-cover:hover {
    transform: rotateY(-10deg) rotateX(2deg) scale(1.05);
}

.book-spine {
    position: absolute;
    left: -12px;
    top: 0;
    width: 12px;
    height: 100%;
    background: #333; /* Colore della costa del libro */
    transform: rotateY(-90deg);
    transform-origin: left center;
}

.book-front {
    width: 100%;
    height: 100%;
    background-image: url('img/cover.jpg'); /* Sostituisci con il percorso della tua immagine */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 1;
    transition: var(--transition);
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: rotate(45deg) translateY(0);
    }
    40% {
        transform: rotate(45deg) translateY(-10px);
    }
    60% {
        transform: rotate(45deg) translateY(-5px);
    }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   BOOK SECTION
   ============================================ */
.book-section {
    position: relative;
    padding: var(--space-24) 0;
    background: var(--gray-50);
    overflow: hidden;
}

.section-background {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
    z-index: 1;
}

.purchase-section .container {
    position: relative;
    z-index: 2;
}

.book-section .container {
    position: relative;
    z-index: 2;
}

.book-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: start;
    animation: fadeInUp 0.8s backwards;
    animation-delay: 0.2s;
}

.book-description h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: var(--space-6);
}

.book-description p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: var(--space-6);
}

.target-audience {
    background: white;
    padding: var(--space-8);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: var(--space-8);
}

.target-audience h4 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

.target-audience ul {
    list-style: none;
}

.target-audience li {
    padding: var(--space-2) 0;
    color: var(--gray-700);
    position: relative;
    padding-left: var(--space-6);
}

.target-audience li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.book-themes h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: var(--space-8);
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.theme-card {
    background: white;
    padding: var(--space-6);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.theme-icon {
    font-size: 2rem;
    margin-bottom: var(--space-4);
}

.theme-card h4 {
    font-size: 1.125rem;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.theme-card p {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* ============================================
   DETAILS SECTION
   ============================================ */
.details-section {
    padding: var(--space-24) 0;
    background: white;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
    animation: fadeInUp 0.8s backwards;
    animation-delay: 0.2s;
}

.detail-card {
    background: var(--gray-50);
    padding: var(--space-8);
    border-radius: 1rem;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.detail-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.price-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.price-card:hover {
    border-color: var(--accent-color);
}

.detail-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
}

.detail-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--gray-900);
}

.price-card h3 {
    color: white;
}

.detail-card p {
    font-size: 1rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.price-card p {
    color: rgba(255, 255, 255, 0.9);
}

.price {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: white !important;
}

/* ============================================
   PURCHASE SECTION
   ============================================ */
.purchase-section {
    position: relative;
    padding: var(--space-24) 0;
    background: var(--gray-50);
    overflow: hidden;
}

.purchase-section .section-background {
    background: 
        radial-gradient(circle at 70% 30%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 30% 70%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
}

.purchase-options {
    max-width: 1000px;
    margin: 0 auto;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-16);
}

.store-card {
    background: white;
    padding: var(--space-8);
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.store-logo {
    width: 80px; /* o la dimensione che preferisci */
    height: auto;
    margin-bottom: var(--space-4);
    object-fit: contain;
    filter: grayscale(20%); /* opzionale - per un look più uniforme */
    transition: var(--transition);
}

.store-card:hover .store-logo {
    filter: grayscale(0%) brightness(1.05); /* opzionale - effetto al hover */
}
.store-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

.store-card p {
    color: var(--gray-600);
    margin-bottom: var(--space-4);
    line-height: 1.5;
}

.store-cta {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.store-card.unavailable {
    opacity: 0.6;
    filter: grayscale(80%);
}

.store-card.unavailable:hover {
    opacity: 0.8;
    filter: grayscale(0);
}

/* Carta del Docente */
.carta-docente {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border-radius: 1rem;
    padding: var(--space-8);
    color: white;
    text-align: center;
}

.carta-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.carta-logo {
    width: 50px; /* Dimensione ottimale per loghi */
    height: 50px;
    object-fit: contain; /* Mantiene le proporzioni */
    display: block; /* Risolve problemi di spazio */
}

.carta-content p {
    font-size: 1.125rem;
    margin-bottom: var(--space-8);
    opacity: 0.95;
}

.carta-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: var(--space-3);
}

.step p {
    font-size: 0.875rem;
    margin: 0;
}

.carta-note {
    font-size: 0.875rem !important;
    opacity: 0.8 !important;
    font-style: italic;
}

/* ============================================
   REVIEWS SECTION
   ============================================ */
.reviews-section {
    padding: var(--space-24) 0;
    background: white;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-8);
    animation: fadeInUp 0.8s backwards;
    animation-delay: 0.2s;
}

.review-card {
    background: var(--gray-50);
    padding: var(--space-8);
    border-radius: 1rem;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.review-header {
    margin-bottom: var(--space-6);
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.reviewer-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.reviewer-details h4 {
    font-size: 1rem;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.stars {
    font-size: 0.875rem;
}

.review-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
    font-style: italic;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--gray-900);
    color: white;
    padding: var(--space-12) 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.footer-book h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
}

.footer-book p {
    color: var(--gray-400);
    margin-bottom: var(--space-1);
}

.footer-links {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .hero-content .container {
        grid-template-columns: 1fr;
        gap: var(--space-12);
        text-align: center;
    }
    
    .book-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .themes-grid {
        grid-template-columns: 1fr;
    }
    
    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    :root {
        --space-16: 3rem;
        --space-20: 4rem;
        --space-24: 5rem;
    }
    
    .container {
        padding: 0 var(--space-3);
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .book-cover {
        width: 200px;
        height: 280px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .store-grid {
        grid-template-columns: 1fr;
    }
    
    .carta-steps {
        grid-template-columns: 1fr;
    }
    
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .title-main {
        font-size: 2.5rem;
    }
    
    .title-sub {
        font-size: 1.25rem;
    }
}

/* Mobile Small (< 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-2);
    }
    
    .hero-section {
        min-height: 90vh;
    }
    
    .book-cover {
        width: 160px;
        height: 220px;
    }
    
    .theme-card,
    .detail-card,
    .review-card {
        padding: var(--space-4);
    }
    
    .carta-docente {
        padding: var(--space-4);
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

/* ============================================
   ANIMAZIONI PERSONALIZZATE
   ============================================ */

/* Fade in animation per gli elementi quando entrano in viewport */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animazione per le card al hover */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
}

/* Accessibility - Rispetta le preferenze di movimento ridotto */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .scroll-arrow {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .hero-background,
    .section-background,
    .scroll-indicator {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        min-height: auto !important;
    }
    
    .btn {
        border: 1px solid black !important;
        background: white !important;
        color: black !important;
    }
}

/* Stili popup */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: fadeIn 0.3s;
}

.full-cover {
    max-height: 90vh;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-popup {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-popup:hover {
    transform: scale(1.2);
}

/* Animazione */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile specific */
@media (max-width: 768px) {
    .popup-content {
        max-width: 95%;
    }
    
    .close-popup {
        top: -35px;
        font-size: 1.8rem;
    }
}
/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
    padding: var(--space-24) 0;
    background: var(--gray-50);
    position: relative;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info {
    padding: var(--space-8);
}

.contact-info h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: var(--space-6);
}

.contact-info p {
    margin-bottom: var(--space-6);
    color: var(--gray-700);
}

.contact-method {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-form {
    background: white;
    padding: var(--space-8);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-2);
    color: var(--gray-700);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.checkbox-group input {
    width: auto;
}

.form-message {
    margin-top: var(--space-6);
    padding: var(--space-3);
    border-radius: 0.5rem;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* Responsive */
@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-method {
        justify-content: center;
    }
}
/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Mobile */
@media (max-width: 768px) {
    .back-to-top {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .back-to-top svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}
/* ============================================
   MUSIC CONTROL
   ============================================ */
.music-control {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: none; /* Inizialmente nascosto, verrà mostrato via JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
}

.music-control:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.music-control svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Mobile */
@media (max-width: 768px) {
    .music-control {
        width: 3rem;
        height: 3rem;
        bottom: 5rem;
        right: 1.5rem;
    }
    
    .music-control svg {
        width: 1rem;
        height: 1rem;
    }
}
/* ============================================
   STILI DI ACCESSIBILITÀ
   ============================================ */

/*
 * Migliora la visibilità dell'elemento in focus per la navigazione da tastiera.
 * Applica un'ombra coerente con il design del sito.
 */
a:focus,
button:focus,
input[type="checkbox"]:focus + label {
  outline: none; /* Rimuove il bordo di default che può essere inconsistente */
  box-shadow: 0 0 0 3px var(--primary-dark); /* Crea un anello di focus visibile */
  border-radius: 4px; /* Opzionale: smussa gli angoli dell'ombra */
}

/* Stile di focus specifico per gli input del form */
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3); /* Mantiene lo stile che hai già, ottimo! */
}