/* ==========================================================================
   FINAL CTA — reusable, site-wide section
   Rendered by inc/final-cta.php on any page with "Final CTA" fields.

   .final-cta__copy caps the title + sub + button block at the site's
   --copy-max (style.css).

   The optional biomarker glass cards (.final-cta__biomarkers) sit in one
   absolutely-positioned block at the image's top-right; the cards inside
   stack in normal flow, so they can't overlap whatever their height.
   ========================================================================== */

.final-cta {
  position: relative; overflow: hidden; isolation: isolate; z-index: 1;
  min-height: 70vh; display: flex; align-items: flex-end;
  background: #efeee9;
}
.final-cta__bg { position: absolute; inset: -2px 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.final-cta__bg image-slot { width: 100%; height: 100%; display: block; }
.final-cta__scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 14, 8, 0.4) 0%, rgba(8, 14, 8, 0.18) 42%, rgba(8, 14, 8, 0.02) 76%),
    linear-gradient(0deg, rgba(8, 14, 8, 0.38) 0%, rgba(8, 14, 8, 0.01) 54%),
    rgba(8, 14, 8, 0.04);
}
.final-cta__inner {
  position: relative; z-index: 2;
  width: 100%; margin: 0;
  padding: 0 clamp(28px, 3.4vw, 64px) clamp(72px, 11vh, 130px);
  text-align: left;
}
.final-cta__copy {
  /* Standard copy-block width (--copy-max, style.css). */
  max-width: var(--copy-max, 700px);
}

/*
 * Form variant (final_cta_shortcode set): horizontal containment comes
 * from the site's .wrap (width: min(1240px, 92vw); margin: 0 auto) instead
 * of the narrower 700px .final-cta__copy column. .final-cta__inner's
 * left/right padding is zeroed so it doesn't double up with .wrap; the
 * form card keeps its own max-width (.final-cta__form below).
 */
.final-cta__inner--form { padding-left: 0; padding-right: 0; }
.final-cta__inner--form .final-cta__copy { max-width: none; }

.final-cta__title {
  font-family: var(--sans); font-weight: 400;
  font-size: clamp(44px, 6.5vw, 70px); line-height: 1;
  letter-spacing: -0.02em; color: #fff; margin: 0 0 20px;
}
.final-cta__sub {
  font-family: var(--sans); font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.55; color: rgba(255, 255, 255, 0.82);
  margin: 0 0 28px;
}
.final-cta__btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 16px; font-weight: 500;
  padding: 16px 30px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}
.final-cta__btn .arrow { transition: transform 0.2s ease; }
.final-cta__btn:hover { transform: translateY(-1px); background: var(--accent-hover, #e2611c); }
.final-cta__btn:hover .arrow { transform: translateX(3px); color: #fff; }

/* ── biomarker glass cards — optional, 0–3 ──
   One absolutely-positioned block anchored to the image's top-right
   corner; the cards inside stack in normal flow (flex column + gap), so
   they can't overlap whatever their height. The stagger is a horizontal
   transform offset (--tx) applied with the reveal animation, not a
   positional offset. */
.final-cta__biomarkers {
  position: absolute; z-index: 2; pointer-events: none;
  top: clamp(48px, 9vh, 96px); right: clamp(40px, 6vw, 96px);
  display: flex; flex-direction: column; gap: 16px;
  width: clamp(252px, 27vw, 300px);
}

.final-cta .bm-tag {
  /*
   * Card "glass" look, matching .bm-tag on the Peptides page. Every rule is
   * scoped under .final-cta so it can't collide with peptides-sections.css's
   * unscoped .bm-tag rules on pages that load both.
   */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px; padding: 11px 18px;
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  /*
   * No min-width: the flex column's default align-items: stretch sizes each
   * card to the container's clamp(252px, 27vw, 300px) width. A fixed
   * min-width would push cards outside .final-cta__biomarkers on narrow
   * screens.
   */
}
.final-cta .bm-tag__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.final-cta .bm-tag__name { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); white-space: nowrap; }
.final-cta .bm-tag__status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, 0.9); white-space: nowrap; }
.final-cta .bm-tag__dot-status { width: 7px; height: 7px; border-radius: 50%; background: #57c98a; box-shadow: 0 0 8px 1px rgba(87, 201, 138, 0.7); }
.final-cta .bm-tag__value { font-family: var(--sans); font-weight: 500; font-size: 24px; letter-spacing: -0.02em; color: #fff; margin: 5px 0 10px; }
.final-cta .bm-tag__unit { font-size: 13px; font-weight: 400; color: rgba(255, 255, 255, 0.6); margin-left: 2px; }

.final-cta .bm-bar { position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); }
.final-cta .bm-bar__zone { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: rgba(87, 201, 138, 0.5); }
.final-cta .bm-bar__dot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22), 0 2px 6px rgba(0, 0, 0, 0.4); }

/* suboptimal / warning state */
.final-cta .bm-tag--warn .bm-tag__dot-status { background: #f0b54a; box-shadow: 0 0 8px 1px rgba(240, 181, 74, 0.7); }
.final-cta .bm-tag--warn .bm-bar__zone { background: rgba(240, 181, 74, 0.5); }

.final-cta__bm {
  /*
   * darker glass than the Peptides version — Final CTA photos run brighter,
   * so this keeps the white text legible
   */
  background: rgba(14, 18, 16, 0.42);
  border-color: rgba(255, 255, 255, 0.24);
}

/*
 * the stagger — up to 3 cards, alternating right/left/right via --tx. The
 * offset rides inside the reveal transform (via --tx) so it isn't wiped by
 * `.reveal.in { transform: none }` once the cards animate in.
 */
.final-cta__bm--r1 { --tx: 34px; }
.final-cta__bm--r2 { --tx: -30px; }
.final-cta__bm--r3 { --tx: 34px; }
.final-cta .bm-tag.reveal { transform: translate(var(--tx, 0px), 22px); }
.final-cta .bm-tag.reveal.in { transform: translate(var(--tx, 0px), 0); }

/* ── reveal-in animation — matches the .reveal/.in convention from hiw.css ── */
.final-cta .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.final-cta .reveal.in { opacity: 1; transform: none; }
.final-cta .reveal-d1 { transition-delay: 0.08s; }
.final-cta .reveal-d2 { transition-delay: 0.16s; }
.final-cta .reveal-d3 { transition-delay: 0.24s; }

/*
 * Desktop/tablet with biomarker cards: keep the copy clear of them. The
 * cards sit absolutely on the right, so the copy's wrapper reserves their
 * footprint (+ room for the stagger and a gap) as right padding. Only
 * applies when cards exist, and never to the CF7 form variant.
 */
@media (min-width: 861px) {
  .final-cta:has(.final-cta__biomarkers) .final-cta__inner:not(.final-cta__inner--form) {
    padding-right: calc(clamp(252px, 27vw, 300px) + clamp(40px, 6vw, 96px) + 72px);
  }
}

/*
 * tablet: reduce the stagger amount. The container's own
 * `right: clamp(40px, 6vw, 96px)` already scales down.
 */
@media (max-width: 1024px) {
  .final-cta__bm--r1, .final-cta__bm--r3 { --tx: 24px; }
  .final-cta__bm--r2 { --tx: -20px; }
}

/*
 * Phones (≤860px). The section stacks top to bottom: heading, text and a
 * full-width button first, then the biomarker cards underneath in a
 * narrow centred column with a slight left/right stagger. The cards come
 * first in the markup (desktop needs them there), so `order` swaps them.
 */
@media (max-width: 860px) {
  .final-cta {
    flex-direction: column; justify-content: flex-end; align-items: stretch;
    min-height: 80svh;
    padding-top: clamp(96px, 14svh, 120px); /* keeps the heading below the fixed header */
    box-sizing: border-box;
  }
  /* darker through the middle and bottom, where the copy and cards now sit */
  .final-cta__scrim {
    background: linear-gradient(180deg, rgba(8, 14, 8, 0.24) 0%, rgba(8, 14, 8, 0.5) 30%, rgba(8, 14, 8, 0.8) 55%, rgba(8, 14, 8, 0.9) 100%);
  }

  /* copy block: site's 22px side gutter. The form variant keeps its own
     .wrap containment, so it's left alone here. */
  .final-cta__inner { order: 1; }
  .final-cta__inner:not(.final-cta__inner--form) {
    width: calc(100% - 44px); margin: 0 auto;
    padding: 0 0 calc(clamp(36px, 6svh, 56px) + env(safe-area-inset-bottom, 0px));
  }
  /* with cards below it, the copy only needs a gap above them */
  .final-cta:has(.final-cta__biomarkers) .final-cta__inner:not(.final-cta__inner--form) { padding-bottom: 32px; }

  .final-cta__title { font-size: clamp(31px, 8.6vw, 40px); line-height: 1.1; margin-bottom: 12px; }
  .final-cta__sub { font-size: 16px; line-height: 1.45; margin: 0; max-width: none; }
  .final-cta__copy .btn { margin-top: 22px; width: 100%; box-sizing: border-box; justify-content: center; min-height: 48px; }

  .final-cta__biomarkers {
    order: 2;
    position: relative; inset: auto; top: auto; right: auto; z-index: 2;
    display: flex; flex-direction: column; gap: 10px;
    width: min(250px, 68%); margin: 0 auto;
    padding: 0 0 calc(clamp(36px, 6svh, 56px) + env(safe-area-inset-bottom, 0px));
  }
  .final-cta .bm-tag { width: 100%; box-sizing: border-box; padding: 11px 14px 12px; }

  /* stagger: right, left, right — rides inside the reveal transform */
  .final-cta__bm--r1, .final-cta__bm--r3 { --tx: 20px; }
  .final-cta__bm--r2 { --tx: -20px; }
  .final-cta .bm-tag.reveal { transition: opacity 0.8s ease, transform 1s cubic-bezier(0.22, 1, 0.36, 1); transform: translate(var(--tx, 0px), 36px); }
  .final-cta .bm-tag.reveal.in { transform: translate(var(--tx, 0px), 0); }
  .final-cta__bm--r1.reveal { transition-delay: 0.15s; }
  .final-cta__bm--r2.reveal { transition-delay: 0.5s; }
  .final-cta__bm--r3.reveal { transition-delay: 0.85s; }
}

/* ── optional embedded Contact Form 7 form (final_cta_shortcode) ──
   Targets CF7's output classes (.wpcf7-form, .wpcf7-form-control) plus the
   .field / .final-cta__form-row classes used in the CF7 Form tab markup.
   Everything is scoped under .final-cta__form, since final-cta.css loads
   site-wide.

   Requires the CF7 form's Form tab to wrap each field in <p class="field">
   and any side-by-side pair in <div class="final-cta__form-row">. */
.final-cta__form { margin-top: 60px; max-width: 660px; }

.final-cta__form .wpcf7-form {
  background: rgba(15, 12, 8, 0.38); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px; padding: clamp(26px, 3vw, 40px);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.final-cta__form .final-cta__form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.final-cta__form .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
/* Labels: normal case, sans-serif, softer white. */
.final-cta__form .field label {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: normal; text-transform: uppercase; color: rgb(255, 255, 255);
}

.final-cta__form input.wpcf7-form-control,
.final-cta__form textarea.wpcf7-form-control,
.final-cta__form select.wpcf7-form-control {
  width: 100%; box-sizing: border-box; font-family: var(--sans); font-size: 16px; color: #fff;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 12px;
  padding: 13px 15px; outline: none; transition: border-color 0.18s ease, background 0.18s ease;
}
.final-cta__form select.wpcf7-form-control option { color: #111; }
.final-cta__form select.wpcf7-form-control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.6) 50%), linear-gradient(135deg, rgba(255,255,255,0.6) 50%, transparent 50%); background-position: calc(100% - 20px) center, calc(100% - 15px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.final-cta__form textarea.wpcf7-form-control { resize: vertical; min-height: 92px; }
.final-cta__form input.wpcf7-form-control::placeholder,
.final-cta__form textarea.wpcf7-form-control::placeholder { color: rgba(255, 255, 255, 0.55); }
.final-cta__form input.wpcf7-form-control:focus,
.final-cta__form textarea.wpcf7-form-control:focus,
.final-cta__form select.wpcf7-form-control:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.12); }

.final-cta__form input[type="submit"].wpcf7-form-control {
  width: 100%; margin-top: 6px; font-family: var(--sans); font-size: 16px; font-weight: 600; color: #fff;
  background: var(--accent); border: 0; border-radius: 999px; padding: 16px; cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.final-cta__form input[type="submit"].wpcf7-form-control:hover { background: #e2611c; transform: translateY(-1px); }

.final-cta__form .wpcf7-spinner { margin-left: 10px; }
.final-cta__form .wpcf7-not-valid-tip { display: block; font-size: 12.5px; color: #ff8a6a; margin-top: 5px; }
.final-cta__form .wpcf7-response-output {
  font-family: var(--sans); font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, 0.92);
  text-align: center; border-radius: 12px; margin: 16px 0 0; padding: 10px 14px; border: none;
}

/* Form rows collapse to one column at 620px. */
@media (max-width: 620px) {
  .final-cta__form { max-width: none; }
  .final-cta__form .final-cta__form-row { grid-template-columns: 1fr; }
}
/* Lumart, 12 Nov (phones): the closing banner took most of a screen and its
   black gradient was too heavy. Now at most square (the copy can still grow
   it), the photo centred, and a lighter scrim that only darkens behind the
   copy at the bottom. */
@media (max-width: 860px) {
  .final-cta { min-height: min(100vw, 80svh); }
  .final-cta__bg { object-position: center; }
  .final-cta__scrim {
    background: linear-gradient(180deg, rgba(8, 14, 8, 0) 0%, rgba(8, 14, 8, 0.08) 35%, rgba(8, 14, 8, 0.45) 72%, rgba(8, 14, 8, 0.62) 100%);
  }
}

/* Lumart, 12 Nov (phones): biomarker cards first, then the heading, text
   and button at the bottom of the banner. */
@media (max-width: 860px) {
  .final-cta__biomarkers { order: 1; padding-bottom: 26px; }
  .final-cta__inner { order: 2; }
  .final-cta:has(.final-cta__biomarkers) .final-cta__inner:not(.final-cta__inner--form) {
    padding-bottom: calc(clamp(32px, 5svh, 48px) + env(safe-area-inset-bottom, 0px));
  }
}

/* Lumart, 12 Nov: a lighter overlay and solid white body text in the
   closing banner (every page); a soft shadow keeps the text readable. */
.final-cta__scrim {
  background:
    linear-gradient(90deg, rgba(8, 14, 8, 0.3) 0%, rgba(8, 14, 8, 0.12) 42%, rgba(8, 14, 8, 0) 76%),
    linear-gradient(0deg, rgba(8, 14, 8, 0.28) 0%, rgba(8, 14, 8, 0) 54%);
}
.final-cta__sub { color: #fff; }
.final-cta__title, .final-cta__sub { text-shadow: 0 1px 18px rgba(0, 0, 0, 0.28); }
@media (max-width: 860px) {
  .final-cta__scrim {
    background: linear-gradient(180deg, rgba(8, 14, 8, 0) 0%, rgba(8, 14, 8, 0.05) 35%, rgba(8, 14, 8, 0.32) 72%, rgba(8, 14, 8, 0.46) 100%);
  }
}

/* Lumart, 12 Nov (phones, Peptides and Supplements): even space above and
   below the biomarker cards. The cards take auto margins so any spare height
   splits equally above and below them, and the copy sits a fixed gap under. */
@media (max-width: 860px) {
  .final-cta:has(.final-cta__biomarkers) { justify-content: flex-start; padding-top: 88px; }
  .final-cta__biomarkers { margin: auto auto; padding: 24px 0; }
  .final-cta:has(.final-cta__biomarkers) .final-cta__inner:not(.final-cta__inner--form) { padding-top: 0; }
}
/* Lumart, 12 Nov (follow-up): the space above the top card must equal the
   space between the bottom card and the heading. No extra top padding; the
   cards get the same 32px plus an equal share of any spare height on both sides. */
@media (max-width: 860px) {
  .final-cta:has(.final-cta__biomarkers) { padding-top: 0; }
  .final-cta__biomarkers { padding: 32px 0; }
}

/* Lumart, 13 Nov (desktop): the biomarker cards are bigger and sit in the
   open space between the copy and the right edge, centred top to bottom,
   not tucked into the top-right corner. */
@media (min-width: 1025px) {
  .final-cta__biomarkers {
    top: 50%; transform: translateY(-50%);
    right: clamp(80px, 12vw, 240px);
    width: clamp(320px, 26vw, 400px); gap: 20px;
  }
  .final-cta .bm-tag { padding: 16px 22px 18px; border-radius: 18px; }
  .final-cta .bm-tag__name { font-size: 12.5px; }
  .final-cta .bm-tag__status { font-size: 13px; }
  .final-cta .bm-tag__value { font-size: 31px; margin: 8px 0 14px; }
  .final-cta .bm-tag__unit { font-size: 15px; }
  .final-cta .bm-bar { height: 7px; }
  .final-cta .bm-bar__dot { width: 14px; height: 14px; }
  .final-cta__bm--r1, .final-cta__bm--r3 { --tx: 40px; }
  .final-cta__bm--r2 { --tx: -36px; }
  .final-cta:has(.final-cta__biomarkers) .final-cta__inner:not(.final-cta__inner--form) {
    padding-right: calc(clamp(320px, 26vw, 400px) + clamp(80px, 12vw, 240px) + 80px);
  }
}

/* Dylan, 25 Nov: Pricing's exercise-ball photo carries its HbA1c card at the far right.
   Anchor it right on desktop so the card isn't cropped off. */
@media (min-width: 761px) {
  .final-cta__bg[src*="pricing-final-cta-clarity"] { object-position: right center; }
}

/* Dylan, 25 Nov: GLP-1 closing photo, the pen and hand sit right of centre. */
.final-cta__bg[src*="glp1-final-cta-pen"] { object-position: 62% center; }
/* On wide screens the pen tip ran under the heading: slide the photo right and let its
   plain left edge fade into a matching beige, so the pen starts clear of the copy. */
@media (min-width: 761px) {
  .final-cta:has(.final-cta__bg[src*="glp1-final-cta-pen"]) { background-color: #b09678; }
  .final-cta__bg[src*="glp1-final-cta-pen"] {
    left: 22%; width: 78%; object-position: center;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 14%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 14%);
  }
}
