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

html {
  scroll-behavior: smooth;
}

body {
    font-family: 'roboto', sans-serif;
    background: #f4f4f4;
    color: #333;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #005bb5;
  padding: 10px 20px;
  flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 90px;
    height: auto;
}

header h1 {
    font-size: 28px;
    font-weight: bold;
    color: white;
}

.navbar {
  width: 100%;
  transition: max-height 0.3s ease-out;
  
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  max-width: 100%;
  overflow-x: hidden;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  padding: 12px 20px;
  transition: background 0.3s;
}

.nav-links a, button {
  transition: background 0.3s, color 0.3s;
}

.nav-links a:hover {
    background: #003f7f;
    color: #fff;
}

.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.dark-mode-toggle .label-dark {
  font-weight: bold;
  color: #fffdfd;
  font-size: 14px;
}

.dark-mode-toggle input {
  display: none;
}

.dark-mode-toggle label {
  display: block;
  width: 60px;
  height: 30px;
  background: #ccc;
  border-radius: 30px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.dark-mode-toggle .switch {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.dark-mode-toggle input:checked + label {
  background: #ffc107;
}

.dark-mode-toggle input:checked + label .switch {
  transform: translateX(30px);
}

/* Dark Mode label color */
.dark-mode .dark-mode-toggle .label-dark {
  color: #ffc107;
}



section {
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    text-align: center;
}

.why {
    text-align: left;
    list-style: disc; 
    margin-left: 20px;
}

h2.first {
    text-align: center;
    margin-bottom: 20px;
}

.map-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* proporzione 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

label {
    display: block;
    font-weight: bold;
    color: #005a9c;
    margin-bottom: 5px;
    text-align: left;
    width: 100%;
}

.required::after {
    content: " *";
    color: red;
    font-weight: bold;
}

input, textarea {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #005a9c;
    border-radius: 6px;
    font-size: 16px;
}

button {
    background: #0073e6;
    color: white;
    border: none;
    padding: 12px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 6px;
    font-size: 16px;
    width: 100%;
}

button:hover {
    background: #005bb5;
    color: #fff;
}

.success-message {
    display: none;
    color: green;
    font-size: 14px;
    margin-top: 10px;
}

/* quiz home page */

.quiz-call {
  background: #fff;
  padding: 40px 20px;
  text-align: center;
  border-radius: 10px;
  margin: 40px auto;
  max-width: 800px;
}

.quiz-call h2 {
  color: #005a9c;
  margin-bottom: 15px;
}

.quiz-call p {
  color: #333;
  font-size: 16px;
  margin-bottom: 25px;
}

.btn-quiz {
  display: inline-block;
  background: #0073e6;
  color: #fff;
  padding: 12px 25px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.3s;
}

.btn-quiz:hover {
  background: #005bb5;
}


.nuova-rappresentanza {
    max-width: 90%;
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    background: #e6f2ff;
    border-radius: 10px;
}

h2.txt {
    margin-bottom: 10px;
}


.team-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.team-member {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    text-align: center;
    flex: 1;
    min-width: 220px;
}

.team-member img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #005a9c;
}

.team-member h3 {
    margin-top: 10px;
    font-size: 18px;
    color: #005a9c;
}

.team-member p {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin-top: 10px;
}

.leggi-di-piu {
    display: inline-block;
    margin-top: 8px;
    color: #005a9c;
    text-decoration: none;
    font-weight: bold;
}

.leggi-di-piu:hover {
    text-decoration: underline;
}

/* Formazione */

.formazione-olp {
  background: #f9f9f9;
  padding: 30px;
  margin-top: 40px;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.05);
  max-width: 700px;
}

.formazione-olp h2 {
  color: #0073e6;
  font-size: 22px;
  margin-bottom: 20px;
}

.formazione-olp h3 {
  font-size: 18px;
  color: #333;
  margin-top: 20px;
}

.temi-formazione {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.temi-formazione li {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.5;
}

.button-link {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: #0073e6;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.3s ease;
}

.button-link:hover {
  background: #005bb5;
}

/*quiz*/

.form-container {
  position: relative;
  width: 100%;
  padding-bottom: 150%; /* Proporzione verticale (aumenta se il form è lungo) */
  height: 0;
  overflow: hidden;
}

.form-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* Contatti */

.form-collaborazione {
  background: #f9f9f9;
  padding: 30px;
  margin: 30px auto;
  max-width: 900px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.form-collaborazione h2 {
  color: #005a9c;
  margin-bottom: 15px;
  font-size: 24px;
}

.form-collaborazione p {
  font-size: 16px;
  margin-bottom: 20px;
  color: #333;
}

/* NOTIZIE */

.notizie-header {
  color: #333;
  padding: 20px;
  text-align: center;
  margin-bottom: 30px;
}

.notizie-header h2 {
  margin: 0;
  font-size: 2.2em;
  letter-spacing: 1px;
}

.notizie-header p {
  margin: 10px 0 0;
  font-size: 1.1em;
  color: #666666;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.news-card {
  background: #f4f4f4;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.news-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.news-card h3 {
  color: #005bb5;
}

.news-card .date {
  font-size: 0.9em;
  color: #666;
}

.news-card p {
  margin-top: 10px;
  flex-grow: 1;
}

.news-card button {
  background: #005bb5;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
  font-weight: bold;
}

.news-card button:hover {
  background: #003f7f;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  position: relative;
}

.modal-content h3 {
  color: #005bb5;
}

.modal-content p {
  margin-top: 10px;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.close:hover {
  color: #005bb5;
}

.newsletter {
  background: #f9f9f9;
  padding: 30px;
  margin: 30px auto;
  max-width: 600px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.newsletter h2 {
  color: #005a9c;
}

.newsletter p {
  color: #333;
}

.newsletter label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}

.newsletter input {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  margin-bottom: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.newsletter button {
  background: #005a9c;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

.newsletter button:hover {
  background: #003f7f;
}


/* FOOTER */

footer {
  text-align: center;
  background: #002147;
  color: #fff;
  padding: 20px;
  margin-top: 20px;
} 

a {
    color: #ffcc00;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

.copyright {
    margin-top: 15px;
    font-size: 12px;
    color: #ccc;
}

/* DARKMODE */

/* UNIFIED DARK MODE STYLES */
.dark-mode {
  /* Overall Background & Text */
  background: #1c1c1c;
  color: #f0f0f0;
}

/* Header & Footer Dark */
.dark-mode header,
.dark-mode footer {
  background: #131313;
}


/* Nav in Dark Mode */
.dark-mode nav ul {
  background: none; /* If you want the nav to match header, remove this line */
}

/* Links & Hover in Dark Mode */
.dark-mode .nav-links a,
.dark-mode a {
  color: #ffc107;
}

.dark-mode .nav-links a:hover {
  background: #444;
  color: #ffc107;
}

/* Sections in Dark Mode */
.dark-mode section {
  background: #2a2a2a;
  color: #eee;
}

/* quiz home page */

.dark-mode .quiz-call{
  background: #333;
  color: #fff;
}

.dark-mode .quiz-call h2 {
  color: #ffc107;
}

.dark-mode .quiz-call p {
  color: #fff;
}

.dark-mode .btn-quiz {
  background: #ffc107;
  color: #333;
}

.dark-mode .btn-quiz:hover {
  background: #e0a800;
}

/* Labels & Headings */
.dark-mode label,
.dark-mode h3 {
  color: #ffc107;
}

/* Buttons */
.dark-mode button {
  background: #ffc107;
}

/* Team Member Images */
.dark-mode .team-member img {
  border: 3px solid #ffc107;
}

.dark-mode .leggi-di-piu {
    color: #ffc107;
}

/* Pagina Contatti */
.dark-mode .formazione-olp {
  background: #2a2a2a;
  color: #f0f0f0;
}

.dark-mode .formazione-olp h2 {
  color: #ffc107;
}

.dark-mode .formazione-olp h3 {
  color: #f0f0f0;
}

.dark-mode .button-link {
  background: #ffc107;
  color: #222;
}

.dark-mode .button-link:hover {
  background: #e0a800;
}

/* Notizie */

/* Dark Mode per Notizie */
.dark-mode .news-card {
  background: #2a2a2a;
  color: #eee;
}

.dark-mode .news-card h3 {
  color: #ffc107;
}

.dark-mode .news-card .date {
  color: #aaa;
}

.dark-mode .news-card button {
  background: #ffc107;
  color: #1c1c1c;
}

.dark-mode .news-card button:hover {
  background: #e6b800;
  color: #1c1c1c;
}

.dark-mode .modal-content {
  background-color: #333;
  color: #f0f0f0;
}

.dark-mode .modal-content h3 {
  color: #ffc107;
}

.dark-mode .close {
  color: #ffc107;
}

.dark-mode .notizie-header {
  background: #222;
  color: #ffc107;
}

.dark-mode .notizie-header p {
  color: #ccc;
}

.dark-mode .newsletter {
  background: #2a2a2a;
  color: #eee;
}

.dark-mode .newsletter h2 {
  color: #ffc107;
}

.dark-mode .newsletter p {
  color: #fff;
}

.dark-mode .newsletter label {
  color: #ffc107;
}

.dark-mode .newsletter input {
  background: #444;
  color: #fff;
  border: 1px solid #666;
}

.dark-mode .newsletter button {
  background: #ffc107;
  color: #1c1c1c;
}

.dark-mode .newsletter button:hover {
  background: #e0a800;
}

/* Contatti */

.dark-mode .form-collaborazione {
  background: #2a2a2a;
  color: #eee;
}

.dark-mode .form-collaborazione h2 {
  color: #ffc107;
}

.dark-mode .form-collaborazione p {
  color: #ddd;
}




/* - - - - - - - - - - - - - - - - - - - - */

@media (min-width: 768px) {
  .navbar {
    width: auto;
    max-height: none; /* open by default on desktop */
    
  }
  .nav-links {
    flex-direction: row; 
    
    max-height: none;
  }
  .nav-links li {
    border: none;
  } 

  .nav-links a {
    padding: 10px 15px;
  }

@media (max-width: 768px) {
  .dark-mode-toggle {
    justify-content: center;
    margin: 10px auto;
    flex-wrap: wrap;
  }
  .dark-mode-toggle .label-dark {
    font-size: 16px;
  }
  .nav-links li a {
    padding: 8px 10px;
    font-size: 14px;
  }
}


@media (max-width: 600px) {
  .team-container {
    flex-direction: row;
    align-items: center;
  }
  .team-member {
    max-width: 90%;
    margin-bottom: 20px;
  }
}

@media (max-width: 400px) {
  .navbar {
    width: 100%;
}
  header h1 {
    font-size: 16px;}
  .nav-links {
    font-size: 12px;
  }
  .logo {
    width: 20%;
  }
}