/**
 * BravaGuest UI stability layer.
 * Loaded after every other public stylesheet so third-party themes and
 * historical BravaGuest rules cannot cause overlapping or cramped layouts.
 */

/* Predictable sizing and safe wrapping throughout BravaGuest surfaces. */
.bg-marketing-page-v3,
.bg-registration-page,
.bg-account-shell,
.bg-legal-page,
.bg-guide {
  box-sizing:border-box;
}
.bg-marketing-page-v3 *,
.bg-registration-page *,
.bg-account-shell *,
.bg-legal-page *,
.bg-guide * {
  box-sizing:border-box;
}
.bg-marketing-page-v3 :is(h1,h2,h3,p,li,a,span,strong,small),
.bg-registration-page :is(h1,h2,h3,p,li,a,span,strong,small),
.bg-account-shell :is(h1,h2,h3,p,li,a,span,strong,small) {
  overflow-wrap:break-word;
  word-break:normal;
  hyphens:none;
}

/* Keep the main sales page visually centred and prevent builder wrappers from
   creating unusual widths. */
.bg-marketing-page-v3 {
  width:min(calc(100% - 32px),var(--bg-site-max,1440px))!important;
  max-width:var(--bg-site-max,1440px)!important;
  margin-inline:auto!important;
  padding-inline:0!important;
}
.bg-marketing-page-v3 > :where(section,.bg-marketing-proofbar,.bg-legal-footer) {
  width:100%;
  min-width:0;
}
.bg-marketing-page-v3 .bg-marketing-section {
  isolation:isolate;
  clear:both;
}
.bg-marketing-page-v3 .bg-marketing-heading {
  position:relative;
  z-index:1;
}

/* Navigation should sit above content, but never cover the bottom of a page. */
.bg-site-nav {
  contain:layout paint;
}
.bg-site-nav.is-sticky {
  z-index:80!important;
}
.bg-marketing-page-v3 > .bg-legal-footer {
  position:relative;
  z-index:1;
  margin-top:34px!important;
}

/* Marketing cards: reset theme and legacy layout rules. */
.bg-marketing-page-v3 :is(.bg-outcome-grid,.bg-feature-bento,.bg-how-grid-v3,.bg-faq-grid) > article,
.bg-marketing-page-v3 .bg-faq-grid > details {
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden;
}
.bg-marketing-page-v3 :is(.bg-outcome-grid,.bg-feature-bento,.bg-how-grid-v3) h3 {
  max-width:100%!important;
  margin:0 0 10px!important;
  font-size:clamp(1.08rem,.45vw + 1rem,1.32rem)!important;
  line-height:1.22!important;
  letter-spacing:-.02em!important;
  text-wrap:balance;
}
.bg-marketing-page-v3 :is(.bg-outcome-grid,.bg-feature-bento,.bg-how-grid-v3) p {
  max-width:100%!important;
  margin:0!important;
  font-size:clamp(.9rem,.18vw + .86rem,1rem)!important;
  line-height:1.62!important;
}

/* How it works: the numbered badge is part of normal document flow. This is
   deliberately more specific than old absolute-position rules. */
.bg-marketing-page-v3 .bg-how-grid-v3 {
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:clamp(16px,1.5vw,22px)!important;
  align-items:stretch!important;
}
.bg-marketing-page-v3 .bg-how-grid-v3 > article {
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  min-height:250px!important;
  padding:clamp(24px,2vw,30px)!important;
  border-radius:22px!important;
}
.bg-marketing-page-v3 .bg-how-grid-v3 > article > span {
  position:static!important;
  inset:auto!important;
  display:grid!important;
  place-items:center!important;
  flex:0 0 42px!important;
  width:42px!important;
  height:42px!important;
  margin:0 0 22px!important;
  border-radius:13px!important;
  line-height:1!important;
  transform:none!important;
}
.bg-marketing-page-v3 .bg-how-grid-v3 > article > h3,
.bg-marketing-page-v3 .bg-how-grid-v3 > article > p {
  position:static!important;
  inset:auto!important;
  width:100%!important;
  transform:none!important;
}

/* Feature cards use the same calm top-to-bottom rhythm. */
.bg-marketing-page-v3 .bg-feature-bento {
  align-items:stretch!important;
}
.bg-marketing-page-v3 .bg-feature-bento > article {
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  min-height:205px!important;
  padding:clamp(24px,2vw,30px)!important;
}
.bg-marketing-page-v3 .bg-feature-bento > article > span {
  position:static!important;
  margin:0 0 20px!important;
}
.bg-marketing-page-v3 .bg-feature-bento > article > h3,
.bg-marketing-page-v3 .bg-feature-bento > article > p {
  position:static!important;
  width:100%!important;
}

/* Outcome cards: keep icon, heading and copy separated. */
.bg-marketing-page-v3 .bg-outcome-grid > article {
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  min-height:235px!important;
  padding:clamp(24px,2vw,30px)!important;
}
.bg-marketing-page-v3 .bg-outcome-grid .bg-outcome-icon {
  position:static!important;
  margin:0 0 24px!important;
  transform:none!important;
}

/* Pricing and calls to action should not collide with neighbouring sections. */
.bg-marketing-page-v3 .bg-pricing-section-v3,
.bg-marketing-page-v3 .bg-demo-showcase-v3,
.bg-marketing-page-v3 .bg-home-qr-products,
.bg-marketing-page-v3 .bg-home-upgrades,
.bg-marketing-page-v3 .bg-final-cta,
.bg-marketing-page-v3 .bg-referral-promo {
  position:relative!important;
  clear:both!important;
  overflow:hidden;
}
.bg-marketing-page-v3 .bg-price-card-v3 {
  min-width:0!important;
}
.bg-marketing-page-v3 .bg-included-columns {
  align-items:start!important;
}
.bg-marketing-page-v3 .bg-final-cta {
  margin-top:clamp(58px,7vw,96px)!important;
  margin-bottom:0!important;
}
.bg-marketing-page-v3 .bg-referral-promo {
  margin-top:24px!important;
  margin-bottom:0!important;
}
.bg-marketing-page-v3 .bg-final-cta-actions,
.bg-marketing-page-v3 .bg-referral-promo > a,
.bg-marketing-page-v3 .bg-referral-promo .bg-button {
  flex-shrink:0;
}

/* Forms: clear label/input/help-text spacing and no collisions. */
.bg-registration-page .bg-registration-card form,
.bg-account-shell form {
  display:block;
}
.bg-registration-page .bg-registration-card form > p,
.bg-registration-page .bg-registration-card .bg-terms-check,
.bg-account-shell form > p {
  margin:0 0 19px!important;
}
.bg-registration-page .bg-registration-card label,
.bg-account-shell .bg-field > label {
  line-height:1.35!important;
}
.bg-registration-page .bg-registration-card input:not([type="checkbox"]):not([type="radio"]),
.bg-account-shell .bg-field input:not([type="checkbox"]):not([type="radio"]),
.bg-account-shell .bg-field select,
.bg-account-shell .bg-field textarea {
  margin:0!important;
}
.bg-registration-page .bg-registration-card :is(small,.description),
.bg-account-shell .bg-field small {
  position:static!important;
  display:block!important;
  margin:7px 0 0!important;
  line-height:1.45!important;
}
.bg-registration-page .bg-terms-check label {
  display:grid!important;
  grid-template-columns:20px minmax(0,1fr)!important;
  gap:9px!important;
  align-items:start!important;
}
.bg-registration-page .bg-terms-check input {
  margin:3px 0 0!important;
}

/* Host portal: prevent controls from overlapping at intermediate widths. */
.bg-account-shell .bg-account-header,
.bg-account-shell .bg-portal-welcome,
.bg-account-shell .bg-portal-next-step,
.bg-account-shell .bg-guide-row {
  min-width:0!important;
  overflow:hidden;
}
.bg-account-shell .bg-account-header-actions,
.bg-account-shell .bg-guide-actions,
.bg-account-shell .bg-portal-next-actions {
  min-width:0!important;
}
.bg-account-shell .bg-button {
  white-space:normal!important;
  text-align:center;
}

/* Tablet: use two generous cards instead of four compressed cards. */
@media (max-width:1180px) {
  .bg-marketing-page-v3 .bg-how-grid-v3,
  .bg-marketing-page-v3 .bg-outcome-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .bg-marketing-page-v3 .bg-how-grid-v3 > article,
  .bg-marketing-page-v3 .bg-outcome-grid > article {
    min-height:0!important;
  }
}

@media (max-width:900px) {
  .bg-marketing-page-v3 {
    width:min(calc(100% - 24px),var(--bg-site-max,1440px))!important;
  }
  .bg-marketing-page-v3 .bg-marketing-section {
    padding-inline:clamp(12px,3vw,24px)!important;
  }
  .bg-marketing-page-v3 .bg-feature-bento {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .bg-marketing-page-v3 .bg-feature-bento > article.is-wide {
    grid-column:span 2!important;
  }
  .bg-account-shell .bg-guide-actions {
    padding-left:0!important;
  }
}

@media (max-width:680px) {
  .bg-marketing-page-v3 {
    width:min(calc(100% - 16px),var(--bg-site-max,1440px))!important;
  }
  .bg-marketing-page-v3 .bg-how-grid-v3,
  .bg-marketing-page-v3 .bg-outcome-grid,
  .bg-marketing-page-v3 .bg-feature-bento {
    grid-template-columns:1fr!important;
  }
  .bg-marketing-page-v3 .bg-feature-bento > article.is-wide {
    grid-column:auto!important;
  }
  .bg-marketing-page-v3 .bg-how-grid-v3 > article,
  .bg-marketing-page-v3 .bg-outcome-grid > article,
  .bg-marketing-page-v3 .bg-feature-bento > article {
    min-height:0!important;
    padding:22px!important;
  }
  .bg-marketing-page-v3 .bg-how-grid-v3 > article > span {
    width:40px!important;
    height:40px!important;
    flex-basis:40px!important;
    margin-bottom:18px!important;
  }
  .bg-marketing-page-v3 :is(.bg-outcome-grid,.bg-feature-bento,.bg-how-grid-v3) h3 {
    font-size:1.12rem!important;
  }
  .bg-marketing-page-v3 .bg-final-cta,
  .bg-marketing-page-v3 .bg-referral-promo {
    gap:20px!important;
  }
  .bg-site-nav.is-sticky {
    top:max(8px,env(safe-area-inset-top))!important;
  }
  .admin-bar .bg-site-nav.is-sticky {
    top:54px!important;
  }
}

@media (max-width:420px) {
  .bg-marketing-page-v3 .bg-marketing-section {
    padding-inline:8px!important;
  }
  .bg-registration-page .bg-registration-card,
  .bg-account-shell .bg-auth-card-premium {
    padding-inline:17px!important;
  }
}
