/* Loaded only on membership.php. Checkout forms and payment handlers are unchanged. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.membership-wrap,
.membership-shell,
.nac-membership-shell,
.page-shell,
main {
  min-width: 0;
}

.membership-wrap img,
.membership-shell img,
.nac-membership-shell img,
main img {
  max-width: 100%;
  height: auto;
}

.membership-wrap button,
.membership-wrap a,
.membership-shell button,
.membership-shell a,
.nac-membership-shell button,
.nac-membership-shell a {
  overflow-wrap: anywhere;
}

/* The SA Visas shell emits tour markup without a reliable closed-state rule. */
.portal-tour-fab {
  position: fixed !important;
  top: auto !important;
  right: 20px !important;
  bottom: 22px !important;
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #0f376b, #081d3a);
  color: #fff;
  font: 700 13px/1.1 'Poppins', sans-serif;
  box-shadow: 0 14px 34px rgba(8, 29, 58, .24);
  cursor: pointer;
}

.portal-tour-backdrop,
.portal-tour-popover {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.portal-tour-open .portal-tour-backdrop.show {
  position: fixed;
  z-index: 1065;
  inset: 0;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: rgba(5, 18, 38, .48);
  backdrop-filter: blur(2px);
}

body.portal-tour-open .portal-tour-popover.show {
  position: fixed;
  z-index: 1070;
  right: 20px;
  bottom: 82px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: min(420px, calc(100vw - 40px));
  max-height: min(70dvh, 560px);
  overflow: auto;
  border: 1px solid rgba(15, 55, 107, .14);
  border-radius: 22px;
  padding: 20px;
  background: #fff;
  color: #18324a;
  box-shadow: 0 28px 70px rgba(8, 29, 58, .28);
}

.portal-tour-step {
  color: #0f8a5f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.portal-tour-title {
  margin-top: 5px;
  color: #0f376b;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.portal-tour-body {
  margin-top: 8px;
  color: #5c6f82;
  font-size: 13px;
  line-height: 1.55;
}

.portal-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e9f1;
}

.portal-tour-progress {
  color: #6b7b8d;
  font-size: 12px;
  font-weight: 700;
}

.portal-tour-actions > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.portal-tour-actions button {
  min-height: 40px;
  border-radius: 999px;
  padding-inline: 13px;
  font-size: 12px;
}

[data-tour-active="true"] {
  position: relative;
  z-index: 1068;
  outline: 4px solid rgba(217, 35, 50, .72);
  outline-offset: 5px;
}

body.portal-tour-open {
  overflow: hidden;
}

/* Holiday membership tours also remain closed until their launcher is used. */
#globalTourModal.hidden,
.nac-tour-card[aria-hidden="true"],
.nac-tour-overlay[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 991.98px) {
  .page-shell {
    padding-left: 0 !important;
  }

  .membership-wrap,
  .membership-shell,
  .nac-membership-shell,
  main.membership-wrap {
    padding: 78px max(14px, env(safe-area-inset-right)) 32px max(14px, env(safe-area-inset-left)) !important;
  }

  .membership-wrap .container-fluid,
  .membership-shell .container-fluid,
  .nac-membership-shell .container-fluid {
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
  }

  .membership-wrap .hero-card,
  .membership-shell .hero-card,
  .nac-membership-shell .hero-card {
    min-width: 0;
    border-radius: 22px !important;
    padding: 24px !important;
    box-shadow: 0 16px 36px rgba(8, 29, 58, .17) !important;
  }

  .membership-wrap .hero-card h1 {
    max-width: 18ch;
    margin-bottom: 14px !important;
    font-size: clamp(1.8rem, 8vw, 2.45rem);
    line-height: 1.08;
    letter-spacing: -.035em;
  }

  .membership-wrap .hero-card p {
    color: rgba(255, 255, 255, .82) !important;
    font-size: .94rem;
    line-height: 1.62;
  }

  .membership-wrap .hero-card .rounded-4 {
    padding: 18px !important;
  }

  .membership-wrap .soft-card,
  .membership-wrap .plan-card {
    border-radius: 20px;
  }

  .membership-wrap .soft-card {
    padding: 20px !important;
  }

  .membership-wrap .plan-card {
    padding: 22px !important;
  }

  .membership-wrap .price {
    font-size: 2rem;
  }

  .membership-wrap .feature-list {
    min-height: 0;
  }

  .membership-wrap button,
  .membership-wrap .btn,
  .membership-shell button,
  .membership-shell .btn {
    min-height: 46px;
  }
}

@media (max-width: 767.98px) {
  .portal-tour-fab {
    top: auto !important;
    right: 12px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 78px) !important;
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0 !important;
    border-radius: 15px;
  }

  .portal-tour-fab span {
    display: none !important;
  }

  body.portal-tour-open .portal-tour-popover.show {
    right: 10px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
    left: 10px !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(62dvh, 480px) !important;
    border-radius: 20px !important;
    padding: 18px !important;
    transform: none !important;
  }

  #globalTourModal:not(.hidden) .modal-panel,
  .nac-tour-inner {
    width: min(100%, calc(100vw - 20px)) !important;
    max-height: min(72dvh, 520px) !important;
    overflow: auto !important;
    border-radius: 20px !important;
  }

  .portal-tour-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-tour-actions > div:last-child {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-tour-actions button {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
  }
}

@media (max-width: 420px) {
  .membership-wrap .hero-card {
    padding: 21px !important;
  }

  .membership-wrap .hero-card h1 {
    font-size: 1.82rem;
  }

  .membership-wrap .row.g-2 > .col-4 > div {
    padding: 11px 5px !important;
  }
}
