/*Stile home Teoria Integrale Indefinito*/
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    width: 95%;
    margin: 20px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);

    padding: 30px;   
}
    
    .header {
      background: linear-gradient(135deg, #4CAF50, #45a049);
      color: white;
      padding: 30px;
      text-align: center;
    }
    
    .header h1 {
      margin: 0;
      font-size: 2.5em;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    }
    
    .content {
      padding: 30px;
    }
    
    .section {
      margin-bottom: 20px; /* Questo gestisce lo spazio tra i bottoni/sezioni */
      border: 2px solid #e0e0e0;
      border-radius: 10px;
      overflow: hidden;
      transition: all 0.3s ease;
    }
    
    .section:hover {
      border-color: #4CAF50;
      box-shadow: 0 5px 15px rgba(76, 175, 80, 0.2);
    }
    
    /* STATO NORMALE DEL BOTTONE (Grigio chiaro) */
.section-button {
  width: 100%;
  background: #f8f9fa; /* Rimosso gradiente per pulizia */
  border: none;
  padding: 20px;
  font-size: 1.3em;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* AL PASSAGGIO DEL MOUSE (Azzurro tenue) */
.section-button:hover {
  background: #e3f2fd !important; 
  color: #1976d2 !important;
}

/* QUANDO LA SEZIONE È APERTA (Azzurro più deciso) */
.section-button.active {
  background: #bbdefb !important; 
  color: #0d47a1 !important;
  border-left: 6px solid #1976d2; /* Barretta blu laterale */
}
    
    .arrow {
      transition: transform 0.3s ease;
      font-size: 1.2em;
    }
    
    .arrow.rotated {
      transform: rotate(180deg);
    }
    
    .section-content {
      display: none;
      padding: 25px;
      background: #fafafa;
      border-top: 1px solid #e0e0e0;
      line-height: 1.8;
    }
    
    .section-content.active {
      display: block;
      animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    .formula {
      background: #fff;
      padding: 15px;
      border-left: 4px solid #4CAF50;
      margin: 15px 0;
      border-radius: 5px;
      font-family: 'Courier New', monospace;
      font-size: 1.1em;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .example {
      background: #e8f5e8;
      padding: 20px;
      border-radius: 8px;
      margin: 15px 0;
      border: 1px solid #c8e6c9;
    }
    
    .example h4 {
      color: #2e7d32;
      margin-top: 0;
    }
    
    .step {
      background: #fff3e0;
      padding: 15px;
      margin: 10px 0;
      border-radius: 5px;
      border-left: 3px solid #ff9800;
    }

    .step img {
        max-width: 100%; /* Rendi l'immagine responsiva */
        height: auto; /* Mantieni le proporzioni */
        display: block; /* Rimuovi spazio extra sotto l'immagine */
        margin-top: 10px; /* Spazio sopra l'immagine */
        border-radius: 5px; /* Angoli arrotondati per l'immagine */
    }
    
    .example img {
        max-width: 100%; /* Rendi l'immagine responsiva */
        height: auto; /* Mantieni le proporzioni */
        display: block; /* Rimuovi spazio extra sotto l'immagine */
        margin: 15px auto; /* Centra l'immagine e aggiungi spazio */
        border-radius: 5px; /* Angoli arrotondati per l'immagine */
        box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Ombra leggera */
    }

    h3 {
      color: #4CAF50;
      border-bottom: 2px solid #4CAF50;
      padding-bottom: 5px;
    }
    
    .highlight {
      background: #fff176;
      padding: 2px 6px;
      border-radius: 3px;
    }
    /* Stili per l'header */
    .left-image, .right-image {
      max-height: 60px;
      height: auto;
      width: auto;
      max-width: 48%;
      object-fit: contain;
    }
    .header-box {
      width: 100%;
      border: 2px dashed #28a745;
      box-sizing: border-box;
      padding: 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background-color: white;
      min-height: 80px;
      border-radius: 8px;
      margin-bottom: 25px;
      background: white;
      flex-wrap: wrap;
      gap: 10px;
    }
/* Stili specifici per i bottoni Questionario (inversione dei colori dei bottoni Test) */
/* ROLLE - Colore Base: #28a745 (Verde) */
.rolle-questionario-btn {
    display: inline-block;
    padding: 6px 16px; /* RIDOTTO */
    border-radius: 8px;
    font-size: 1.0em; /* RIDOTTO */
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-right: 10px;
    margin-top: 10px;
    /* Inversione: Testo/Bordo Verdi, Sfondo Chiaro */
    background-color: #f8f9fa;
    color: #28a745;
    border: 2px solid #28a745;
}
.rolle-questionario-btn:hover {
    /* Hover Invertito: Sfondo Verde, Testo Bianco */
    background-color: #28a745;
    color: white;
    transform: translateY(-2px);
}

/* LAGRANGE - Colore Base: #007bff (Blu) */
.lagrange-questionario-btn {
    display: inline-block;
    padding: 6px 16px; /* RIDOTTO */
    border-radius: 8px;
    font-size: 1.0em; /* RIDOTTO */
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-right: 10px;
    margin-top: 10px;
    /* Inversione: Testo/Bordo Blu, Sfondo Chiaro */
    background-color: #f8f9fa;
    color: #007bff;
    border: 2px solid #007bff;
}
.lagrange-questionario-btn:hover {
    /* Hover Invertito: Sfondo Blu, Testo Bianco */
    background-color: #007bff;
    color: white;
    transform: translateY(-2px);
}

/* CAUCHY - Colore Base: #ffc107 (Giallo), Testo Scuro: #343a40 */
.cauchy-questionario-btn {
    display: inline-block;
    padding: 6px 16px; /* RIDOTTO */
    border-radius: 8px;
    font-size: 1.0em; /* RIDOTTO */
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-right: 10px;
    margin-top: 10px;
    /* Inversione: Testo Scuro, Bordo Giallo, Sfondo Chiaro */
    background-color: #f8f9fa;
    color: #343a40;
    border: 2px solid #ffc107;
}
.cauchy-questionario-btn:hover {
    /* Hover Invertito: Sfondo Giallo, Testo Scuro */
    background-color: #ffc107;
    color: #343a40;
    transform: translateY(-2px);
}

/* DE L'HOSPITAL - Colore Base: #dc3545 (Rosso) */
.delhospital-questionario-btn {
    display: inline-block;
    padding: 6px 16px; /* RIDOTTO */
    border-radius: 8px;
    font-size: 1.0em; /* RIDOTTO */
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-right: 10px;
    margin-top: 10px;
    /* Inversione: Testo/Bordo Rossi, Sfondo Chiaro */
    background-color: #f8f9fa;
    color: #dc3545;
    border: 2px solid #dc3545;
}
.delhospital-questionario-btn:hover {
    /* Hover Invertito: Sfondo Rosso, Testo Bianco */
    background-color: #dc3545;
    color: white;
    transform: translateY(-2px);
}
@media print {
    /* 1. Nascondiamo tutti i bottoni di navigazione, inclusi Indice test e quesiti */
    .header-box, 
    .rolle-questionario-btn, 
    .lagrange-questionario-btn, 
    .cauchy-questionario-btn, 
    .delhospital-questionario-btn,
    a[href*="indice"],
    p[style*="justify-content: center"],
    .arrow {
        display: none !important;
    }

    /* 2. Rendiamo visibili tutte le sezioni */
    .section-content {
        display: block !important;
        opacity: 1 !important;
        border: none !important;
        background: transparent !important;
        padding: 10px 0 !important;
    }

    /* 3. Pulizia del layout per risparmiare inchiostro */
    body {
        background: white !important;
        padding: 0 !important;
    }

    .container {
        box-shadow: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border: none !important;
    }

    .header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #4CAF50;
        padding: 10px 0 !important;
    }

    .header h1 {
        text-shadow: none !important;
        color: #2e7d32 !important;
    }

    .section {
        border: none !important;
        border-bottom: 1px solid #eee !important;
        page-break-inside: avoid; /* Evita di tagliare una sezione tra due pagine */
    }

    .section-button {
        background: white !important;
        color: #2e7d32 !important;
        text-align: left !important;
        padding: 5px 0 !important;
        font-size: 1.4em !important;
    }
}
.btn-test {
    background-color: #00bcd4 !important; /* Azzurro vivace */
    color: white !important;
}

.btn-test:hover {
    background-color: #00acc1 !important; /* Azzurro leggermente più scuro al passaggio del mouse */
    transform: translateY(-2px);
}
/* Stile per il bottone del Test nel footer */
.btn-test-link {
    display: inline-block;
    background-color: #0056b3; /* Blu in contrasto con il verde */
    color: white !important;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px; /* Arrotondato */
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 10px 0;
}

.btn-test-link:hover {
    background-color: #004494;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}

/* Nascondi il bottone durante la stampa */
@media print {
    .btn-test-link {
        display: none !important;
    }
}
/* --- NUOVO STILE FOOTER UNIFORMATO --- */
.footer-container {
    padding: 30px 20px;
border-top: 3px solid #4a9edd;    background-color: #f9f9f9;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-row { width: 100%; }
.flex-row { 
    display: flex; 
    justify-content: center; 
    gap: 12px; 
    flex-wrap: wrap; 
}

.btn-footer {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.btn-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.2);
    background-color: white !important;
}

/* Colori Specifici */
.btn-bordeaux { background-color: #9b1c1c; color: white; border-color: #9b1c1c; }
.btn-bordeaux:hover { color: #9b1c1c !important; }

.btn-teal { background-color: #008080; color: white; border-color: #008080; }
.btn-teal:hover { background-color: white; color: #008080; }
.btn-dsa { background-color: #ff9800; color: white; border-color: #ff9800; }
.btn-dsa:hover { color: #ff9800 !important; }

.btn-test-light { background-color: #00bcd4; color: white; border-color: #00bcd4; }
.btn-test-light:hover { color: #00bcd4 !important; }

.btn-test-dark { background-color: #0056b3; color: white; border-color: #0056b3; }
.btn-test-dark:hover { color: #0056b3 !important; }

.btn-green { background-color: #4CAF50; color: white; border-color: #4CAF50; }
.btn-green:hover { color: #4CAF50 !important; }

.btn-green-light { background-color: #45a049; color: white; border-color: #45a049; }
.btn-green-light:hover { color: #45a049 !important; }

/* Nascondi durante la stampa */
@media print {
    .footer-container { display: none !important; }
}
/* STATO NORMALE: Giallo Oro con bordo coordinato */
.btn-fisica-gold {
    background-color: #ffcc00 !important;
    color: #333 !important;
    /* Usiamo 2px per pareggiare il bordo trasparente della classe .btn-footer */
    border: 2px solid #ffcc00 !important; 
    box-shadow: 0 3px 6px rgba(0,0,0,0.1) !important;
    font-weight: bold;
}

/* STATO HOVER: Sfondo Bianco, Testo e Bordo Blu */
.btn-fisica-gold:hover {
    background-color: #ffffff !important; /* Sfondo bianco */
    color: #003366 !important;            /* Testo Blu Notte */
    border-color: #003366 !important;     /* Bordo Blu Notte */
    
    /* Effetti di profondità */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
    transform: translateY(-1px);
    transition: all 0.3s ease;             /* Rende il cambio colore fluido */
}
/* STATO NORMALE: Viola con testo bianco */
.btn-viola {
    background-color: #6a1b9a !important; 
    color: #ffffff !important;
    border: 2px solid #6a1b9a !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1) !important;
    font-weight: bold;
    padding: 10px 20px; /* Spaziatura interna opzionale */
    border-radius: 4px;  /* Arrotondamento angoli opzionale */
    transition: all 0.3s ease !important;
    cursor: pointer;
}

/* STATO HOVER: Inversione (Bianco con bordo e testo viola) */
.btn-viola:hover {
    background-color: #ffffff !important;
    color: #6a1b9a !important;
    border-color: #6a1b9a !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
    transform: translateY(-1px);
}
.footer-container .btn-footer {
    min-width: 200px;
    width: 200px;
    text-align: center;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .footer-container .btn-footer {
        min-width: 0;
        width: 100%;
        white-space: normal;
    }
}
.btn-questionario { background-color: #e65100; color: white; border-color: #e65100; }
.btn-questionario:hover { color: #e65100 !important; }