
/* ===== VARIABILI TEMA CHIARO/SCURO ===== */
:root {
  --bg-color: #f9fafa;
  --text-color: #1a1a1a;
  --primary-color: #007BFF;
  --accent-color: #28a745;
  --link-hover: #ffc107;
  --card-bg: #ffffff;
  --shadow: 0 2px 10px rgba(0,0,0,0.04);
}
body.dark-mode {
  --bg-color: #181a1f;
  --text-color: #eeeeee;
  --primary-color: #4dabf7;
  --accent-color: #00c982;
  --link-hover: #ffd54f;
  --card-bg: #252830;
  --shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* ===== BASE ===== */
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ===== HEADER & NAVBAR ===== */
header {
  background-color: var(--primary-color);
  text-align: center;
  padding: 20px;
  color: white;
}
header img {
  max-width: 180px;
}
nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 20px;
}
nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}
nav a:hover {
  color: var(--link-hover);
}

/* ===== MAIN CONTENT ===== */
main {
  max-width: 960px;
  margin: auto;
  padding: 30px 20px;
}
section {
  margin-bottom: 60px;
}
h1, h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
}
h3 {
  margin-top: 0;
}

/* ===== CARDS / ARTICOLI ===== */
article {
  background: var(--card-bg);
  border-left: 5px solid var(--primary-color);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
  transition: transform 0.2s;
}
article:hover {
  transform: translateY(-3px);
}
article p:last-child a {
  color: var(--primary-color);
  font-weight: bold;
}
article p:last-child a:hover {
  color: var(--link-hover);
}

/* ===== FORM ===== */
form label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
  color: var(--text-color);
}
form input, form textarea {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
form input[type="file"].allegato-btn {
  margin-top: 10px;
  padding: 10px;
  font-size: 1rem;
  background: #f9f9f9;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
}
.form-box {
  max-width: 600px;
  margin: auto;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}
.form-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.submit-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.3s ease;
}
.submit-btn:hover {
  background-color: #005fa3;
}

/* ===== DARK MODE FORM ===== */
body.dark-mode form input,
body.dark-mode form textarea,
body.dark-mode form input[type="file"] {
  border: 1px solid #444;
  background-color: #2f333a;
  color: #eee;
}

/* ===== ACCESSIBILITÀ ===== */
input:focus, textarea:focus, button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
input, textarea {
  font-size: 1rem;
  line-height: 1.5;
}
button, input[type="submit"] {
  touch-action: manipulation;
}

/* ===== IMMAGINI ===== */
img.responsive {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ===== FOOTER ===== */
footer {
  background-color: #333;
  color: #ccc;
  text-align: center;
  padding: 25px 20px;
  font-size: 0.9em;
}

/* ===== WHATSAPP ===== */
.whatsapp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}
.whatsapp img {
  width: 50px;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid #bbb;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  transition: all 0.3s;
}
.theme-toggle:hover {
  background-color: var(--primary-color);
  color: white;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  header img {
    width: 150px;
  }
  main {
    padding: 20px 10px;
  }
}