/* ===================================
   STAGE — Pagine legali + Banner consenso cookie
   =================================== */

/* ---------- Pagine legali (privacy, cookie-policy) ---------- */
body.body-stage .stage-legal-doc {
  padding-block: var(--stage-space-section-y);
}

body.body-stage .stage-legal-doc__inner {
  max-width: 52rem;
  margin-inline: auto;
}

body.body-stage .stage-legal-doc__head {
  margin-bottom: 40px;
}

body.body-stage .stage-legal-doc__title {
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

body.body-stage .stage-legal-doc__updated {
  margin-top: 12px;
  font-size: var(--stage-fs-caption);
  color: var(--color-secondary-450);
}

body.body-stage .stage-legal-doc__intro {
  margin-top: 16px;
  color: var(--color-secondary-550);
}

body.body-stage .stage-legal-doc__section {
  margin-top: 32px;
}

body.body-stage .stage-legal-doc__heading {
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

body.body-stage .stage-legal-doc__subheading {
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

body.body-stage .stage-legal-doc__list {
  margin: 12px 0 0;
  padding-left: 1.25rem;
  list-style: disc;
}

body.body-stage .stage-legal-doc__list li {
  margin-bottom: 8px;
}

body.body-stage .stage-legal-doc__section a {
  font-size: inherit;
  line-height: inherit;
  color: var(--color-primary-500);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

body.body-stage .stage-legal-doc__section a:hover {
  color: var(--color-primary-700);
}

/* ---------- Utility accessibilità ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Newsletter footer stage ---------- */
body.body-stage .section-footer-stage__newsletter {
  background-color: var(--color-stage-neutral, #f2f2f0);
  padding-block: clamp(3rem, 8vw, 6rem);
}

body.body-stage .section-footer-stage__newsletter-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

body.body-stage .section-footer-stage__newsletter-title {
  font-size: var(--stage-fs-h2);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #000;
  margin: 0;
  max-width: 18ch;
}

body.body-stage .section-footer-stage__newsletter-text {
  font-size: var(--stage-fs-p);
  line-height: 1.55;
  color: var(--color-secondary-550, #595959);
  margin: 1rem 0 0;
  max-width: 46ch;
}

body.body-stage .section-footer-stage__newsletter-form {
  width: 100%;
  max-width: 34rem;
  margin-top: 1.75rem;
}

body.body-stage .section-footer-stage__newsletter-hp {
  display: none;
}

body.body-stage .section-footer-stage__newsletter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.4rem 0.4rem 0.5rem;
  background: #fff;
  border: 1px solid var(--color-border-soft, #d8d8d8);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

body.body-stage .section-footer-stage__newsletter-field {
  flex: 1 1 auto;
  min-width: 0;
}

body.body-stage .section-footer-stage__newsletter-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: none;
  background: transparent;
  font-size: var(--stage-fs-p-small, 0.9375rem);
  color: #000;
}

body.body-stage .section-footer-stage__newsletter-input:focus {
  outline: none;
}

body.body-stage .section-footer-stage__newsletter-input::placeholder {
  color: var(--color-secondary-400, #818181);
}

body.body-stage .section-footer-stage__newsletter-button {
  flex: 0 0 auto;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: var(--color-secondary-950, #0a0a0a);
  color: #fff;
  font-size: var(--stage-fs-btn-secondary, 0.9375rem);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

body.body-stage .section-footer-stage__newsletter-button:hover {
  background: var(--color-primary-500);
}

body.body-stage .section-footer-stage__newsletter-button:disabled {
  opacity: 0.6;
  cursor: default;
}

body.body-stage .section-footer-stage__newsletter-msg {
  margin: 0.85rem 0 0;
  font-size: var(--stage-fs-caption, 0.75rem);
  line-height: 1.4;
}

body.body-stage .section-footer-stage__newsletter-msg.is-success {
  color: var(--color-primary-700, #0b4293);
}

body.body-stage .section-footer-stage__newsletter-msg.is-error {
  color: #b42318;
}

body.body-stage .section-footer-stage__newsletter-legal {
  margin: 1rem auto 0;
  max-width: 42ch;
  font-size: var(--stage-fs-legal);
  line-height: 1.45;
  color: var(--color-secondary-450, #6a6a6a);
}

body.body-stage .section-footer-stage__newsletter-legal a {
  font-size: inherit;
  line-height: inherit;
  color: var(--color-secondary-600, #505050);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

body.body-stage .section-footer-stage__newsletter-legal a:hover {
  color: var(--color-primary-500);
}

@media (max-width: 36rem) {
  body.body-stage .section-footer-stage__newsletter-row {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.6rem;
    border-radius: 16px;
  }

  body.body-stage .section-footer-stage__newsletter-field {
    width: 100%;
  }

  body.body-stage .section-footer-stage__newsletter-button {
    width: 100%;
  }
}

/* ---------- Banner consenso cookie ---------- */
.mfr-consent[hidden] {
  display: none;
}

.mfr-consent__banner {
  position: fixed;
  z-index: 2147483000;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(880px, calc(100% - 28px));
  background: var(--color-third-100, #fff);
  border: 1px solid var(--color-border-soft, #d8d8d8);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}

.mfr-consent__banner[hidden] {
  display: none;
}

.mfr-consent__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: var(--color-secondary-450, #6a6a6a);
  cursor: pointer;
  border-radius: 6px;
}

.mfr-consent__close:hover {
  background: var(--color-secondary-150, #f9f9f9);
  color: #000;
}

.mfr-consent__banner-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 15px;
}

body.body-stage .mfr-consent__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #000;
  margin: 0 0 4px;
}

body.body-stage .mfr-consent__desc {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--color-secondary-550, #595959);
  margin: 0;
}

body.body-stage .mfr-consent__desc a {
  font-size: inherit;
  line-height: inherit;
  color: var(--color-primary-500);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.mfr-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mfr-consent__btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.mfr-consent__btn--primary {
  background: var(--color-primary-500);
  color: #fff;
  border-color: var(--color-primary-500);
}

.mfr-consent__btn--primary:hover {
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

.mfr-consent__btn--ghost {
  background: transparent;
  color: #000;
  border-color: var(--color-border-soft, #d8d8d8);
}

.mfr-consent__btn--ghost:hover {
  border-color: var(--color-primary-500);
  color: var(--color-primary-500);
}

/*
 * Pulsanti "Accetta" e "Rifiuta" con pari evidenza grafica (Linee guida Garante 2021):
 * stessa dimensione, stesso peso, stesso trattamento visivo — nessun dark pattern.
 */
.mfr-consent__btn--equal {
  background: #fff;
  color: #000;
  border-color: var(--color-secondary-950, #0a0a0a);
}

.mfr-consent__btn--equal:hover {
  background: var(--color-secondary-950, #0a0a0a);
  color: #fff;
  border-color: var(--color-secondary-950, #0a0a0a);
}

/* "Personalizza": azione secondaria, meno prominente ma chiaramente accessibile. */
.mfr-consent__btn--link {
  background: transparent;
  border-color: transparent;
  color: var(--color-secondary-550, #595959);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  min-width: 0;
}

.mfr-consent__btn--link:hover {
  color: #000;
}

/* Pannello preferenze */
.mfr-consent__prefs {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mfr-consent__prefs[hidden] {
  display: none;
}

.mfr-consent__prefs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.mfr-consent__prefs-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-third-100, #fff);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.mfr-consent__prefs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-third-300, #e7e7e7);
}

body.body-stage .mfr-consent__prefs-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #000;
  margin: 0;
}

.mfr-consent__prefs-close {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--color-secondary-450, #6a6a6a);
  cursor: pointer;
  border-radius: 6px;
}

.mfr-consent__prefs-close:hover {
  background: var(--color-secondary-150, #f9f9f9);
  color: #000;
}

.mfr-consent__prefs-body {
  padding: 4px 18px;
}

.mfr-consent__group {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-third-300, #e7e7e7);
}

.mfr-consent__group:last-child {
  border-bottom: none;
}

.mfr-consent__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.body-stage .mfr-consent__group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #000;
}

.mfr-consent__group-state {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-primary-500);
}

body.body-stage .mfr-consent__group-desc {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--color-secondary-550, #595959);
}

/* Switch */
.mfr-consent__switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}

.mfr-consent__switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mfr-consent__switch-track {
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: var(--color-third-500, #cacaca);
  transition: background-color 0.18s ease;
  position: relative;
}

.mfr-consent__switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.mfr-consent__switch input:checked + .mfr-consent__switch-track {
  background: var(--color-primary-500);
}

.mfr-consent__switch input:checked + .mfr-consent__switch-track::after {
  transform: translateX(17px);
}

.mfr-consent__switch input:focus-visible + .mfr-consent__switch-track {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.mfr-consent__prefs-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--color-third-300, #e7e7e7);
}

@media (min-width: 48rem) {
  .mfr-consent__banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
  }

  .mfr-consent__actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  .mfr-consent__btn {
    flex: 0 0 auto;
    min-width: 0;
  }
}
