html.exit-popup-open,
body.exit-popup-open {
  overflow: hidden;
  height: 100%;
}

body.exit-popup-open {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

.exit-popup {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(15, 15, 15, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.exit-popup.show {
  display: flex;
}

.exit-box {
  width: 100%;
  max-width: 420px;
  max-height: min(92dvh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 22px;
  padding: 28px 22px 20px;
  text-align: center;
  position: relative;
  margin: auto;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.exit-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, transparent, #c9a962, transparent);
  pointer-events: none;
}

.exit-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: 0;
  border-radius: 50%;
  color: rgba(0, 0, 0, 0.55);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

.exit-close:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #1a1a1a;
}

.exit-wa-badge {
  width: 56px;
  height: 56px;
  margin: 2px auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2ee66f 0%, #25d366 45%, #1da851 100%);
  box-shadow:
    0 8px 28px rgba(37, 211, 102, 0.35),
    0 0 0 4px rgba(37, 211, 102, 0.1);
}

.exit-wa-badge .fab {
  font-size: 30px;
  color: #fff;
  line-height: 1;
}

.exit-box h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111;
}

.exit-lead {
  margin: 0 0 18px;
  color: rgba(0, 0, 0, 0.62);
  font-size: 14px;
  line-height: 1.45;
}

.exit-choice {
  text-align: left;
  padding: 14px 14px 12px;
  border-radius: 14px;
  margin-bottom: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafafa;
}

.exit-choice--direct {
  border-color: rgba(37, 211, 102, 0.35);
  background: rgba(37, 211, 102, 0.06);
}

.exit-choice--callback {
  border-color: rgba(201, 169, 98, 0.35);
  background: rgba(201, 169, 98, 0.06);
}

.exit-choice-text {
  margin-bottom: 12px;
}

.exit-choice-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}

.exit-choice-text span {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.58);
}

.exit-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: rgba(0, 0, 0, 0.38);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.exit-divider::before,
.exit-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.exit-reply-form {
  margin: 0;
  padding: 0;
}

.exit-phone-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  text-align: left;
}

.exit-form-error {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  color: #9b1c1c;
  background: rgba(155, 28, 28, 0.08);
  border: 1px solid rgba(155, 28, 28, 0.2);
}

.exit-form-error[hidden] {
  display: none;
}

.exit-form-success {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  color: #0d5c2e;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
}

.exit-form-success[hidden] {
  display: none;
}

.exit-phone {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px; /* evita zoom automatico iOS su focus */
  max-width: 100%;
  background: #fff;
  color: #1a1a1a;
  text-align: left;
}

.exit-phone::placeholder {
  color: rgba(0, 0, 0, 0.38);
}

.exit-phone:focus {
  outline: none;
  border-color: rgba(201, 169, 98, 0.65);
  box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.18);
}

.exit-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  border: 0;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.exit-cta:active {
  transform: scale(0.98);
}

.exit-cta--direct {
  gap: 8px;
  background: linear-gradient(145deg, #2ee66f 0%, #25d366 50%, #1da851 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.exit-cta--direct .fab {
  font-size: 1.25em;
  line-height: 1;
}

.exit-cta--direct:hover {
  box-shadow: 0 8px 26px rgba(37, 211, 102, 0.45);
  color: #fff;
}

.exit-cta--contact {
  background: #1a1a1a;
  border: 1px solid #1a1a1a;
  color: #fff;
}

.exit-cta--contact:hover {
  background: #333;
  border-color: #333;
}

.exit-trust {
  margin: 16px 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.45);
  font-weight: 500;
}

.exit-dismiss {
  width: 100%;
  margin: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.45);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.exit-dismiss:hover {
  color: rgba(0, 0, 0, 0.72);
}

.exit-view[hidden] {
  display: none !important;
}

.exit-callback-trigger {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 98, 0.45);
  background: rgba(201, 169, 98, 0.1);
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.exit-callback-trigger:hover {
  background: rgba(201, 169, 98, 0.18);
  border-color: rgba(201, 169, 98, 0.65);
}

.exit-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.exit-back:hover {
  color: #1a1a1a;
}

.exit-view--callback {
  text-align: left;
}

.exit-view--callback h2 {
  text-align: center;
}

.exit-view--callback .exit-lead {
  text-align: center;
}

.exit-country-field {
  margin-bottom: 12px;
}

.exit-country-combo {
  position: relative;
}

.exit-country-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  background: #fff;
  color: #1a1a1a;
  text-align: left;
}

.exit-country-search:focus {
  outline: none;
  border-color: rgba(201, 169, 98, 0.65);
  box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.18);
}

.exit-country-list {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.exit-country-list[hidden] {
  display: none;
}

.exit-country-list li {
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
  color: #1a1a1a;
}

.exit-country-list li:hover,
.exit-country-list li[aria-selected="true"] {
  background: rgba(201, 169, 98, 0.14);
}

.exit-country-list li.exit-country-empty {
  cursor: default;
  color: rgba(0, 0, 0, 0.45);
  font-size: 14px;
}

.exit-phone-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.exit-dial-prefix {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #f5f5f5;
  font-size: 15px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.72);
  white-space: nowrap;
}

.exit-phone--local {
  flex: 1 1 auto;
  margin-bottom: 0;
  min-width: 0;
}
