  /* Overlay di sfondo */
  .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
  }

  .modal-overlay.active {
    display: flex;
  }

  /* Box della modale */
  .modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
  }

  .modal-box h2 {
    margin-top: 0;
  }

  .modal-close-btn {
    margin-top: 20px;
    padding: 10px 25px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
  }

  .modal-close-btn:hover {
    background: #0056b3;
  }

  .modal-close-x {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 20px;
    color: #888;
    background: none;
    border: none;
  }

  .modal-close-x:hover {
    color: #333;
  }

  /* Focus visibile e ben distinguibile per la navigazione da tastiera */
  .modal-close-btn:focus-visible,
  .modal-close-x:focus-visible {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
  }

  /* Fallback per browser che non supportano :focus-visible */
  .modal-close-btn:focus,
  .modal-close-x:focus {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
  }

  /* Testo visibile solo agli screen reader, utile per annunci di stato */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }