/* Avanti Health · P1-4 seamless callback enquiry
   Scoped to [data-seamless-enquiry] so it only styles the rewritten inline
   `.inline-callback-form` and modal `#leadForm`. Loaded from </head> after
   site.css and the page style blocks. */

[data-seamless-enquiry] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 0;
}

/* Hours-added callbacks carry a more specific legacy multi-column rule. */
form.inline-callback-form[data-seamless-enquiry] {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

[data-seamless-enquiry][hidden] {
  display: none;
}

[data-seamless-enquiry] [hidden] {
  display: none !important;
}

[data-seamless-enquiry] .validation-message {
  margin: 0;
  min-block-size: 0;
}

[data-seamless-enquiry] .validation-message:empty {
  display: none;
}

.form-shell:has([data-seamless-enquiry]) {
  align-items: start;
  padding-block: max(16px, 5vh);
}

.form-modal:has([data-seamless-enquiry]) {
  width: min(560px, 100%);
  max-height: 90dvh;
  background: var(--warm, #f8f5f0);
  /* Fixed header (close + heading) above a scrollable form body. The close is
     positioned inside the reserved top padding, so it never scrolls away and
     the body never overlaps it. `overflow:hidden` removes the legacy 4px
     horizontal scrollbar caused by negative margins. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 60px;
}

.form-modal:has([data-seamless-enquiry]) .form-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  background: var(--warm, #f8f5f0);
  border-radius: 999px;
}

.form-modal:has([data-seamless-enquiry]) h2 {
  padding-right: 0;
}

/* Only the form body scrolls; the heading stays put above it. */
.form-modal:has([data-seamless-enquiry]) form[data-seamless-enquiry] {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 3px;
}

@media (max-width: 600px) {
  .form-shell:has([data-seamless-enquiry]) { padding: 8px; }
  .form-modal:has([data-seamless-enquiry]) { max-height: calc(100dvh - 16px); padding-top: 56px; }
}

/* Progress --------------------------------------------------------------- */
[data-seamless-enquiry] .enquiry-progress {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
}

[data-seamless-enquiry] .enquiry-progress::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 26px;
  width: 10px;
  height: 1px;
  background: var(--warm-dark, #d8c9b5);
}

[data-seamless-enquiry] .enquiry-progress-segment {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 26px;
  block-size: 26px;
  border: 1px solid var(--warm-dark, #d8c9b5);
  border-radius: 999px;
  background: #fff;
  color: var(--text-mid, #4a5a63);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

[data-seamless-enquiry] .enquiry-progress-segment[aria-current="step"] {
  border-color: var(--teal-deep, #1d7a7a);
  background: var(--teal-deep, #1d7a7a);
  color: #fff;
}

/* Steps ------------------------------------------------------------------ */
[data-seamless-enquiry] .inline-callback-step,
[data-seamless-enquiry] .form-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-inline-size: 0;
}

[data-seamless-enquiry] [data-enquiry-step][hidden],
[data-seamless-enquiry] .inline-callback-extra[hidden] {
  display: none;
}

/* Labels and controls ---------------------------------------------------- */
[data-seamless-enquiry] label {
  display: grid;
  gap: 6px;
  min-inline-size: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy, #0e2229);
}

[data-seamless-enquiry] input:not([type="hidden"]),
[data-seamless-enquiry] select,
[data-seamless-enquiry] textarea {
  inline-size: 100%;
  min-block-size: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--warm-dark, #d8c9b5);
  border-radius: var(--r-md, 10px);
  background: #fff;
  color: var(--text, #243b42);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
}

[data-seamless-enquiry] textarea {
  min-block-size: 132px;
  resize: vertical;
}

[data-seamless-enquiry] input:focus-visible,
[data-seamless-enquiry] select:focus-visible,
[data-seamless-enquiry] textarea:focus-visible {
  border-color: var(--teal-deep, #1d7a7a);
  outline: 2px solid var(--gold, #c8a34a);
  outline-offset: 1px;
}

[data-seamless-enquiry] [aria-invalid="true"] {
  border-color: #9f2e1b;
  box-shadow: 0 0 0 2px rgba(159, 46, 27, 0.14);
}

/* Step heading ----------------------------------------------------------- */
[data-seamless-enquiry] .inline-callback-step-heading,
[data-seamless-enquiry] .form-step-heading {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif !important;
  font-size: clamp(19px, 2.1vw, 23px) !important;
  font-weight: 600 !important;
  line-height: 1.2;
  color: var(--navy, #0e2229) !important;
}

/* Errors and status ------------------------------------------------------ */
[data-seamless-enquiry] .form-error {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--error, #9f2e1b);
}

[data-seamless-enquiry] .form-error[hidden],
[data-seamless-enquiry] [data-enquiry-status][hidden] {
  display: none;
}

[data-seamless-enquiry] [data-enquiry-status] {
  margin: 0;
  min-block-size: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-mid, #4a5a63);
}

[data-seamless-enquiry] [data-enquiry-status][data-state="error"] {
  color: var(--error, #9f2e1b);
  font-weight: 600;
}

[data-seamless-enquiry] [data-enquiry-status][data-state="success"] {
  color: var(--teal-deep, #1d7a7a);
  font-weight: 700;
}

/* Actions ---------------------------------------------------------------- */
[data-seamless-enquiry] .btn,
[data-seamless-enquiry] [data-enquiry-continue],
[data-seamless-enquiry] [data-enquiry-submit] {
  inline-size: 100%;
  min-block-size: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--teal-deep, #1d7a7a);
  border-radius: var(--r-md, 10px);
  background: var(--teal-deep, #1d7a7a);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  cursor: pointer;
}

[data-seamless-enquiry] .btn:hover,
[data-seamless-enquiry] [data-enquiry-continue]:hover,
[data-seamless-enquiry] [data-enquiry-submit]:hover {
  background: var(--navy, #0e2229);
  border-color: var(--navy, #0e2229);
}

[data-seamless-enquiry] .btn:active {
  transform: translateY(1px);
}

[data-seamless-enquiry] .btn:disabled,
[data-seamless-enquiry] button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

[data-seamless-enquiry] .form-back {
  inline-size: auto;
  min-block-size: 48px;
  justify-self: start;
  margin: 0;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--teal-deep, #1d7a7a);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

[data-seamless-enquiry] .form-back:hover {
  background: none;
  color: var(--navy, #0e2229);
}

[data-seamless-enquiry] .enquiry-retry {
  inline-size: 100%;
  min-block-size: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--teal-deep, #1d7a7a);
  border-radius: var(--r-md, 10px);
  background: #fff;
  color: var(--teal-deep, #1d7a7a);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

[data-seamless-enquiry] .enquiry-retry:hover {
  background: var(--teal-deep, #1d7a7a);
  color: #fff;
}

/* Helper, referral link and reCAPTCHA footer ----------------------------- */
[data-seamless-enquiry] .cro-include-helper {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-mid, #4a5a63);
}

[data-seamless-enquiry] .inline-callback-utility {
  margin: 0;
  min-block-size: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-mid, #4a5a63);
}

[data-seamless-enquiry] .inline-callback-utility a,
[data-seamless-enquiry] .inline-callback-utility button {
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal-deep, #1d7a7a);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

[data-seamless-enquiry] .enquiry-footer {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--warm-dark, #d8c9b5);
}

[data-seamless-enquiry] .enquiry-footer .recaptcha-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-mid, #4a5a63);
}

[data-seamless-enquiry] .enquiry-footer .recaptcha-note a {
  color: var(--teal-deep, #1d7a7a);
  text-decoration: underline;
}

/* Small screens ---------------------------------------------------------- */
@media (max-width: 840px) {
  [data-seamless-enquiry] .inline-callback-step,
  [data-seamless-enquiry] .form-step {
    gap: 12px;
  }
}

@media (max-width: 360px) {
  [data-seamless-enquiry] {
    gap: 14px;
  }

  [data-seamless-enquiry] .enquiry-progress-segment {
    inline-size: 24px;
    block-size: 24px;
  }

  [data-seamless-enquiry] .enquiry-progress::after {
    left: 24px;
  }
}

[data-seamless-enquiry] .enquiry-field-error { color: #a3332d; font-size: 14px; line-height: 1.45; font-weight: 400; }

/* Control sizing ---------------------------------------------------------
   Legacy page and media-query rules set `min-height: 44px` on inputs, selects
   and textareas. Enforce the agreed 48px minimum for every seamless control
   regardless of inherited styles. */
[data-seamless-enquiry] input:not([type="hidden"]),
[data-seamless-enquiry] select,
[data-seamless-enquiry] textarea {
  min-block-size: 48px !important;
  min-height: 48px !important;
}

/* Confirmation ----------------------------------------------------------- */
[data-seamless-enquiry] [data-enquiry-status][data-state="success"] {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--teal-deep, #1d7a7a);
  border-left: 4px solid var(--teal-deep, #1d7a7a);
  border-radius: var(--r-lg, 14px);
  background: var(--teal-pale, #eaf6f6);
}

[data-seamless-enquiry] .enquiry-confirmation-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy, #0e2229);
}

[data-seamless-enquiry] .enquiry-confirmation-line {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-mid, #4a5a63);
}

[data-seamless-enquiry] .enquiry-start-another {
  inline-size: auto;
  min-block-size: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  margin: 0;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--teal-deep, #1d7a7a);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

[data-seamless-enquiry] .enquiry-start-another:hover {
  background: none;
  color: var(--navy, #0e2229);
}

/* Mobile sticky navigation ----------------------------------------------
   While a seamless form is actively in use (step two or a focused field), the
   fixed call/callback bar competes with the form and eats the bottom of small
   screens. The store adds `.enquiry-form-active` to the root element and this
   rule collapses the bar until the enquiry finishes or resets. */
.enquiry-form-active .sticky {
  display: none !important;
}

/* Keep the clinic phone and logo separate on the narrowest screens. */
@media (max-width: 400px) {
  header.nav { padding-inline: 12px; gap: 6px; }
  header.nav .nav-brand { flex: 1 1 88px; min-width: 0; }
  header.nav .nav-logo { width: 100%; max-width: 120px; height: auto; }
  header.nav .mobile-header-call { flex: 0 0 auto; font-size: 12px; padding: 10px 8px; min-height: 48px; white-space: nowrap; }
  header.nav .menu-toggle { flex: 0 0 48px; min-width: 48px; min-height: 48px; }
}
@media (min-width: 361px) and (max-width: 400px) {
  header.nav .mobile-header-call { font-size: 14px; }
}

