/* --- STILI GLOBALI E VARIABILI --- */
 :root {
 --red: #e63946;
 --navy: #1d3557;
 --light-bg: #f9fafb;
 --mid-gray: #4b5563;
 --border-color: #e2e8f0;
 --text-light: #f3f4f6;
 --box-bg: #fff;
 }

 * { margin:0; padding:0; box-sizing:border-box; }
 body {
 font-family: 'Lato', sans-serif;
 color: #333;
 line-height: 1.6;
 padding-bottom: 4.5rem; /* Spazio per la CTA fluttuante */
 }
  /* NUOVO: Impedisce lo scroll quando il menu mobile è aperto */
  body.nav-open { overflow: hidden; }

 .container {
 max-width: 1200px;
 margin: 0 auto;
 padding: 0 1.5rem;
 }
 .text-center { text-align: center; }
 .max-w-xl { max-width: 800px; margin: 0 auto; margin-bottom: 3rem; }


  /* --- NUOVI STILI HEADER / MENU --- */
  header {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }

  .logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--navy);
    text-decoration: none;
    flex-shrink: 0;
  }
 .logo span { color: var(--red); }

  .header-right-container {
    display: flex;
    align-items: center;
    gap: 15px;
  }

 .cta-button {
 background: var(--red); color: white; padding: 0.5rem 1.25rem; border: none; border-radius: 0.5rem;
 font-size: 0.9rem; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
 transition: background 0.2s, transform 0.2s;
 }
 .cta-button:hover { background: #c12a36; transform: translateY(-1px); }
  /* Stili per i bottoni CTA grandi (usati nel menu mobile) */
  .cta-button.large {
    padding: 1rem 3rem;
    font-size: 1.15rem;
  }

  .nav-link-secondary {
    color: var(--mid-gray);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: inline-block;
  }
  .nav-link-secondary:hover { color: var(--red); }

  #desktop-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .mobile-nav-toggle {
    display: none; /* Nascosto su Desktop */
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.8rem; /* Dimensione icona */
    color: var(--navy);
    z-index: 1100; /* Sopra tutto */
    padding: 0;
    line-height: 1;
  }
  .mobile-nav-toggle.open {
 _20   color: var(--navy);
    position: fixed; /* Lo fissiamo per non farlo scrollare */
    left: 1.5rem;
    top: 1.5rem; /* Stesso padding dell'header */
  }

  #mobile-menu-panel {
    display: none; /* Nascosto di default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    gap: 2rem;
    padding: 2rem;
    overflow-y: auto;
  }
  #mobile-menu-panel.open {
    display: flex;
  }
  #mobile-menu-panel .cta-button {
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
  }
  #mobile-menu-panel .nav-link-secondary {
    font-size: 1.2rem;
    color: var(--navy);
  }

  .mobile-menu-divider {
    height: 1px;
    width: 80px;
    background-color: var(--border-color);
  }

  #mobile-footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }
  #mobile-footer-links a {
    color: var(--mid-gray);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: underline;
  }
  /* --- FINE NUOVI STILI HEADER --- */

  /* --- STILI DROPDOWN LINGUE (Mantenuti) --- */
 .lang-dropdown-wrapper {
 position: relative;
 display: inline-block;
   /* margin-right rimosso, gestito da gap */
 }
 .lang-button {
 background: var(--light-bg);
 color: var(--navy);
 padding: 0.4rem 0.8rem;
 border: 1px solid var(--border-color);
 border-radius: 0.5rem;
 font-size: 0.85rem;
 font-weight: 700;
 cursor: pointer;
 display: flex;
 align-items: center;
 gap: 5px;
 transition: background-color 0.2s;
 }
 .lang-button:hover {
 background-color: #e9e9e9;
 }
 .lang-button .arrow {
 font-size: 0.6rem;
 transition: transform 0.2s;
 }
 .lang-button.open .arrow {
 transform: rotate(180deg);
 }
 .dropdown-content {
 display: none;
 position: absolute;
 right: 0;
 top: 100%;
 margin-top: 5px;
 background-color: white;
 min-width: 150px;
 box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
 z-index: 100;
 border-radius: 0.5rem;
 padding: 5px;
 border: 1px solid var(--border-color);
 text-align: left;
 }
 .dropdown-content.show {
 display: block;
 }
 .lang-link {
 text-decoration: none;
 color: var(--mid-gray);
 font-size: 0.8rem;
 font-weight: 600;
 padding: 8px 10px;
 border-radius: 0.3rem;
 display: block;
 transition: background-color 0.2s;
 }
 .lang-link.active {
 background-color: var(--navy);
 color: var(--text-light);
 box-shadow: none;
 font-weight: 700;
 }
 .lang-link:not(.active):hover {
 background-color: var(--light-bg);
 color: var(--navy);
 }
 /* --- FINE STILI DROPDOWN --- */


 /* --- STILI CALCOLATORE (Esistenti) --- */
 #lic-calculator-wrapper-adj {
 margin: 0 auto;
 max-width: 800px;
 padding: 20px;
 box-sizing: border-box;
   padding-top: 30px;
 }

 h1 {
 font-weight: 800; color: var(--navy); font-size: 2.2rem; text-align: center; margin-bottom: 15px; margin-top: 0;
 }
 h2 {
 font-weight: 600; color: var(--mid-gray); font-size: 1.5rem; text-align: center; margin-top: 0; margin-bottom: 25px;
 }
 p {
 color: var(--mid-gray);
 }

 form {
 max-width: 800px; margin: 0 auto; box-sizing: border-box; padding: 0;
 }

 fieldset#inputs {
 border: none; padding: 25px; margin-bottom: 30px; border-radius: 12px; background: var(--box-bg);
 box-shadow: 6px 5px 30px 0px rgba(0, 0, 0, 0.12); position: relative; box-sizing: border-box;
 }

 fieldset#inputs legend {
 font-family: 'Lato', sans-serif; font-weight: 700; font-size: 1.3rem; color: #fff; background-color: var(--navy);
 padding: 10px 22px; border-radius: 8px; box-shadow: 0 4px 6px rgba(44, 60, 101, 0.2); display: inline-block;
 width: auto; margin-left: 0; position: relative; top: 0px; margin-bottom: 20px;
 }

 #results-container-styled {
 padding: 25px; margin-bottom: 30px; border-radius: 12px; box-sizing: border-box; max-width: 800px;
 margin-left: auto; margin-right: auto; background-color: var(--navy);
 box-shadow: 6px 5px 30px 0px rgba(0, 0, 0, 0.12); color: #fff; border: none;
 }

 #results-container-styled h3 {
 color: #fff; font-weight: 700; font-size: 1.6rem; text-align: left; margin-top: 0; margin-bottom: 15px;
 padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, 0.2);
 }

 .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 30px; }
 .form-group { display: flex; flex-direction: column; }

 label { margin-bottom: 6px; font-weight: 600; font-size: 14px; color: #3e4c59; }
 fieldset#inputs .form-group label { color: #3e4c59; margin-top: 0 !important; }


 input[type="number"] {
 background: #fff; padding: 12px 18px; height: 50px; font-size: 16px; font-weight: 500; border-radius: 8px;
 margin-bottom: 10px; color: #2d3748; border: 1px solid var(--border-color); transition: all 0.2s ease-in-out;
 box-sizing: border-box;
 }

 input[type="number"]:focus {
 outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2);
 }

 small {
 font-size: 0.85em; color: #718096; margin-top: -5px; margin-bottom: 10px; padding-left: 5px;
 display: block; line-height: 1.4;
 }

  .guide-link-container {
   margin-top: -5px;
  }
  .guide-trigger-text {
 color: #003049;
 font-weight: 600;
 cursor: pointer;
 text-decoration: none;
 border-bottom: 1px dotted #003049;
 display: inline-block;
 padding: 4px 6px;
 margin-left: -6px;
 border-radius: 6px;
 transition: all 0.2s ease-in-out; /* Animazione fluida */
 pointer-events: auto;
}

.guide-trigger-text:hover {
 color: #e63946;
 background-color: rgba(230, 57, 70, 0.08);
 border-bottom-style: solid;
 border-bottom-color: #e63946;
}

 .result-item {
 display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-radius: 8px;
 background-color: rgba(255, 255, 255, 0.08); margin-bottom: 10px; border: none; box-shadow: none;
 }
 .result-item strong { font-size: 1.05em; color: #fff; font-weight: 500; }
 .result-item span { font-size: 1.25em; font-weight: 800; color: #69f0ae; }

 .result-item.highlight { background-color: var(--red); border-color: var(--red); margin-top: 15px; }
 .result-item.highlight strong, .result-item.highlight span { color: #ffffff; font-size: 1.35em; }

 #results-container-styled .guide-trigger-text { color: #fff; border-bottom: 1px dotted #fff; }
 #results-container-styled .guide-trigger-text:hover { color: #69f0ae; border-bottom-color: #69f0ae; background-color: rgba(255, 255, 255, 0.15); }

 #analisi-dinamica {
 padding: 20px; margin-top: 25px; border-radius: 10px; border-left: 5px solid; line-height: 1.6;
 font-weight: 500; background-color: #fff;
 }
 #analisi-dinamica h4 {
 margin-top: 0; font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; color: #3e4c59;
 }
 #analisi-dinamica p { color: #4b5563; }

 .scenario-green { border-color: #10b981; color: #10b981; }
 .scenario-yellow { border-color: #f59e0b; color: #d35400; }
 .scenario-red { border-color: var(--red); color: var(--red); }

 #disclaimer-box {
 margin-top: 20px; padding: 15px; background-color: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px;
 }
 #disclaimer-box label {
 font-size: 0.9em; line-height: 1.55; color: var(--navy); align-items: flex-start; display: flex; margin-top: 0; cursor: pointer;
 }
 #disclaimer-box input[type="checkbox"] {
 width: 1.2em; height: 1.2em; margin-right: 12px; margin-top: 4px; flex-shrink: 0; accent-color: var(--red);
 }

 .buttons-container {
 display: flex; justify-content: center; margin-top: 20px; margin-bottom: 30px; padding-top: 10px;
 }
 #calculate-button {
 color: #ffffff; background: var(--red); height: 50px; border-radius: 10px; cursor: pointer; font-weight: 700;
 font-size: 1.1em; box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: all 0.2s ease-in-out;
 letter-spacing: 0.5px; border: none; text-shadow: none; width: 100%; max-width: 280px;
 }
 #calculate-button:hover:not(:disabled) {
 background: #c12a36;
 box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: translateY(-2px);
 }
 #calculate-button:disabled { background-color: #ced4da; cursor: not-allowed; }
 #error-message-consent {
 color: var(--red); font-weight: 600; text-align: center; margin-top: 10px; min-height: 20px;
 }

 #faq-container {
 max-width: 800px; margin: 40px auto 40px auto; padding: 20px 0; border-top: 1px solid var(--border-color);
 }
 #faq-container h4 {
 font-size: 1.2rem; color: var(--navy); margin-bottom: 8px; margin-top: 0; border-bottom: none; font-weight: 700;
 }
 #faq-container p {
 font-size: 1em; line-height: 1.6; color: var(--mid-gray);
 }
 #faq-container a { color: var(--red); font-weight: 700; }

 /* --- STILI FOOTER --- */
 footer {
 text-align: center; padding: 3rem 0; color: #6b7280; font-size: 0.85rem; border-top: 1px solid #e2e8f0;
 margin-top: 60px;
 }
 footer a {
 color: var(--navy); text-decoration: underline; font-weight: 700; transition: color 0.2s;
 }
 footer a:hover { color: var(--red); }
 footer .highlight {
 color: var(--red); font-weight: 700; font-size: 1.1em; letter-spacing: 0.5px;
 }

 /* --- STILE CTA FLUTTUANTE --- */
 .floating-cta {
 position: fixed; bottom: 10px; left: 0; width: 100%; background: transparent; padding: 0.5rem 1.5rem;
 box-shadow: none; z-index: 1000; display: none; text-align: center;
 }
 .floating-cta .cta-button {
 display: inline-block; max-width: 400px; padding: 0.75rem 1.5rem; font-size: 1.05rem; margin: 0 auto;
 }

  /* --- STILI MODAL --- */
  .modal-overlay {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.6);
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 2000;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.3s, visibility 0.3s;
  }
  .modal-overlay.active {
   opacity: 1;
   visibility: visible;
  }
  .modal-box {
   background: white;
   border-radius: 12px;
   max-width: 700px;
   width: 90%;
   max-height: 80vh;
   overflow-y: auto;
   box-shadow: 0 10px 30px rgba(0,0,0,0.2);
   transform: scale(0.95);
   transition: transform 0.3s;
  }
  .modal-overlay.active .modal-box {
   transform: scale(1);
  }
  .modal-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 1.25rem 1.5rem;
   border-bottom: 1px solid var(--border-color);
  }
  .modal-header h3 {
   color: var(--navy);
   font-size: 1.3rem;
   font-weight: 800;
   margin: 0;
  }
  .modal-close-btn {
   font-size: 1.8rem;
   font-weight: 300;
   color: var(--mid-gray);
   background: none;
   border: none;
   cursor: pointer;
   line-height: 1;
  }
  .modal-body {
   padding: 1.5rem;
  }
  .modal-disclaimer {
   background: var(--light-bg);
   border-left: 4px solid var(--red);
   padding: 1rem;
   margin-bottom: 1.5rem;
   font-size: 0.9rem;
  }
  .modal-body h4 {
   color: var(--navy);
   font-weight: 700;
   margin-bottom: 0.5rem;
   margin-top: 1rem;
  }
  .modal-body p, .modal-body ul {
   color: var(--mid-gray);
   margin-bottom: 1rem;
  }
  .modal-body ul {
   padding-left: 20px;
  }

 /* --- MEDIA QUERY UNIFICATO PER MOBILE --- */
 @media (max-width: 600px) {
   /* --- Header Mobile (Nuovo) --- */
      /* NUOVE REGOLE */
      .mobile-nav-toggle {
        display: block;
        flex-shrink: 0;
      }
      .logo {
        flex-grow: 1;
        text-align: center;
        margin: 0 10px;
        font-size: 1.25rem;
      }
      #desktop-navigation {
        display: none;
      }
      .lang-dropdown-wrapper {
        margin-right: 0;
        flex-shrink: 0;
      }
      .header-right-container {
        gap: 0;
      }
      .lang-button {
        padding: 0.4rem 0.5rem;
      }
      /* FINE NUOVE REGOLE */

      /* VECCHIE REGOLE RIMOSSE */

   /* --- Calcolatore Mobile (Esistente) --- */
 .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.1rem; }
  fieldset#inputs { padding: 20px 15px; }
  fieldset#inputs legend { margin-bottom: 10px; font-size: 1.1rem; padding: 8px 15px;}
  #calculate-button { max-width: 100%; }
  .floating-cta { display: block; }
  #lic-calculator-wrapper-adj { padding-top: 20px; }

  /* --- NUOVO: OTTIMIZZAZIONE RISULTATI MOBILE --- */
  
  /* Contenitore Risultati: meno padding laterale per guadagnare spazio */
  #results-container-styled {
    padding: 20px 15px;
  }

  #results-container-styled h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }

  /* Trasforma la riga in una colonna verticale */
  .result-item {
    flex-direction: column; 
    align-items: flex-start; /* Allinea testo a sinistra */
    gap: 8px; /* Spazio tra etichetta e numero */
    padding: 15px; /* Più spazio interno */
  }

  /* Stile dell'Etichetta (Strong) su mobile */
  .result-item strong {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8); /* Leggermente meno forte per dare focus al numero */
    line-height: 1.3;
  }

  /* Stile del Numero (Span) su mobile */
  .result-item span {
    font-size: 1.8rem; /* Numeri MOLTO più grandi */
    font-weight: 900;
    align-self: flex-end; /* Spinge il numero a destra per dinamicità visiva */
    line-height: 1;
  }

  /* Focus specifico per i box evidenziati (Effettiva e Differenza) */
  .result-item.highlight {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid rgba(255,255,255, 0.3); /* Aggiunge un bordo sottile per risaltare */
  }
  
  .result-item.highlight strong {
    color: #fff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .result-item.highlight span {
    font-size: 2.2rem; /* Il risultato finale è gigante */
    margin-top: 5px;
  }
  
  /* Analisi dinamica testo più leggibile */
  #analisi-dinamica {
    padding: 15px;
    font-size: 0.95rem;
  }
}