/*
 * New-design signup page (page-signupform.php) - account.esensehealth.com/signupform
 *
 * Design: design/form (1).png and form (2).png - the registration form as one
 * white card on the lavender page background. Cormorant Garamond heading,
 * Plus Jakarta Sans text, lavender inputs, violet callout, navy pill button.
 *
 * Two kinds of rules live here:
 *
 * 1. #esf-signup ...  The template's own chrome (footer band, success state).
 *    Not Elementor content, so scoped with the id.
 *
 * 2. .esf ...         The Elementor content of the page. Hooked on the CSS classes
 *    the page's section and widgets carry (Advanced > CSS Classes: esf-card,
 *    esf-callout, esf-form, ...). Kept light on purpose: they beat the Elementor
 *    Kit's global defaults, but anything set in a widget's Style tab (emitted as
 *    `.elementor-{page} .elementor-element-{id} ...`) wins over them.
 *
 * Never set `display` on .elementor-field-group in general: signup-stripe.php and
 * header-signup.php show/hide the referral follow-up fields with it.
 */

.esf {
  --esf-navy: #0B3D52;
  --esf-teal: #095F7D;
  --esf-violet: #574A8E;
  --esf-lav: #B3A4D6;
  --esf-lav-pale: #EEEAF7;
  --esf-lav-bg: #F6F4FB;
  --esf-text: #3D5560;
  --esf-muted: #4A6470;
  --esf-grey: #979797;
  --esf-field-line: #D3D9E2;
  --esf-placeholder: #B5BEC6;
  --esf-error: #B3261E;
  --esf-ring: 0 0 0 3px rgba(179, 164, 214, 0.4);
  --esf-serif: 'Cormorant Garamond', Georgia, serif;
  --esf-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body.esf-body { background: #F6F4FB; margin: 0; }

#esf-signup {
  font-family: var(--esf-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--esf-text);
  -webkit-font-smoothing: antialiased;
}
#esf-signup *,
#esf-signup *::before,
#esf-signup *::after { box-sizing: border-box; }

/* =====================================================================
 * 1. Template chrome
 * ===================================================================== */

#esf-signup .esf-main { padding: 0 0 48px; }
@media (min-width: 640px) {
  #esf-signup .esf-main { padding-bottom: 64px; }
}

/* The theme's copyright line (footer.php), as on /signup/. style.css pins it to
   the viewport bottom, over the form; here it sits in the page flow instead. */
body.esf-body > footer .footer-copy {
  position: static;
  padding: 16px 20px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  color: #878787;
}
body.esf-body > footer .footer-copy p { margin: 0; }

/* ---------- Success state (?status=success): Elementor template 11958 ----------
   Same template as /signup/'s success screen. Its first section is the header
   banner (kept full width, like the form page); the sections after it are drawn
   together as the white card. */
#esf-signup .esf-success > .elementor > .elementor-top-section:first-child { margin-bottom: 28px; }
#esf-signup .esf-success > .elementor > .elementor-top-section:not(:first-child) {
  width: calc(100% - 24px);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 18px;
  background: #fff;
  text-align: center;
}
#esf-signup .esf-success > .elementor > .elementor-top-section:nth-child(2) { border-radius: 24px 24px 0 0; padding-top: 20px; }
#esf-signup .esf-success > .elementor > .elementor-top-section:last-child { border-radius: 0 0 24px 24px; }
#esf-signup .esf-success > .elementor > .elementor-top-section:not(:first-child) > .elementor-container { max-width: none; }

/* Fallback card, used only if template 11958 is missing */
#esf-signup .esf-success-card {
  width: calc(100% - 24px);
  max-width: 760px;
  margin: 28px auto 0;
  padding: 40px 24px;
  border-radius: 24px;
  background: #fff;
  text-align: center;
}

#esf-signup .esf-success h2 {
  margin: 0;
  font-family: var(--esf-serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.2;
  color: var(--esf-navy);
}
#esf-signup .esf-success h2 + h2 {
  margin-top: 14px;
  font-family: var(--esf-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--esf-text);
}
#esf-signup .esf-success p { margin: 18px 0 0; font-size: 15px; }
#esf-signup .esf-success a { color: var(--esf-violet); font-weight: 600; }
#esf-signup .esf-success .elementor-top-section:not(:first-child) img { max-width: 100%; height: auto; border-radius: 20px; }

@media (min-width: 640px) {
  #esf-signup .esf-success > .elementor > .elementor-top-section:first-child { margin-bottom: 40px; }
  #esf-signup .esf-success > .elementor > .elementor-top-section:not(:first-child) { width: calc(100% - 40px); padding: 0 56px; }
  #esf-signup .esf-success > .elementor > .elementor-top-section:nth-child(2) { border-radius: 32px 32px 0 0; padding-top: 36px; }
  #esf-signup .esf-success > .elementor > .elementor-top-section:last-child { border-radius: 0 0 32px 32px; }
  #esf-signup .esf-success-card { width: calc(100% - 40px); margin-top: 40px; padding: 56px; border-radius: 32px; }
  #esf-signup .esf-success h2 { font-size: 38px; }
}

/* =====================================================================
 * 2. Elementor content (hooked on the classes set in Elementor)
 * ===================================================================== */

/* Elementor puts its default widget spacing (20px) under every widget; the design
   spaces these widgets itself below. Per-widget margins set in Elementor
   (Advanced > Margin) sit on .elementor-widget-container and still apply. */
.esf .esf-card .elementor-widget { margin-bottom: 0; margin-block-end: 0; }

.esf .elementor-widget-text-editor p { margin: 0 0 0.75em; }
.esf .elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* ---------- Header banner (section esf-banner) ----------
   The same full-width image section /signup/ opens with. The image fills the
   width so wide screens get no lavender strips beside it. */
.esf .esf-banner .elementor-widget-image img { display: block; width: 100%; height: auto; }

/* ---------- The card (section esf-card) ---------- */
.esf .elementor-section.esf-card {
  width: calc(100% - 24px);
  max-width: 760px;
  margin: 28px auto 0;
  padding: 28px 18px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px -10px rgba(11, 61, 82, 0.14);
}
.esf .esf-card > .elementor-container { max-width: none; }
@media (min-width: 640px) {
  .esf .elementor-section.esf-card { width: calc(100% - 40px); margin-top: 40px; padding: 56px; border-radius: 32px; }
}

.esf .esf-card-title .elementor-heading-title {
  font-family: var(--esf-serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--esf-navy);
}
@media (min-width: 640px) {
  .esf .esf-card-title .elementor-heading-title { font-size: 42px; }
}

.esf .elementor-widget.esf-card-intro { margin-top: 14px; }
.esf .esf-card-intro,
.esf .esf-card-note {
  font-family: var(--esf-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--esf-text);
}
.esf .esf-card-note { font-size: 15px; }
.esf .elementor-widget.esf-card-note { margin-top: 18px; }

/* "You won't be charged today..." */
.esf .elementor-widget.esf-callout { margin-top: 18px; }
.esf .esf-callout {
  padding: 16px 18px;
  border-left: 4px solid var(--esf-violet);
  border-radius: 12px;
  background: var(--esf-lav-pale);
  font-family: var(--esf-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.65;
  color: var(--esf-navy);
}
@media (min-width: 640px) {
  .esf .esf-callout { padding: 16px 20px 16px 22px; }
}

/* Helper html widgets under the form (scripts only, nothing visible) */
.esf .elementor-widget.esf-helper { margin: 0; }

/* ---------- The registration form (Form widget, class esf-form) ----------
   Field widths, column/row gap and label spacing are set on the widget itself
   in Elementor (Content > Form Fields, Style > Form). */

.esf .esf-form .elementor-field-group,
.esf .esf-form .elementor-field-type-html,
.esf .esf-form .elementor-field-subgroup label { font-family: var(--esf-sans); }

.esf .esf-form .elementor-field-group > label,
.esf .esf-form .elementor-field-group .elementor-field-label,
.esf .esf-form #form-field-stripe_card_element > label {
  display: block;
  margin: 0; /* bootstrap's label margin; the gap is the widget's Label Spacing */
  padding: 0;
  font-family: var(--esf-sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--esf-navy);
}
.esf .esf-form .elementor-mark-required .elementor-field-label::after { color: var(--esf-violet); }

/* Text inputs and selects. Background, border and text colours are set on the
   Form widget (Style > Field) - Elementor prints those per widget and they win. */
.esf .esf-form .elementor-field-group .elementor-field,
.esf .esf-form .elementor-field-group .elementor-field-textual {
  width: 100%;
  height: 50px;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--esf-field-line);
  border-radius: 14px;
  background-color: var(--esf-lav-bg);
  box-shadow: none;
  font-family: var(--esf-sans);
  font-size: 15px;
  line-height: 48px;
  color: var(--esf-navy);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.esf .esf-form .elementor-field-group .elementor-field-textual::placeholder { color: var(--esf-placeholder); opacity: 1; }
.esf .esf-form .elementor-field-group .elementor-field-textual:focus {
  outline: none;
  border-color: var(--esf-violet);
  box-shadow: var(--esf-ring);
}

/* Elementor wraps each <select> in div.elementor-field.elementor-select-wrapper,
   which the input rule above would draw a second border around. */
.esf .esf-form .elementor-field-group .elementor-select-wrapper {
  position: relative;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  line-height: normal;
}
.esf .esf-form .elementor-select-wrapper select { padding-right: 44px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.esf .esf-form .elementor-select-wrapper .select-caret-down-wrapper { right: 18px; color: var(--esf-violet); font-size: 11px; }
.esf .esf-form .elementor-select-wrapper .select-caret-down-wrapper svg { fill: currentColor; }

/* Acceptance checkboxes carry .elementor-field too: back to a plain box */
.esf .esf-form .elementor-field-type-acceptance .elementor-field-subgroup { width: 100%; }
.esf .esf-form .elementor-field-type-acceptance .elementor-field-option { display: flex; align-items: flex-start; gap: 12px; }
.esf .esf-form .elementor-field-group .elementor-acceptance-field {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--esf-violet);
  cursor: pointer;
}
.esf .esf-form .elementor-field-type-acceptance .elementor-field-option label {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--esf-text);
  cursor: pointer;
}
.esf .esf-form .elementor-field-type-acceptance a { color: var(--esf-violet); font-weight: 500; text-decoration: underline; }

/* Discount code + card. The helper script wraps these two fields in .stripe-wrapper;
   the design shows them as ordinary rows, so the wrapper is invisible. */
.esf .esf-form .stripe-wrapper {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.esf .esf-form .elementor-field-group-promo_code .elementor-field-label { font-size: 13px; line-height: 1.5; }

/* Stripe card field: lives in an html field, as a nested .elementor-field-group */
.esf .esf-form #form-field-stripe_card_element { width: 100%; margin: 0; padding: 0; }
.esf #card-element {
  margin-top: 6px;
  min-height: 48px;
  padding: 14px 16px;
  border: 1px solid var(--esf-field-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}
.esf #card-element.StripeElement--focus { border-color: var(--esf-violet); box-shadow: var(--esf-ring); }
.esf #card-element.StripeElement--invalid { border-color: var(--esf-error); box-shadow: none; }
.esf #card-errors,
.esf #promo_code_message { margin-top: 8px; font-size: 13px; }
.esf #card-errors { color: var(--esf-error); }

/* Disclaimer html field, between two hairlines */
.esf .esf-form .elementor-field-group-field_9924712 {
  margin-top: 4px;
  border-top: 1px solid var(--esf-lav-pale);
  border-bottom: 1px solid var(--esf-lav-pale);
}
/* Vertical padding on the text: Elementor zeroes the field group's bottom padding. */
.esf .esf-form .esf-disclaimer {
  margin: 0;
  padding: 20px 0 22px;
  font-size: 16px;
  line-height: 1.75;
  text-align: center;
  color: var(--esf-grey);
}

/* Submit */
.esf .esf-form .elementor-field-type-submit { margin-top: 4px; }
.esf .esf-form .elementor-field-group .elementor-button {
  width: 100%;
  min-height: 56px;
  padding: 16px 28px;
  border: 0;
  border-radius: 999px;
  background-color: var(--esf-navy);
  background-image: none;
  box-shadow: 0 14px 30px -14px rgba(11, 61, 82, 0.6);
  font-family: var(--esf-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
}
.esf .esf-form .elementor-field-group .elementor-button:hover,
.esf .esf-form .elementor-field-group .elementor-button:focus-visible {
  background-color: var(--esf-violet);
  color: #fff;
  transform: translateY(-2px);
}
.esf .esf-form .elementor-form-waiting .elementor-button,
.esf .esf-form .elementor-field-group .elementor-button:disabled { opacity: 0.6; transform: none; cursor: wait; }

/* Errors and messages */
.esf .esf-form .elementor-error .elementor-field-textual { border-color: var(--esf-error); }
.esf .esf-form .elementor-message { margin-top: 6px; font-family: var(--esf-sans); font-size: 13px; line-height: 1.5; }
.esf .esf-form .elementor-message-danger { color: var(--esf-error); }
.esf .esf-form .elementor-message-success { color: var(--esf-teal); }
.esf #repeat_email_message { bottom: -22px; color: var(--esf-error); font-size: 12px; }

/* =====================================================================
 * Clinic-name prompt (SweetAlert from signup-stripe.php). Appended to <body>,
 * outside the page wrapper. The Save button's teal is an inline style
 * (confirmButtonColor), so it needs !important to change.
 * ===================================================================== */

body.esf-body .swal2-popup {
  border-radius: 24px;
  padding: 28px 24px 24px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
body.esf-body .swal2-html-container { font-size: 15px; color: #0B3D52; }
body.esf-body .swal2-input {
  height: 48px;
  margin: 18px 0 0;
  width: 100%;
  padding: 0 20px;
  border: 1px solid rgba(11, 61, 82, 0.15);
  border-radius: 999px;
  box-shadow: none;
  font-family: inherit;
  font-size: 15px;
  color: #0B3D52;
}
body.esf-body .swal2-input:focus { border-color: #574A8E; box-shadow: 0 0 0 3px rgba(179, 164, 214, 0.4); }
body.esf-body .swal2-actions { gap: 8px; }
body.esf-body .swal2-styled {
  min-width: 96px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
}
body.esf-body .swal2-styled.swal2-confirm { background-color: #0B3D52 !important; }
body.esf-body .swal2-styled.swal2-confirm:hover { background-color: #574A8E !important; }
body.esf-body .swal2-styled.swal2-cancel {
  background: #fff !important;
  border: 1px solid rgba(87, 74, 142, 0.3);
  color: #574A8E;
}
body.esf-body .swal2-styled:focus { box-shadow: 0 0 0 3px rgba(179, 164, 214, 0.5); }
