/* Leaving-site interstitial modal — scoped under .x-leaving-modal
   Shell conventions shared with the other page modals (fixed flex layer,
   soft backdrop, white card panel). Panel max-width 520px per spec. */

.x-leaving-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483641;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16);
  visibility: hidden;
  font-family: var(--font-body);
  transition: visibility 0s linear 0.3s;
}

.x-leaving-modal[hidden] {
  display: none;
}

.x-leaving-modal.is-open {
  visibility: visible;
  transition-delay: 0s;
}

.x-leaving-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-backdrop-soft);
  opacity: 0;
  transition: opacity 0.2s;
}

.x-leaving-modal.is-open .x-leaving-modal__backdrop {
  opacity: 1;
}

.x-leaving-modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: var(--sp-16) var(--sp-24);
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  opacity: 0.9;
  transform: translateY(4px);
  transition: all 0.3s ease 0s;
}

.x-leaving-modal.is-open .x-leaving-modal__panel {
  opacity: 1;
  transform: translateY(0);
}

.x-leaving-modal__close {
  position: absolute;
  top: var(--sp-16);
  right: var(--sp-16);
  width: 24px;
  height: 24px;
  cursor: pointer;
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2224%22%20height=%2224%22%20viewBox=%220,0,24,24%22%3E%3Cpath%20fill=%22%23646464%22%20d=%22M18.5882353,4 L12,10.5841151 L5.41176471,4 L4,5.4108818 L10.5882353,11.9949969 L4,18.5791119 L5.41176471,20 L12,13.4158849 L18.5882353,20 L20,18.5791119 L13.4217772,11.9949969 L20,5.4108818 C20,5.4108818 19.5294118,4.94058787 18.5882353,4 Z%22%20/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

.x-leaving-modal__close:hover {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2224%22%20height=%2224%22%20viewBox=%220,0,24,24%22%3E%3Cpath%20fill=%22%230053c2%22%20d=%22M18.5882353,4 L12,10.5841151 L5.41176471,4 L4,5.4108818 L10.5882353,11.9949969 L4,18.5791119 L5.41176471,20 L12,13.4158849 L18.5882353,20 L20,18.5791119 L13.4217772,11.9949969 L20,5.4108818 C20,5.4108818 19.5294118,4.94058787 18.5882353,4 Z%22%20/%3E%3C/svg%3E");
}

.x-leaving-modal__art {
  height: 64px;
  margin: -16px -24px 16px;
  background-image: url('../../assets/images/interstitial-flagscape.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.x-leaving-modal__title {
  font-family: var(--font-brand-bold);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
  color: var(--color-black);
  margin: 0 0 var(--sp-12);
}

.x-leaving-modal__body {
  font-family: var(--font-body);
  font-size: var(--fs-14);
  line-height: var(--lh-legal);
  color: var(--color-text-secondary);
}

.x-leaving-modal__dest {
  font-family: var(--font-body);
  font-size: var(--fs-12);
  line-height: var(--lh-tight);
  color: var(--color-grey);
  margin: var(--sp-12) 0 0;
}

.x-leaving-modal .spa-btn-group {
  display: flex;
  gap: var(--sp-12);
  margin-top: var(--sp-24);
  justify-content: flex-end;
}

.x-leaving-modal__btn {
  height: 32px;
  padding: var(--sp-8) var(--sp-16);
  font-size: var(--fs-14);
  line-height: var(--lh-tight);
  border-radius: var(--radius-btn-mobile);
  border: 1px solid var(--color-navy);
  cursor: pointer;
}

.x-leaving-modal__btn--primary {
  background: var(--color-navy);
  color: var(--color-white);
}

.x-leaving-modal__btn--primary:hover {
  background: var(--color-link);
  border-color: var(--color-link);
}

.x-leaving-modal__btn--secondary {
  background: var(--color-white);
  color: var(--color-navy);
}

@media (max-width: 767px) {
  .x-leaving-modal__art {
    height: 48px;
  }

  .x-leaving-modal .spa-btn-group {
    flex-direction: column;
  }

  .x-leaving-modal__btn {
    width: 100%;
  }
}
