/*-----------------------------------------------------------------------------------
   Externo lead popup

   A neat, self-contained multi-step enquiry popup. No Bootstrap, no jQuery. It
   reuses the site's brand tokens from style.css and mirrors the native booking
   modal (open/close, scroll lock, focus handling). The phone field uses
   intl-tel-input (already a site dependency) for flags + per-country validation.

   The dialog keeps ONE fixed size across every step, so it never resizes as the
   user moves through the flow. Markup is injected by assets/js/popup.js.
-----------------------------------------------------------------------------------*/

/* Body gets this class while the popup is open - locks background scroll. */
.ext-popup-lock {
  overflow: hidden;
}

/* Overlay -------------------------------------------------------------------- */
.ext-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}
.ext-popup.is-open {
  opacity: 1;
  visibility: visible;
}

.ext-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 15, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* Dialog - FIXED height so it never changes size between steps ---------------- */
.ext-popup__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(500px, 100%);
  height: min(560px, 92vh);
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(12, 13, 15, 0.55);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.ext-popup.is-open .ext-popup__dialog {
  transform: translateY(0) scale(1);
}

/* Corner close - the quarter-disc "notch" close from the reference, on brand.
   The button is a generous 60px hit area; the visible notch is a smaller 44px
   icon anchored into the corner, so the tap target is bigger than the glyph. */
.ext-popup__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ext-popup__close svg {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: block;
}
.ext-popup__close-disc {
  fill: #ffe6ad;
  transition: fill 0.25s ease;
}
.ext-popup__close-x {
  fill: #111315;
  transform-origin: 27.5px 19.5px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.ext-popup__close:hover .ext-popup__close-disc {
  fill: var(--ext-accent);
}
.ext-popup__close:hover .ext-popup__close-x {
  transform: rotate(90deg);
}
.ext-popup__close:focus-visible {
  outline: none;
}
.ext-popup__close:focus-visible .ext-popup__close-disc {
  fill: var(--ext-accent);
}
.ext-popup__close:focus-visible .ext-popup__close-x {
  transform: rotate(90deg);
}

/* Header - full logo only (no wordmark text, no progress stepper) ------------- */
.ext-popup__head {
  flex-shrink: 0;
  padding: 28px 32px 0;
}
.ext-popup__logo {
  height: 26px;
  width: auto;
  display: block;
}
.ext-popup__logo svg {
  height: 100%;
  width: auto;
  display: block;
}

/* Screen-reader-only live region (step announcements). */
.ext-popup__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Body (steps) - one fixed frame; each step is vertically centred within it --- */
.ext-popup__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 32px 30px;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.ext-popup__step {
  display: none;
}
.ext-popup__step.is-active {
  display: flex;
  flex-direction: column;
  /* The step fills the fixed frame: content stays pinned to the TOP (so the
     eyebrow/title never drift between steps) while the actions row is pushed to
     the BOTTOM like a footer. */
  flex: 1 0 auto;
  margin: 0;
}
/* The thank-you confirmation is centred within the fixed frame. */
.ext-popup__step[data-step="3"].is-active {
  justify-content: center;
}

/* Directional slide between steps (replaces the top stepper bar). */
.ext-popup[data-dir="next"] .ext-popup__step.is-active {
  animation: ext-popup-in-next 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ext-popup[data-dir="back"] .ext-popup__step.is-active {
  animation: ext-popup-in-back 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes ext-popup-in-next {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes ext-popup-in-back {
  from { opacity: 0; transform: translateX(-26px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Eyebrow row: contextual label + a minimal step counter (the "other effect"). */
.ext-popup__eyebrow-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.ext-popup__eyebrow {
  margin: 0;
  font-family: var(--ext-font-secondary);
  font-size: 13px;
  font-weight: 700;
  color: var(--ext-accent);
  letter-spacing: 0.01em;
}
.ext-popup__count {
  flex-shrink: 0;
  font-family: var(--ext-font-primary);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--ext-ink);
}
.ext-popup__count i {
  margin: 0 3px;
  font-style: normal;
  color: rgba(17, 19, 21, 0.32);
}
.ext-popup__title {
  margin: 0;
  font-family: var(--ext-font-primary);
  font-size: clamp(21px, 4.4vw, 25px);
  font-weight: 700;
  line-height: 1.18;
  color: var(--ext-ink);
}
.ext-popup__lede {
  margin: 8px 0 0;
  font-family: var(--ext-font-secondary);
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(17, 19, 21, 0.58);
}

/* Radio option cards --------------------------------------------------------- */
.ext-popup__options {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.ext-popup__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 1.5px solid var(--ext-line);
  border-radius: 13px;
  cursor: pointer;
  font-family: var(--ext-font-secondary);
  font-size: 15px;
  font-weight: 600;
  color: var(--ext-ink);
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}
.ext-popup__option:hover {
  border-color: rgba(17, 19, 21, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -10px rgba(17, 19, 21, 0.4);
}
.ext-popup__option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ext-popup__option::before {
  content: "";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(17, 19, 21, 0.25);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}
.ext-popup__option:has(input:checked) {
  border-color: var(--ext-accent);
  background: rgba(255, 193, 61, 0.1);
}
.ext-popup__option:has(input:checked)::before {
  border-color: var(--ext-accent);
  background: var(--ext-accent);
  box-shadow: inset 0 0 0 4px #ffffff;
}
.ext-popup__option:has(input:focus-visible) {
  outline: 2px solid var(--ext-ink);
  outline-offset: 2px;
}

/* Text fields ---------------------------------------------------------------- */
.ext-popup__fields {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.ext-popup__input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--ext-line);
  border-radius: 12px;
  background: #ffffff;
  font-family: var(--ext-font-secondary);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ext-ink);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  appearance: none;
}
.ext-popup__input::placeholder {
  color: rgba(17, 19, 21, 0.4);
}
.ext-popup__input:focus {
  outline: none;
  border-color: var(--ext-accent);
  box-shadow: 0 0 0 3px rgba(255, 193, 61, 0.22);
}
.ext-popup__input.is-invalid {
  border-color: #e5484d;
}
.ext-popup__input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18);
}

.ext-popup__error {
  display: none;
  margin: 7px 2px 0;
  font-family: var(--ext-font-secondary);
  font-size: 13px;
  font-weight: 600;
  color: #e5484d;
}
.ext-popup__error.is-shown {
  display: block;
}

/* Footer actions ------------------------------------------------------------- */
.ext-popup__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  /* auto top-margin pushes the Back / Send row to the bottom of the frame. */
  margin-top: auto;
  padding-top: 20px;
}

/* Interactive "Go back" pill (reference: bordered pill, arrow slides on hover). */
.ext-popup__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border: 1.5px solid var(--ext-line);
  border-radius: 12px;
  background: #ffffff;
  font-family: var(--ext-font-secondary);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ext-ink);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}
.ext-popup__back svg {
  width: 16px;
  height: 16px;
  transition: transform 0.22s ease;
}
.ext-popup__back:hover {
  border-color: rgba(17, 19, 21, 0.3);
  background: #fbfbfc;
  box-shadow: 0 6px 16px -10px rgba(17, 19, 21, 0.5);
  transform: translateY(-1px);
}
.ext-popup__back:hover svg {
  transform: translateX(-3px);
}
.ext-popup__back:focus-visible {
  outline: 2px solid var(--ext-ink);
  outline-offset: 2px;
}

/* Primary button - a stateful pill:
   idle/disabled (grey) -> ready (brand yellow) -> sending (blue) -> submitted
   (green), or error (red) when the sheet rejected the row. Colours carry the
   meaning; the label changes with each state. */
.ext-popup__submit {
  flex: 1;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: none;
  font-family: var(--ext-font-secondary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  border-radius: 12px;
  cursor: pointer;
  /* idle / disabled */
  background: #eceef1;
  color: rgba(17, 19, 21, 0.4);
  transition:
    transform var(--ext-transition),
    box-shadow var(--ext-transition),
    background 0.25s ease,
    color 0.25s ease;
}
.ext-popup__submit:disabled {
  cursor: not-allowed;
}
/* ready - valid, enabled: brand yellow with dark text */
.ext-popup__submit.is-ready {
  background: var(--ext-accent);
  color: var(--ext-ink);
  box-shadow:
    0 10px 22px -10px rgba(255, 193, 61, 0.9),
    inset 0 -3px 0 rgba(168, 103, 0, 0.26);
}
.ext-popup__submit.is-ready:hover {
  transform: translateY(-1px);
}
/* sending - blue background, black text */
.ext-popup__submit.is-sending {
  background: #2f80ed;
  color: #111315;
}
/* submitted - green background, black text */
.ext-popup__submit.is-submitted {
  background: #23c268;
  color: #111315;
}
/* error - the send was rejected; stays enabled so retrying is one tap */
.ext-popup__submit.is-error {
  background: #e5484d;
  color: #ffffff;
}
.ext-popup__submit.is-error:hover {
  transform: translateY(-1px);
}
.ext-popup__submit:focus-visible {
  outline: 2px solid var(--ext-ink);
  outline-offset: 2px;
}

.ext-popup__reassure {
  margin: 14px 0 0;
  font-family: var(--ext-font-secondary);
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(17, 19, 21, 0.45);
  text-align: center;
}

/* Thank-you step ------------------------------------------------------------- */
.ext-popup__thanks {
  text-align: center;
  padding: 8px 0;
}
.ext-popup__thanks:focus {
  outline: none;
}
.ext-popup__mascot {
  display: block;
  width: auto;
  height: 148px;
  max-width: 100%;
  margin: 0 auto 10px;
  object-fit: contain;
  animation: ext-popup-mascot-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes ext-popup-mascot-pop {
  from { opacity: 0; transform: scale(0.7) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.ext-popup__thanks h3 {
  margin: 0 0 8px;
  font-family: var(--ext-font-primary);
  font-size: 27px;
  font-weight: 700;
  color: var(--ext-ink);
}
.ext-popup__thanks p {
  margin: 0 auto;
  max-width: 350px;
  font-family: var(--ext-font-secondary);
  font-size: 15px;
  line-height: 1.55;
  color: rgba(17, 19, 21, 0.6);
}
.ext-popup__thanks-actions {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 26px;
}
.ext-popup__wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  font-family: var(--ext-font-secondary);
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  background: #25d366;
  text-decoration: none;
  transition:
    transform var(--ext-transition),
    filter var(--ext-transition);
}
.ext-popup__wa:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}
.ext-popup__wa svg {
  width: 21px;
  height: 21px;
}
.ext-popup__done {
  border: none;
  background: none;
  padding: 6px;
  font-family: var(--ext-font-secondary);
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(17, 19, 21, 0.55);
  cursor: pointer;
  transition: color 0.2s ease;
}
.ext-popup__done:hover {
  color: var(--ext-ink);
}

/* intl-tel-input overrides so the phone field matches the popup ------------- */
.ext-popup__phone .iti {
  display: block;
  width: 100%;
}
/* The tel input carries .ext-popup__input for its look. intl-tel-input measures
   the country button and sets the input's padding-left inline to clear it, so we
   must NOT change that button's width (padding) here - only cosmetics. */
.ext-popup__phone .iti__selected-country {
  border-radius: 12px 0 0 12px;
}
.ext-popup__phone .iti__selected-country:hover,
.ext-popup__phone .iti__selected-country-primary:hover {
  background: rgba(17, 19, 21, 0.04);
}
.ext-popup__phone .iti__selected-dial-code {
  font-family: var(--ext-font-secondary);
  font-size: 15px;
  font-weight: 600;
  color: var(--ext-ink);
}
/* The dropdown is appended to <body>; keep it above the overlay and on brand. */
.iti__dropdown-content {
  z-index: 10002 !important;
  border-radius: 14px !important;
  border: 1px solid var(--ext-line) !important;
  box-shadow: 0 24px 60px -20px rgba(12, 13, 15, 0.5) !important;
  overflow: hidden;
  font-family: var(--ext-font-secondary);
}
.iti--container {
  z-index: 10002 !important;
}
.iti__search-input {
  font-family: var(--ext-font-secondary);
  font-size: 14.5px;
  padding: 12px 14px !important;
}
.iti__country {
  font-size: 14.5px;
  padding: 9px 14px;
}
.iti__country.iti__highlight {
  background-color: rgba(255, 193, 61, 0.16);
}
.iti__dial-code {
  color: rgba(17, 19, 21, 0.55);
}

/* Small screens - bottom sheet, still one fixed height ----------------------- */
@media only screen and (max-width: 520px) {
  .ext-popup {
    padding: 0;
    align-items: flex-end;
  }
  .ext-popup__dialog {
    width: 100%;
    height: min(600px, 92vh);
    border-radius: 24px 24px 0 0;
    transform: translateY(24px);
  }
  .ext-popup.is-open .ext-popup__dialog {
    transform: translateY(0);
  }
  .ext-popup__head {
    padding: 26px 22px 0;
  }
  .ext-popup__body {
    padding: 18px 22px 24px;
  }
}

/* Very short viewports: top-align the thank-you too so nothing is clipped. */
@media only screen and (max-height: 620px) {
  .ext-popup__step[data-step="3"].is-active {
    justify-content: flex-start;
  }
}

/* Reduced motion: no slide/scale/lift transitions. */
@media (prefers-reduced-motion: reduce) {
  .ext-popup,
  .ext-popup__dialog,
  .ext-popup__step.is-active,
  .ext-popup__mascot {
    transition: opacity 0.2s ease;
    animation: none;
  }
  .ext-popup.is-open .ext-popup__dialog {
    transform: none;
  }
  .ext-popup__option:hover,
  .ext-popup__submit.is-ready:hover,
  .ext-popup__back:hover {
    transform: none;
  }
  .ext-popup__close-x,
  .ext-popup__back svg {
    transition: none;
  }
}

/* Transport error line inside the popup panel - tighter spacing than the
   page-level rule in style.css, which it overrides here. */
.ext-popup .ext-form-error {
  margin: 12px 0 0;
  font-size: 14px;
  text-align: center;
}
