/* Senza JavaScript o senza supporto al dialogo nativo non appare alcun popup. */
dialog.exit-popup:not([open]) { display: none; }

dialog.exit-popup {
  box-sizing: border-box;
  width: min(44rem, calc(100vw - 1.5rem));
  max-width: none;
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #a9c1b5;
  border-radius: 1.1rem;
  background: #fff;
  color: #303b39;
  font-family: var(--font-body, 'Source Sans 3', sans-serif);
  font-size: 1.125rem;
  line-height: 1.45;
  box-shadow: 0 18px 50px rgba(25, 61, 58, .25);
  -webkit-overflow-scrolling: touch;
}

dialog.exit-popup *,
dialog.exit-popup *::before,
dialog.exit-popup *::after { box-sizing: border-box; }

dialog.exit-popup::backdrop { background: rgba(15, 36, 34, .65); }
.exit-popup [hidden] { display: none !important; }

.exit-popup__inner { padding: clamp(1rem, 3vw, 1.6rem); }
.exit-popup__header {
  position: static;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .2rem 0 .5rem;
  background: #fff;
}
.exit-popup__header > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.exit-popup__header h2 {
  margin: 0;
  color: #214d49;
  font-family: var(--font-heading, 'Nunito Sans', sans-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}
.exit-popup__header .orientamento-kicker { margin-bottom: .35rem; }
.exit-popup__close {
  display: inline-flex;
  width: 48px;
  min-width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #9bb5a7;
  border-radius: .55rem;
  background: #fff;
  color: #214d49;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.exit-popup__close:hover { background: #e6efea; }
.exit-popup__contacts p { margin: .75rem 0 0; }
.exit-popup__contacts .orientamento-contact-actions { margin: .65rem 0 1rem; }
.exit-popup .orientamento-card {
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid #c8d8cf;
  border-radius: 0;
  box-shadow: none;
}
.exit-popup .orientamento-privacy { margin-top: 1rem; }
.exit-popup .orientamento-button { min-width: 0; overflow-wrap: anywhere; }
.exit-popup :focus-visible,
.exit-popup__header h2:focus,
.exit-popup .orientamento-card h3:focus,
.exit-popup .orientamento-status:focus {
  outline: 3px solid #a9472f;
  outline-offset: 3px;
}

@media (max-width: 599px) {
  .exit-popup__inner { padding: 16px; }
  .exit-popup__header { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: .5rem; }
  .exit-popup__header > div { display: contents; }
  .exit-popup__header .orientamento-kicker { grid-column: 1; grid-row: 1; }
  .exit-popup__header h2 { grid-column: 1 / -1; grid-row: 2; font-size: 1.35rem; }
  .exit-popup__close { grid-column: 2; grid-row: 1; }
  .exit-popup .orientamento-option { gap: .5rem; padding: .5rem; }
}
@media (min-width: 600px) {
  .exit-popup__contacts .orientamento-contact-actions { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
}
