/* Public CTAs use solid surfaces. Keep the website's page backgrounds,
   inline links, navigation menus and private application controls separate. */
#root:has(.legacy-header) main#main-content :is(
  .azure-home-button, .octa-home-cta, .octa-cyan-button, .showcase-button,
  .aws-service-button, .service-orange-button, .btn-accent, .people-button,
  .enterprise-home-outline, .ocean-button, .ocean-outline, .hub-blog-button,
  .home-feedback-actions > a, .home-feedback-actions > button,
  .reinvent-hero .reinvent-link, .reinvent-connect-actions > a,
  .octa-industry-approach__actions > a, .consulting-connect a,
  .octa-blog-more > button, .people-form button[type="submit"]
):is(a, button),
#root:has(.legacy-header) .legacy-header a:is([href="/contact"], [href="/dashboard"]),
#root:has(.legacy-header) footer :is(.cloud-footer-cta, .octa-footer-cta):is(a, button),
#root:has(.cr-header) .cr-page main#main-content :is(.cr-button, .cr-hero-contact):is(a, button),
#root:has(.ad-page) .ad-page .ad-button:is(a, button),
body:has(#root .legacy-header) .cityroot-dialog :is(.cityroot-primary, .cityroot-secondary) {
  background: var(--octa-solid-button-fill, #0078d4) !important;
  background-image: none !important;
  color: var(--octa-solid-button-ink, #fff) !important;
  -webkit-text-fill-color: currentColor;
  border: 1px solid var(--octa-solid-button-border, #0078d4) !important;
  border-radius: 4px !important;
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none !important;
  box-shadow: none !important;
  filter: none !important;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease,
    color 180ms ease, box-shadow 180ms ease, transform 180ms ease !important;

  /* Remove the previous multicolour hover overlay as well as the base fill. */
  &::before {
    content: none !important;
    background: none !important;
    background-image: none !important;
    opacity: 0 !important;
    box-shadow: none !important;
  }

  &::after { background-image: none !important; box-shadow: none !important; }

  &:is(:hover, :focus-visible) {
    background: var(--octa-solid-button-hover-fill, #005a9e) !important;
    background-image: none !important;
    color: var(--octa-solid-button-hover-ink, #fff) !important;
    border-color: var(--octa-solid-button-hover-border, #005a9e) !important;
    box-shadow: 0 2px 5px #001d351c !important;
    filter: none !important;
  }

  &:focus-visible {
    outline: 3px solid var(--octa-solid-button-focus, #78bfff) !important;
    outline-offset: 3px;
  }

  &:active {
    background: var(--octa-solid-button-active-fill, #004578) !important;
    background-image: none !important;
    color: var(--octa-solid-button-hover-ink, #fff) !important;
    box-shadow: none !important;
    transform: none !important;
  }

  &:is(:disabled, [aria-disabled="true"]),
  &:is(:disabled, [aria-disabled="true"]):is(:hover, :focus-visible, :active) {
    opacity: .55;
    background: var(--octa-solid-button-fill, #0078d4) !important;
    color: var(--octa-solid-button-ink, #fff) !important;
    border-color: var(--octa-solid-button-border, #0078d4) !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: not-allowed;
  }

  @media (hover: hover) and (pointer: fine) {
    &:hover:not(:disabled, [aria-disabled="true"]) { transform: translateY(-1px); }
  }

  @media (prefers-reduced-motion: reduce) {
    &, &::before, &::after, & > svg { transition: none !important; }
    &:is(:hover, :focus-visible, :active) { transform: none !important; }
  }
}

/* Secondary actions on the light service pages and the Azure-style homepage. */
#root:has(.legacy-header) main#main-content :is(
  .aws-service-button-outline, .azure-home-button--secondary
) {
  --octa-solid-button-fill: transparent;
  --octa-solid-button-ink: #171717;
  --octa-solid-button-border: #565b60;
  --octa-solid-button-hover-fill: #e8f3fb;
  --octa-solid-button-hover-ink: #004578;
  --octa-solid-button-hover-border: #0078d4;
  --octa-solid-button-active-fill: #d1e8f8;
  --octa-solid-button-focus: #0078d4;
}

/* White outlines stay legible against the existing dark public sections. */
#root:has(.legacy-header) .legacy-header a[href="/dashboard"],
#root:has(.legacy-header) main#main-content :is(
  .enterprise-home-outline, .ocean-outline,
  .home-feedback-actions > :nth-child(n + 2),
  .reinvent-connect-actions .reinvent-careers, .octa-industry-approach__actions > a:nth-child(n + 2), .octa-blog-more > button
),
#root:has(.cr-header) .cr-page main#main-content .cr-hero-contact,
body:has(#root .legacy-header) .cityroot-dialog .cityroot-secondary {
  --octa-solid-button-fill: transparent;
  --octa-solid-button-ink: #fff;
  --octa-solid-button-border: #9da8b2;
  --octa-solid-button-hover-fill: #192b3b;
  --octa-solid-button-hover-ink: #fff;
  --octa-solid-button-hover-border: #7dc6ff;
  --octa-solid-button-active-fill: #102131;
}

/* Small public carousel controls keep their geometry, with a solid fill only. */
#root:has(.legacy-header) main#main-content :is(
  .home-service-toggle, .trend-toggle, .trend-controls button,
  .industry-card-toggle > svg
) {
  background: #0078d4 !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: none !important;
}
