/* Supplied callout, Plans, Contact, legal, Knowledge Base, Login and navigation polish. */

/* Shared right-aligned return links sit above the three full-image stages. */
html body.by5-unified-homepage #main #metrics-section :is(#story-04, #story-05, #story-06) > .story-return {
  position: static;
  inset: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  margin: 0 0 24px auto;
  padding: 0;
  color: var(--by5-teal);
  font: 700 13px/1.5 Inter, Arial, sans-serif;
  text-align: right;
  text-decoration: none;
}
html body.by5-unified-homepage #main #metrics-section :is(#story-04, #story-05, #story-06) > .story-return:hover {
  text-decoration: underline;
}

/* Clip horizontal overflow without creating a scrolling ancestor for the sticky header.
   The open mobile drawer retains its existing overflow:hidden scroll lock. */
html:not(.bs-drawer-open),
body.by5-unified-homepage:not(.drawer-active) {
  overflow-x: clip;
}
html {
  scroll-padding-top: var(--by5-header-scroll-offset, 122px);
}
/* Native fragment navigation also needs only the shared page header offset. */
html body.by5-unified-homepage #main #metrics-section :is(#story-01, #story-02, #story-03, #story-04, #story-05, #story-06) {
  scroll-margin-top: 0;
}
html body.by5-unified-homepage #bs-site-header.bs-navigation-engine.bs-mega-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  overflow: visible;
  max-height: none;
  align-self: start;
}
@media print {
  html body.by5-unified-homepage #bs-site-header.bs-navigation-engine.bs-mega-header {
    position: static;
  }
}

/* One shared signup CTA follows the active trade detail panel. */
html body.by5-unified-homepage #main #bs-trade-finder .trade-free-cta-box {
  grid-area: 2 / 1;
  box-sizing: border-box;
  margin: 0;
  margin-top: 24px !important;
  padding: 20px 24px 24px;
  border-top: 1px solid rgba(15, 61, 62, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
html body.by5-unified-homepage #main #bs-trade-finder .trade-cta-note {
  margin: 0;
  font: 700 14.5px/1.5 Inter, Arial, sans-serif;
  color: var(--by5-text-dark);
}
html body.by5-unified-homepage #main #bs-trade-finder a.trade-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--by5-teal);
  color: #ffffff !important;
  font: 700 14.5px/1.4 Inter, Arial, sans-serif;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 10px !important;
  box-shadow: 0 10px 22px rgba(15, 61, 62, 0.2);
  transition: background-color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
html body.by5-unified-homepage #main #bs-trade-finder a.trade-cta-btn:hover {
  background-color: var(--by5-teal-dark);
  transform: translateY(-1px);
}
html body.by5-unified-homepage #main #bs-trade-finder a.trade-cta-btn:focus-visible {
  outline: 3px solid var(--by5-gold);
  outline-offset: 4px;
}
@media (max-width: 640px) {
  html body.by5-unified-homepage #main #bs-trade-finder a.trade-cta-btn {
    box-sizing: border-box;
    width: 100%;
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  html body.by5-unified-homepage #main #bs-trade-finder a.trade-cta-btn {
    transition: none;
  }
  html body.by5-unified-homepage #main #bs-trade-finder a.trade-cta-btn:hover {
    transform: none;
  }
}

/* The five Field Service Management cards. */
html body.by5-unified-homepage #main #bs-management-software .bs-software-grid > .bs-software-feature-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
html body.by5-unified-homepage #main #bs-management-software .bs-software-grid > .bs-software-feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 61, 62, 0.35);
  box-shadow: 0 14px 30px rgba(15, 61, 62, 0.08);
}
@media (prefers-reduced-motion: reduce) {
  html body.by5-unified-homepage #main #bs-management-software .bs-software-grid > .bs-software-feature-card {
    transition: none;
  }
  html body.by5-unified-homepage #main #bs-management-software .bs-software-grid > .bs-software-feature-card:hover {
    transform: none;
  }
}

/* The actual callout button links to the library's module heading. */
html body.by5-unified-homepage #main #metrics-section .end-wrap {
  align-items: center;
}
html body.by5-unified-homepage #main #metrics-section .end-actions {
  padding-top: 0;
  gap: 16px;
}
html body.by5-unified-homepage #main #metrics-section .end-actions > .callout-band-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 14px 24px;
  border-radius: 10px !important;
  white-space: nowrap;
}
html body.by5-unified-homepage #main #metrics-section .callout-band-button .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* A fixed gradient matches the shared page canvas at every scroll position. */
html body.by5-unified-homepage #main > #bs-pricing.bs-pricing-equalized,
html body.by5-unified-homepage #main > :is(#bs-plans, #plans, .plans-section) {
  background: var(--by5-bg-gradient) !important;
  background-attachment: fixed !important;
}

html body.by5-unified-homepage #main > #contact {
  scroll-margin-top: 90px;
  margin-bottom: 0 !important;
  padding-bottom: 72px !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
html body.by5-unified-homepage #main #contact :is(input, select, textarea):focus,
html body.by5-unified-homepage #main #bs-trader-login input:focus {
  outline: none;
  border-color: var(--by5-teal) !important;
  box-shadow: 0 0 0 3px rgba(15, 61, 62, 0.12);
  background-color: #ffffff;
}

/* The site footer sits flush with the page; quotation attributions retain their styling. */
html body.by5-unified-homepage #main {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
html body.by5-unified-homepage #bs-site-footer {
  background-color: var(--by5-teal-dark) !important;
  margin-top: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
html body.by5-unified-homepage #bs-site-footer .bs-premium-footer {
  margin-top: 0 !important;
}

/* Privacy and Terms are routed panels in this site. */
html body.by5-unified-homepage #main > :is(#privacy-policy, #commercial-terms) {
  padding-top: 96px !important;
  padding-bottom: 48px !important;
  background: rgba(10, 43, 44, 0.45) !important;
  backdrop-filter: blur(4px);
}
html body.by5-unified-homepage #main #privacy-policy > .bs-privacy-portal,
html body.by5-unified-homepage #main #commercial-terms > .bs-commercial-portal {
  max-width: 1060px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(10, 43, 44, 0.25);
  border: 1px solid rgba(15, 61, 62, 0.16);
}
html body.by5-unified-homepage #main :is(#privacy-policy, #commercial-terms) .bs-terms-document,
html body.by5-unified-homepage #by5-cookie-banner {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--by5-teal) #e6f2ee;
}
html body.by5-unified-homepage #main :is(#privacy-policy, #commercial-terms) .bs-terms-document::-webkit-scrollbar,
html body.by5-unified-homepage #by5-cookie-banner::-webkit-scrollbar {
  width: 7px;
}
html body.by5-unified-homepage #main :is(#privacy-policy, #commercial-terms) .bs-terms-document::-webkit-scrollbar-track,
html body.by5-unified-homepage #by5-cookie-banner::-webkit-scrollbar-track {
  background: #e6f2ee;
  border-radius: 999px;
}
html body.by5-unified-homepage #main :is(#privacy-policy, #commercial-terms) .bs-terms-document::-webkit-scrollbar-thumb,
html body.by5-unified-homepage #by5-cookie-banner::-webkit-scrollbar-thumb {
  background: var(--by5-teal);
  border: 0;
  border-radius: 999px;
}
html body.by5-unified-homepage #by5-cookie-banner {
  border-radius: 20px;
  border-color: rgba(15, 61, 62, 0.16);
  box-shadow: 0 24px 60px rgba(10, 43, 44, 0.25);
}

html body.by5-unified-homepage #main > #bs-help-qa {
  scroll-margin-top: 84px;
  padding-top: 64px !important;
}

html body.by5-unified-homepage #main #bs-trader-login :is(button[type="submit"], .login-submit-btn) {
  border: 1px solid rgba(15, 61, 62, 0.25) !important;
  box-shadow: 0 8px 20px rgba(104, 211, 168, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}
html body.by5-unified-homepage #main #bs-trader-login :is(button[type="submit"], .login-submit-btn):hover {
  background: #54c496 !important;
  color: var(--by5-teal-dark);
  transform: translateY(-1px);
}

/* Actual navigation classes include anchors and menu-trigger buttons. */
html body.by5-unified-homepage #bs-site-header :is(.bs-nav-link, .bs-menu-trigger) {
  position: relative;
  transition: color 0.2s ease;
}
html body.by5-unified-homepage #bs-site-header :is(.bs-nav-link, .bs-menu-trigger):is(:hover, :focus-visible) {
  color: var(--by5-gold) !important;
}
html body.by5-unified-homepage #bs-site-header :is(.bs-nav-link, .bs-menu-trigger)::after {
  background: var(--by5-gold) !important;
}
html body.by5-unified-homepage #bs-site-header :is(.bs-nav-link, .bs-menu-trigger):is(.bs-menu-selected, [aria-current="page"]) {
  box-shadow: inset 0 -2px var(--by5-gold);
}
html body.by5-unified-homepage #bs-site-header :is(a.login, a.bs-drawer-login):is(:hover, :focus-visible) {
  background-color: var(--by5-mint) !important;
  color: var(--by5-teal-dark) !important;
  border-color: var(--by5-mint) !important;
}

@media (max-width: 420px) {
  html body.by5-unified-homepage #main #metrics-section .end-actions > .callout-band-button {
    padding-inline: 16px;
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html body.by5-unified-homepage #main :is(#privacy-policy, #commercial-terms) .bs-terms-document,
  html body.by5-unified-homepage #by5-cookie-banner {
    scroll-behavior: auto;
  }
  html body.by5-unified-homepage #main #bs-trader-login button[type="submit"] {
    transition: none;
  }
  html body.by5-unified-homepage #main #bs-trader-login button[type="submit"]:hover {
    transform: none;
  }
}
