/* Reset di base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: url('img/background.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Contenitore centrale con overlay trasparente */
.container {
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 40px;
  border-radius: 15px;
  width: 80%;
  max-width: 900px;
  margin: 40px auto;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
  animation: fadeIn 1.5s ease-in-out;
}

/* Logo ridimensionato con glow */
.logo {
  width: 120px;
  max-width: 20%;
  height: auto;
  margin: 0 auto 15px auto;
  display: block;
  filter: drop-shadow(0 0 10px #00f0ff);
  animation: glow 3s infinite alternate, fadeIn 2s ease-in-out;
}

/* Testo di benvenuto */
.welcome {
  font-size: 1.4em;
  margin-bottom: 15px;
  color: #00f0ff;
  text-shadow: 0 0 10px #00f0ff;
  animation: fadeIn 2s ease-in-out;
}

/* Titolo principale */
h1 {
  font-size: 2em;
  text-shadow: 0 0 15px #00f0ff;
  margin-bottom: 30px;
  animation: fadeIn 2.5s ease-in-out;
}

/* Griglia pulsanti */
.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Stile pulsanti */
.btn {
  background-color: rgba(0, 255, 255, 0.15);
  border: 2px solid #00f0ff;
  padding: 15px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  transition: 0.3s;
  display: block;
  animation: fadeIn 3s ease-in-out;
}

.btn:hover {
  background-color: rgba(0, 255, 255, 0.35);
  box-shadow: 0 0 15px #00f0ff;
  transform: scale(1.05);
}

/* Pulsante protetto */
.protected::after {
  content: " (login richiesto)";
  font-size: 0.8em;
  color: #ccc;
}

/* Footer */
footer {
  text-align: center;
  padding: 15px;
  font-size: 0.9em;
  color: #ccc;
  text-shadow: 0 0 5px #000;
  background: rgba(0, 0, 0, 0.6);
  animation: fadeIn 3.5s ease-in-out;
}

/* Animazioni */
@keyframes glow {
  from { filter: drop-shadow(0 0 5px #00f0ff); }
  to   { filter: drop-shadow(0 0 20px #00f0ff); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 📱 Responsive per smartphone */
@media (max-width: 600px) {
  .container {
    width: 95%;
    padding: 20px;
  }

  .logo {
    width: 80px;
    max-width: 30%;
  }

  h1 {
    font-size: 1.5em;
  }

  .welcome {
    font-size: 1.1em;
  }

  .btn {
    font-size: 0.9em;
    padding: 12px;
  }
}

/* --- Stili specifici per newsletter --- */
.newsletter-box {
  margin: 120px auto 70px auto;
  text-align: left;
  max-width: 560px;
  padding: 24px 20px;
  border: 2px solid #0078D7;
  border-radius: 10px;
  box-shadow: 0 0 15px #0078D7;
}

.newsletter-box h2 {
  color: #0078D7;
  margin: 0;
}

.newsletter-box p.subtitle {
  font-size: 18px;
  margin: 4px 0 18px 38px;
}

.newsletter-box a[href*="privacy"] {
  color: yellow !important;
  font-weight: bold;
  text-decoration: none;
}

/* 📱 Fix responsive newsletter */
@media (max-width: 600px) {
  .newsletter-box {
    margin: 40px 16px;
    padding: 20px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .newsletter-box p.subtitle {
    margin-left: 0;
    font-size: 16px;
  }

  /* Override del widget Mailant */
  #ma_div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #ma_div input[type="text"],
  #ma_div input[type="email"],
  #ma_div input[type="button"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: block;
    margin: 8px 0;
  }

  #ma_div label {
    display: block;
    text-align: left;
    font-size: 14px;
  }
}

/* --- Stili specifici per router.html --- */
body.router-page {
  background: url("img/background.jpg") no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  position: relative;
  z-index: 0;
}

body.router-page::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}

.router-page .container {
  position: relative;
  z-index: 1;
}

.router-page img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

.router-page h1,
.router-page h3 {
  color: #1abc9c;
}

.router-page .icon {
  color: #1abc9c;
  margin-right: 8px;
}

.router-page footer {
  background-color: #2c3e50;
  color: white;
  padding: 20px 0;
  text-align: center;
  margin-top: 40px;
}
