/* ============================================================
   ESK — "Book a Meeting" modal ([esk_meeting_popup]).
   Chrome only: the field styling, tokens and buttons come from
   esk-contact.css, which this sheet depends on.
   ============================================================ */

.eskpop[hidden] { display: none !important; }

.eskpop {
  position: fixed;
  inset: 0;
  z-index: 100000;          /* above the sticky header and the chat widget */
  display: block;
}

/* --- scrim --- */

.eskpop__scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 20, 38, .62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: eskpop-scrim 260ms var(--eskc-ease-out) backwards;
}

.eskpop__wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.eskpop__card {
  position: relative;
  width: 100%;
  max-width: 650px;
  margin: auto;                       /* keeps it centred, and scrollable when tall */
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  background: var(--eskc-white);
  border-radius: var(--eskc-radius-panel);
  box-shadow: 0 32px 64px -20px rgba(2, 36, 80, .45);
  padding: 34px 34px 30px;
  animation: eskpop-card 420ms var(--eskc-ease-out) 60ms backwards;
}

@keyframes eskpop-scrim { from { opacity: 0; } to { opacity: 1; } }
@keyframes eskpop-card {
  from { opacity: 0; transform: translateY(26px) scale(.965); }
  to   { opacity: 1; transform: none; }
}
@keyframes eskpop-row {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* closing: play the entrance in reverse rather than snapping away */
.eskpop.is-closing .eskpop__scrim { animation: eskpop-scrim 200ms var(--eskc-ease-std) reverse forwards; }
.eskpop.is-closing .eskpop__card { animation: eskpop-card 220ms var(--eskc-ease-std) reverse forwards; }

/* --- close button --- */

.eskpop .eskpop__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 50% !important;
  color: var(--eskc-grey-500);
  cursor: pointer;
  transition: background-color 160ms var(--eskc-ease-std), color 160ms var(--eskc-ease-std);
}
.eskpop .eskpop__close:hover {
  background: var(--eskc-accent-050) !important;
  color: var(--eskc-accent-600);
}
.eskpop .eskpop__close:focus-visible { outline: 2px solid var(--eskc-ink); outline-offset: 2px; }

/* --- head --- */

.eskpop .eskpop__title {
  margin: 0 0 4px !important;
  padding-right: 40px;
  font-family: var(--eskc-font-display) !important;
  font-weight: 600 !important;
  font-size: 25px !important;
  line-height: 1.2 !important;
  letter-spacing: -0.024em !important;
  color: var(--eskc-ink) !important;
  text-transform: none !important;
  animation: eskpop-row 380ms var(--eskc-ease-out) 140ms backwards;
}
.eskpop .eskpop__intro {
  margin: 0 0 22px !important;
  font-family: var(--eskc-font-sans) !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
  color: var(--eskc-grey-600) !important;
  animation: eskpop-row 380ms var(--eskc-ease-out) 180ms backwards;
}

/* --- rows --- */

.eskpop__rows { display: flex; flex-direction: column; gap: 20px; }
.eskpop__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* each row fades up in turn, matching the comp's stagger */
.eskpop__rows .eskpop__field { animation: eskpop-row 380ms var(--eskc-ease-out) backwards; }
.eskpop__rows .eskpop__field:nth-child(1) { animation-delay: 220ms; }
.eskpop__rows .eskpop__field:nth-child(2) { animation-delay: 260ms; }
.eskpop__rows .eskpop__field:nth-child(3) { animation-delay: 300ms; }
.eskpop__rows .eskpop__field:nth-child(4) { animation-delay: 340ms; }
.eskpop__rows .eskpop__field:nth-child(5) { animation-delay: 380ms; }
.eskpop__rows .eskpop__field:nth-child(6) { animation-delay: 420ms; }
.eskpop__consent { animation: eskpop-row 380ms var(--eskc-ease-out) 460ms backwards; }
.eskpop__legal   { animation: eskpop-row 380ms var(--eskc-ease-out) 500ms backwards; }
.eskpop__actions { animation: eskpop-row 380ms var(--eskc-ease-out) 540ms backwards; }

/* --- controls --- */
/* The comp uses placeholder-only fields at 46px with an 18px inset. */

.eskpop .eskpop__input,
.eskpop .eskpop__telnum {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 46px;
  min-height: 46px;
  margin: 0 !important;
  padding: 0 18px !important;
  font-family: var(--eskc-font-sans) !important;
  font-size: 16px;
  line-height: 1.4;
  color: var(--eskc-ink) !important;
  background: var(--eskc-white) !important;
  border: 1px solid var(--eskc-grey-300) !important;
  border-radius: var(--eskc-radius-field) !important;
  box-shadow: none !important;
  outline: none;
  transition: border-color 160ms var(--eskc-ease-std), box-shadow 160ms var(--eskc-ease-std);
}
.eskpop .eskpop__input::placeholder,
.eskpop .eskpop__telnum::placeholder { color: var(--eskc-grey-400); opacity: 1; }

.eskpop .eskpop__textarea {
  height: auto;
  min-height: 124px;
  padding: 15px 18px !important;
  line-height: 1.6;
  resize: vertical;
}

.eskpop .eskpop__input:focus,
.eskpop .eskpop__input:focus-visible {
  border-color: var(--eskc-ink) !important;
  box-shadow: 0 0 0 3px rgba(2, 36, 80, .18) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--eskc-ink) 22%, transparent) !important;
}

/* Every field carries the same tinted icon chip as the contact and service
   forms (.eskc-control__ic, defined in esk-contact.css) — one field language
   across all three. Phone is the exception: its flag picker leads instead. */
.eskpop__ctl { position: relative; display: flex; align-items: center; }
.eskpop__ctl.is-area { align-items: flex-start; }
.eskpop__ctl.is-area .eskc-control__ic { top: 9px; transform: none; }
.eskpop__ctl:focus-within .eskc-control__ic {
  background: var(--eskc-accent-200);
  color: var(--eskc-accent-700, #A8422B);
}

.eskpop .eskpop__input { padding-left: 52px !important; }
.eskpop .eskpop__textarea { padding: 15px 18px 15px 52px !important; }

/* selects */
.eskpop__selectwrap { position: relative; display: flex; align-items: center; }
.eskpop .eskpop__select { padding-right: 44px !important; cursor: pointer; }
.eskpop .eskpop__select[data-empty="1"] { color: var(--eskc-grey-400) !important; }
.eskpop__caret {
  position: absolute;
  right: 16px;
  display: flex;
  color: var(--eskc-grey-500);
  pointer-events: none;
}

/* phone: dial code + number inside one bordered control */
.eskpop__tel {
  display: flex;
  align-items: center;
  height: 46px;
  background: var(--eskc-white);
  border: 1px solid var(--eskc-grey-300);
  border-radius: var(--eskc-radius-field);
  transition: border-color 160ms var(--eskc-ease-std), box-shadow 160ms var(--eskc-ease-std);
}
.eskpop__tel:focus-within {
  border-color: var(--eskc-ink);
  box-shadow: 0 0 0 3px rgba(2, 36, 80, .18);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--eskc-ink) 22%, transparent);
}
.eskpop__cc { position: relative; display: flex; align-items: center; flex: 0 0 auto; }
.eskpop .eskpop__ccsel {
  -webkit-appearance: none;
  appearance: none;
  min-width: 122px;
  height: 44px;
  margin: 0 !important;
  padding: 0 28px 0 18px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none;
  font-family: var(--eskc-font-sans) !important;
  font-size: 16px;
  color: var(--eskc-ink) !important;
  cursor: pointer;
}
.eskpop__caret.is-cc { right: 12px; }
.eskpop__telrule { flex: 0 0 auto; width: 1px; height: 24px; background: var(--eskc-grey-200); }
/* the number sits inside the shared frame, so it drops its own */
.eskpop .eskpop__telnum {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.eskpop .eskpop__telnum:focus { box-shadow: none !important; }

/* --- errors --- */

.eskpop .eskpop__err {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--eskc-danger) !important;
  display: none;
}
.eskpop .eskfrm__field.has-error .eskpop__err { display: block; }
.eskpop .eskfrm__field.has-error .eskpop__input,
.eskpop .eskfrm__field.has-error .eskpop__tel { border-color: var(--eskc-danger) !important; }
.eskpop .eskfrm__field.has-error .eskc-control__ic {
  background: #FBECE9;
  color: var(--eskc-danger);
}

.eskpop .eskpop__formerr {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--eskc-danger) !important;
  display: none;
  text-align: center;
}
.eskfrm__form.has-formerror .eskpop__formerr { display: block; }

/* --- consent + legal --- */

.eskpop__consent { margin-top: 24px; }
.eskpop__consent-row { display: flex; align-items: flex-start; gap: 12px; }
.eskpop .eskpop__consent-text {
  margin: 0 !important;
  font-family: var(--eskc-font-sans) !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: var(--eskc-grey-600) !important;
  cursor: pointer;
}

.eskpop__legal {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
}
.eskpop .eskpop__legal a { color: var(--eskc-accent-600) !important; text-decoration: none !important; }
.eskpop .eskpop__legal a:hover { text-decoration: underline !important; }
.eskpop__legal-sep { color: var(--eskc-grey-300); }

/* --- submit --- */

.eskpop__actions { margin-top: 22px; }

/* Full width, with the site's 8px button radius rather than the comp's pill —
   same as .esk-footer-cta-btn and the other ESK form buttons. The shine sweep
   comes from esk-buttons.css. */
.eskpop .eskpop__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 28px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background-color: var(--eskc-accent) !important;
  color: #fff !important;
  font-size: 15.5px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  /* the theme capitalises button labels — keep the text exactly as typed */
  text-transform: none !important;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}
/* hover, focus, disabled and the arrow slide all come from .eskc-btn — only
   the full-width sizing is overridden here */

/* --- success --- */

.eskpop .eskpop__done { text-align: center; padding: 10px 0 4px; }
.eskpop .eskpop__done[hidden] { display: none !important; }
.eskpop__done-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--eskc-success-050);
  border: 1px solid #BFE2D6;
  color: var(--eskc-success);
}
.eskpop .eskpop__done-title {
  margin: 0 0 8px !important;
  font-family: var(--eskc-font-display) !important;
  font-weight: 600 !important;
  font-size: 22px !important;
  line-height: 1.2 !important;
  color: var(--eskc-ink) !important;
  text-transform: none !important;
}
.eskpop .eskpop__done-text {
  margin: 0 !important;
  font-family: var(--eskc-font-sans) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: var(--eskc-grey-600) !important;
}

/* --- page behind the modal --- */

body.esk-popup-open { overflow: hidden; }

/* --- phone --- */

/* --- phone: a bottom sheet, not a full-screen page ---
   Stretching the card to 100% height left a large dead area under the button.
   A sheet sized to its content, capped at 92vh and scrolling internally, reads
   as a deliberate mobile pattern and keeps the page visible behind it. */

@media (max-width: 620px) {
  .eskpop__wrap {
    padding: 0;
    align-items: flex-end;
    overflow: hidden;                 /* the sheet scrolls, not the wrapper */
  }

  .eskpop__card {
    width: 100%;
    max-width: none;
    margin: 0;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 6px 18px 0;
    animation: eskpop-sheet 360ms var(--eskc-ease-out) backwards;
    display: flex;
    flex-direction: column;
  }
  .eskpop.is-closing .eskpop__card { animation: eskpop-sheet 240ms var(--eskc-ease-std) reverse forwards; }

  /* grab handle — signals the sheet is dismissable */
  .eskpop__card::before {
    content: "";
    flex: 0 0 auto;
    width: 42px;
    height: 4px;
    margin: 4px auto 12px;
    border-radius: 999px;
    background: var(--eskc-grey-300);
  }

  .eskpop .eskpop__close { top: 10px; right: 10px; width: 32px; height: 32px; }

  .eskpop .eskpop__title {
    font-size: 20px !important;
    padding-right: 40px;
  }
  .eskpop .eskpop__intro {
    font-size: 13.5px !important;
    margin: 0 0 16px !important;
  }

  .eskpop__rows { gap: 14px; }
  /* 16px keeps iOS from zooming the viewport on focus */
  .eskpop .eskpop__input,
  .eskpop .eskpop__telnum { font-size: 16px; }
  .eskpop .eskpop__textarea {
    min-height: 104px;
    font-size: 15px;
    padding: 12px 16px 12px 48px !important;
    resize: none;                     /* the drag handle is useless on touch */
  }
  .eskpop .eskc-control__ic { width: 28px; height: 28px; border-radius: 8px; left: 7px; }
  .eskpop .eskpop__input { padding-left: 44px !important; }
  .eskpop .eskpop__ccsel { min-width: 100px; padding: 0 24px 0 14px !important; }

  .eskpop__consent { margin-top: 16px; }
  .eskpop .eskpop__consent-text { font-size: 12.5px !important; line-height: 1.45 !important; }
  .eskpop__legal { margin-top: 14px; font-size: 13px; }

  /* the submit stays reachable while the sheet scrolls */
  .eskpop__actions {
    position: sticky;
    bottom: 0;
    margin-top: 16px;
    padding: 12px 0 16px;
    background: var(--eskc-white);
    box-shadow: 0 -8px 16px -12px rgba(2, 36, 80, .35);
  }
  .eskpop .eskpop__btn { height: 50px; }
}

@keyframes eskpop-sheet {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .eskpop *,
  .eskpop *::before,
  .eskpop *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .eskpop .eskpop__btn:hover:not(:disabled) { transform: none; }
}
