
footer#footer {
  --primary-color: #0d6efd;
  --secondary-color: #0a58ca;
  --accent-color: #e7f1ff;
  --text-color: #fff;
  --shadow-color: rgba(13, 110, 253, 0.18);
  --glass-bg: rgba(255, 255, 255, 0.13);
  --input-bg: rgba(248, 249, 250, 0.95);
  position: relative;
  z-index: 10;
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--primary-color) 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease-in-out infinite;
  backdrop-filter: blur(15px) saturate(200%);
  -webkit-backdrop-filter: blur(15px) saturate(200%);
  color: var(--text-color);
  box-shadow: 0 2em 3em var(--shadow-color);
  border-radius: 2em 2em 0 0;
  font-family: 'Inter', 'Roboto', Arial, sans-serif;
  overflow: hidden;
  transition: all 0.4s ease;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

footer#footer .container {
  padding: 2.5em 1.5em 1.5em 1.5em;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  gap: 2em;
  align-items: center;
}

footer#footer h5 {
  font-size: 1.5em;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 1.2em;
  text-shadow: 0 3px 10px var(--shadow-color);
  text-align: center;
}

footer#footer form {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2em;
  padding: 2em 1.5em;
  box-shadow: 0 0.8em 2em var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px) saturate(150%);
  transition: all 0.4s ease;
  width: 100%;
  max-width: 100vw;
  position: relative;
  animation: formSlideIn 1s ease-out;
}

@keyframes formSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

footer#footer .btn::before {
  /* decorative sliding shine */
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 0; /* behind the button content */
}

footer#footer .btn::after {
  /* decorative overlay (no text) - used only for subtle effects */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 0;
  display: block;
  pointer-events: none;
}
  width: 100%;
  outline: none;
  position: relative;
}

footer#footer input:focus,
footer#footer textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2), 0 0.3em 1em rgba(13, 110, 253, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, var(--accent-color) 0%, rgba(255, 255, 255, 1) 100%);
  transform: scale(1.02) translateY(-2px);
}

footer#footer .btn {
  border-radius: 2.5em;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-color) 0%, var(--accent-color) 50%, var(--text-color) 100%);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: 0 0.3em 0.8em rgba(13, 110, 253, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.4s ease;
  padding: 0.9em 2.5em;
  font-size: 1.1em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

footer#footer .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s ease;
  z-index: 1;
  pointer-events: none;
}

footer#footer .btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 0;
  display: block;
  pointer-events: none;
}

footer#footer .btn:hover {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--primary-color) 100%);
  /* Keep original button text visible; pseudo-elements render behind content */
  color: var(--text-color) !important;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 0.5em 1.5em var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

footer#footer .btn:hover::before {
  left: 100%;
}

footer#footer .btn:hover::after {
  opacity: 0;
}

footer#footer .d-flex {
  gap: 0.5em;
}

footer#footer .mb-3 {
  margin-bottom: 0.75em !important;
}

footer#footer .mb-4 {
  margin-bottom: 1.25em !important;
}

footer#footer .text-center {
  text-align: center !important;
}

footer#footer .social-icons {
  display: flex;
  justify-content: center;
  gap: 1.5em;
  margin: 1.5em 0;
  flex-wrap: wrap;
}

footer#footer .social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3em;
  height: 3em;
  border-radius: 50%;
  background: var(--glass-bg);
  color: var(--text-color);
  font-size: 1.8em;
  box-shadow: 0 0.3em 1em var(--shadow-color);
  transition: all 0.4s ease;
  position: relative;
  text-decoration: none;
}

footer#footer .social-icons a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 15px 3px rgba(13, 110, 253, 0.3);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

footer#footer .social-icons a:hover {
  background: var(--text-color);
  color: var(--primary-color);
  transform: scale(1.2) rotate(5deg);
  box-shadow: 0 0.5em 1.5em rgba(13, 110, 253, 0.4);
}

footer#footer .social-icons a:hover::after {
  opacity: 1;
}

/* Hover effect quando passi sopra il link (cerchio) */
footer#footer .social-icons a:hover .bi-facebook {
  color: #4267B2 !important;
  text-shadow: 0 0 10px #4267B2;
}

footer#footer .social-icons a:hover .bi-instagram {
  color: #E1306C !important;
  text-shadow: 0 0 10px #E1306C;
}

footer#footer .social-icons a:hover .bi-twitter-x {
  color: #1DA1F2 !important;
  text-shadow: 0 0 10px #1DA1F2;
}

/* GitHub icon hover: use GitHub dark color and subtle glow */
footer#footer .social-icons a:hover .bi-github {
  color: #111 !important;
  text-shadow: 0 0 10px rgba(17,17,17,0.6);
}

footer#footer .row {
  display: flex;
  flex-direction: column;
  gap: 2em;
  width: 100%;
  align-items: center;
}

footer#footer .col-lg-6 {
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}

@media (min-width: 768px) {
  footer#footer .row {
    flex-direction: row;
    gap: 3em;
    justify-content: space-between;
  }

  footer#footer .col-lg-6 {
    flex: 1 1 45%;
    max-width: 45%;
  }

  footer#footer .container {
    padding: 3em 2em 2em 2em;
  }

  footer#footer form {
    max-width: 850px;
    padding: 3em 2.5em;
    animation: formSlideInDesktop 1.2s ease-out;
  }

  @keyframes formSlideInDesktop {
    0% {
      opacity: 0;
      transform: translateY(50px) scale(0.9);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  footer#footer input,
  footer#footer textarea {
    font-size: 1.2em;
    padding: 1.2em 1.5em;
    margin-bottom: 1.5em;
  }

  footer#footer .btn {
    padding: 1.1em 3em;
    font-size: 1.2em;
  }
}

footer#footer .overflow-hidden {
  overflow: hidden;
}

footer#footer .bi {
  vertical-align: middle;
}

footer#footer hr {
  border: none;
  height: 4px;
  background: linear-gradient(90deg, var(--text-color) 0%, var(--primary-color) 50%, var(--text-color) 100%);
  margin: 2.5em 0 2em 0;
  opacity: 0.8;
  animation: gradientMove 4s linear infinite;
  border-radius: 2px;
}

@keyframes gradientMove {
  0% { background-position: 0 0; }
  100% { background-position: 300% 0; }
}

footer#footer p {
  font-size: 1.1em;
  margin-bottom: 0.7em;
  color: rgba(233, 236, 239, 0.9);
  text-shadow: 0 2px 6px var(--shadow-color);
  line-height: 1.5;
}

footer#footer .opacity-25 {
  opacity: 0.25;
}

.hide {
  display: none !important;
}

/* Stili specifici per la checkbox della privacy policy */
footer#footer .form-check-input {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  width: 20px !important;
  height: 20px !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 10 !important;
  opacity: 1 !important;
  visibility: visible !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;
}

footer#footer .form-check-input:checked {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
}

footer#footer .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
  border-color: #0d6efd !important;
  outline: none !important;
}

footer#footer .form-check-label {
  cursor: pointer !important;
  user-select: none;
}

/* High-specificity fallback: force footer text to white to avoid page-specific overrides */
footer#footer,
footer#footer h1,
footer#footer h2,
footer#footer h3,
footer#footer h4,
footer#footer h5,
footer#footer h6,
footer#footer p,
footer#footer span,
footer#footer a,
footer#footer .social-icons a {
  color: #ffffff !important;
}

/* Keep form inputs readable (dark text) inside footer */
footer#footer input,
footer#footer textarea,
footer#footer .form-control {
  color: #222 !important;
}
/* Inline override: force footer text white across pages (safe, keeps inputs dark) */
  #footer, #footer h1, #footer h2, #footer h3, #footer h4, #footer h5, #footer h6,
    #footer p, #footer span, #footer a, #footer .social-icons a, #footer .form-check-label,
    #footer .form-label, #footer .form-text, #footer .invalid-feedback {
      color: #ffffff !important;
    }
    /* Keep form inputs readable with dark text */
    #footer input, #footer textarea, #footer .form-control {
      color: #222 !important;
    }
    /* Links inside labels (privacy) keep accent but remain readable */
    #footer .form-check-label a {
      color: #fbbf24 !important;
    }
    /* Make invalid feedback clearly visible */
    #footer .invalid-feedback {
      color: #fcd34d !important;
    }