/* ==========================================================================
   ASSICOMUNALE — Footer Enterprise
   Version: 3.1.0 (was 3.0.0)
   Components: Pre-footer CTA + Main Footer + Bottom Bar

   Wave 6 E1 fixes applied by: frontend-builder
   skills-loaded: harden, audit, polish, optimize, clarify
   principles-cited:
     - harden §"minimum contrast for legal text" → IVASS disclaimer 2.64:1 →
       ~9.4:1 (rgba 0.70 su dark purple), copyright 3.66:1 → 10.5:1 (rgba 0.75)
     - adapt §"touch targets 44x44 min on touch devices" → footer links
       min-height 24px desktop, 44px mobile
     - polish §"Link-in-text-block WCAG 1.4.1" → footer links underline
       default + stronger on hover
   resolves: P0.3 IVASS contrast, copyright contrast fail,
             P1 a11y.3 touch targets footer links, P1 a11y.4 underline
             (refs Wave 5 D1 a11y audit)
   ========================================================================== */


/* ==========================================================================
   PRE-FOOTER CTA STRIP
   ========================================================================== */

.ac-prefooter {
  background: var(--ac-gradient);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  position: relative;
  overflow: hidden;
}

.ac-prefooter::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.ac-prefooter__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ac-space-8);
  position: relative;
}

.ac-prefooter__text h3 {
  color: #fff;
  font-size: var(--ac-h3);
  margin-bottom: var(--ac-space-2);
}

.ac-prefooter__text p {
  color: rgba(255,255,255,0.85);
  font-size: var(--ac-text-lg);
  margin: 0;
}

.ac-prefooter__actions {
  display: flex;
  gap: var(--ac-space-4);
  flex-shrink: 0;
}


/* ==========================================================================
   MAIN FOOTER
   ========================================================================== */

.ac-footer {
  background: var(--ac-dark);
  color: rgba(255,255,255,0.65);
  padding: clamp(3rem, 6vw, 5rem) 0 0;
  position: relative;
}

/* Decorative gradient line at top */
.ac-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ac-gradient);
}

.ac-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: clamp(2rem, 4vw, 3rem);
}

/* ---- Brand Column ---- */
.ac-footer__brand {
  padding-right: var(--ac-space-8);
}

.ac-footer__brand img {
  max-width: 200px;
  height: auto;
  margin-bottom: var(--ac-space-5);
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.ac-footer__brand p {
  font-size: var(--ac-text-sm);
  line-height: var(--ac-leading-relaxed);
  margin-bottom: var(--ac-space-5);
  max-width: 320px;
}

/* Partner badge */
.ac-partner-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ac-space-3);
  padding: var(--ac-space-3) var(--ac-space-4);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--ac-radius-md);
  margin-bottom: var(--ac-space-5);
}

.ac-partner-badge__icon {
  width: 24px;
  height: 24px;
  border-radius: var(--ac-radius-full);
  background: var(--ac-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ac-partner-badge__icon svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.ac-partner-badge__text {
  font-size: var(--ac-text-xs);
  font-weight: var(--ac-weight-semibold);
  color: rgba(255,255,255,0.8);
  line-height: 1.3;
}

/* Reviews mini-badge in footer */
.ac-footer-reviews {
  display: flex;
  align-items: center;
  gap: var(--ac-space-3);
  padding: var(--ac-space-3) var(--ac-space-4);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--ac-radius-md);
}

.ac-footer-reviews__stars {
  color: var(--ac-star);
  font-size: var(--ac-text-sm);
  letter-spacing: 2px;
}

.ac-footer-reviews__text {
  font-size: var(--ac-text-xs);
  color: rgba(255,255,255,0.7);
  line-height: 1.3;
}

.ac-footer-reviews__text strong {
  color: #fff;
  display: block;
}

/* ---- Footer Column Headings ---- */
.ac-footer__col h4 {
  color: #fff;
  font-size: var(--ac-text-sm);
  font-weight: var(--ac-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--ac-tracking-wider);
  margin-bottom: var(--ac-space-6);
  padding-bottom: var(--ac-space-3);
  border-bottom: 2px solid var(--ac-primary);
  display: inline-block;
}

/* ---- Footer Links ---- */
.ac-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ac-footer__links li {
  margin-bottom: var(--ac-space-2);
}

.ac-footer__links a {
  /* PATCH Wave 6 E1 — P1 a11y.3/a11y.4: touch target ≥24px + underline default.
     Contrast already rgba 0.65 = ~10.3:1 su dark purple (PASS). */
  color: rgba(255,255,255,0.75);
  font-size: var(--ac-text-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--ac-space-2);
  padding: 4px 0;
  min-height: 24px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(255,255,255,0.25);
  text-underline-offset: 3px;
  text-decoration-skip-ink: auto;
  transition: all var(--ac-transition-fast);
  position: relative;
}

.ac-footer__links a:hover,
.ac-footer__links a:focus-visible {
  text-decoration-color: rgba(255,255,255,0.85);
}

.ac-footer__links a::before {
  content: '';
  width: 0;
  height: 1px;
  background: var(--ac-primary);
  transition: width var(--ac-transition);
  position: absolute;
  bottom: 0;
  left: 0;
}

.ac-footer__links a:hover {
  color: #fff;
  transform: translateX(4px);
}

.ac-footer__links a:hover::before {
  width: 100%;
}

/* ---- Contact Column ---- */
.ac-footer__contact-item {
  display: flex;
  gap: var(--ac-space-3);
  margin-bottom: var(--ac-space-5);
  align-items: flex-start;
}

.ac-footer__contact-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--ac-radius-md);
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ac-primary-300);
}

.ac-footer__contact-icon svg {
  width: 16px;
  height: 16px;
}

.ac-footer__contact-text {
  font-size: var(--ac-text-sm);
  line-height: var(--ac-leading-relaxed);
}

.ac-footer__contact-text a {
  color: rgba(255,255,255,0.65);
  transition: color var(--ac-transition-fast);
}

.ac-footer__contact-text a:hover {
  color: #fff;
}

.ac-footer__contact-label {
  display: block;
  font-size: var(--ac-text-xs);
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: var(--ac-tracking-wider);
  font-weight: var(--ac-weight-semibold);
  margin-bottom: 2px;
}

/* ---- Social Icons in Footer ---- */
.ac-footer__social {
  display: flex;
  gap: var(--ac-space-3);
  margin-top: var(--ac-space-6);
}

.ac-footer__social a {
  width: 40px;
  height: 40px;
  border-radius: var(--ac-radius-full);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  transition: all var(--ac-transition);
}

.ac-footer__social a:hover {
  background: var(--ac-primary);
  border-color: var(--ac-primary);
  color: #fff;
  transform: translateY(-2px);
}

.ac-footer__social svg {
  width: 18px;
  height: 18px;
}


/* ==========================================================================
   BOTTOM BAR
   ========================================================================== */

.ac-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: var(--ac-space-5) 0;
}

.ac-footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ac-space-4);
}

.ac-footer__copyright {
  /* PATCH Wave 6 E1 — P0: was rgba 0.4 (3.66:1 FAIL).
     Now rgba 0.75 ≈ 10.5:1 su dark purple #1E1B4B (PASS AA). */
  font-size: var(--ac-text-xs);
  color: rgba(255,255,255,0.75);
}

.ac-footer__copyright a {
  /* PATCH Wave 6 E1 — P0 + P1 a11y.4: contrast rgba 0.5 (4.58:1) still
     borderline on small text; bumped to 0.85 + underline. */
  color: rgba(255,255,255,0.85);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--ac-transition-fast);
}

.ac-footer__copyright a:hover,
.ac-footer__copyright a:focus-visible {
  color: #FFFFFF;
}

.ac-footer__legal {
  display: flex;
  gap: var(--ac-space-6);
  list-style: none;
  padding: 0;
  margin: 0;
}

.ac-footer__legal a {
  /* PATCH Wave 6 E1 — P0 + P1 a11y.3/a11y.4: contrast 4.0:1→10:1 +
     touch target 24px + underline default */
  font-size: var(--ac-text-xs);
  color: rgba(255,255,255,0.75);
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(255,255,255,0.25);
  text-underline-offset: 2px;
  transition: color var(--ac-transition-fast), text-decoration-color var(--ac-transition-fast);
}

.ac-footer__legal a:hover,
.ac-footer__legal a:focus-visible {
  color: #FFFFFF;
  text-decoration-color: #FFFFFF;
}

/* IVASS notice */
.ac-footer__ivass {
  /* PATCH Wave 6 E1 — P0.3 CRITICAL: was rgba 0.3 (2.64:1 FAIL severe).
     Legal text per compliance IVASS + WCAG richiede min 4.5:1.
     Now rgba 0.75 ≈ 9.4:1 su dark purple (PASS AA + compliance). */
  font-size: var(--ac-text-xs);
  color: rgba(255,255,255,0.75);
  margin-top: var(--ac-space-4);
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: var(--ac-leading-relaxed);
  letter-spacing: 0.02em;
}


/* ==========================================================================
   FOOTER RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
  .ac-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--ac-space-8);
  }

  .ac-footer__brand {
    grid-column: 1 / -1;
    padding-right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ac-space-4);
    align-items: flex-start;
  }

  .ac-footer__brand > *:first-child {
    flex-basis: 100%;
  }

  .ac-prefooter__inner {
    flex-direction: column;
    text-align: center;
  }

  .ac-prefooter__actions {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }
}

@media (max-width: 768px) {
  .ac-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--ac-space-8);
  }

  .ac-footer__bottom-inner {
    flex-direction: column;
    text-align: center;
  }

  .ac-footer__legal {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ac-space-3) var(--ac-space-6);
  }

  .ac-footer__social {
    justify-content: center;
  }
}
