/* Use the form destination so new service pages inherit the same treatment.
   Tour and review links are previews of the form. */
header a[href^="/estimate/"],
main a[href^="/estimate/"]:not(.tour-page-link):not(.review-section-link),
footer a.btn[href^="/estimate/"],
.rx-inspection-action,
.price-form .price-submit {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Individual page themes set their own hover and text colors. */
  color: #102b39 !important;
  border-color: #a3c5c8;
  background-color: #a4d7e9;
}

/* A separate layer lets the homepage reveal sequence keep its own animation. */
header a[href^="/estimate/"]::before,
main a[href^="/estimate/"]:not(.tour-page-link):not(.review-section-link)::before,
footer a.btn[href^="/estimate/"]::before,
.rx-inspection-action::before,
.price-form .price-submit::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0; bottom: 0; left: 0; right: var(--assessment-sweep-edge, -70%);
  pointer-events: none;
  background: linear-gradient(100deg, #69c6ea 6%, #9ed5e5 28%, #e2d2ae 52%, #f2ce99 72%, #e9b870 96%);
  animation: var(--assessment-sweep, assessment-color-sweep 5.5s ease-in-out infinite alternate);
  animation-play-state: var(--assessment-play-state, running);
}

/* Each faceted star in the decorative image has its own twist and pulse. */
:is(header a[href^="/estimate/"],
    main a[href^="/estimate/"]:not(.tour-page-link, .review-section-link),
    footer a.btn[href^="/estimate/"],
    .rx-inspection-action, .price-form .price-submit)::after {
  content: "";
  display: var(--assessment-sparkle-display, block);
  position: absolute;
  inset: 0 var(--assessment-stars-inset, clamp(3px, 1.4%, 10px)) auto auto;
  width: var(--assessment-stars-width, 54px);
  height: auto;
  aspect-ratio: 2;
  z-index: 1;
  pointer-events: none;
  transform: none;
  animation: none; /* The three stars animate inside this fixed corner. */
  background: var(--assessment-stars, url("/assets/assessment-star-trio.svg")) center / contain no-repeat;
}

header a[href^="/estimate/"] { --assessment-stars-width: 38px; }
header a[href^="/estimate/"] > :is(.full-label, .small-label) { padding-inline-end: .9em; }
@media (max-width: 760px) {
  header a[href^="/estimate/"] {
    --assessment-stars-width: 32px;
    --assessment-stars-inset: 1px;
  }
}
@media (max-width: 360px) {
  header a[href^="/estimate/"] { --assessment-stars-width: 29px; }
  header a[href^="/estimate/"] > :is(.full-label, .small-label) { padding-inline-end: .15em; }
}

html[data-diamond-motion="paused"], [data-motion-visible="false"], .price-submit:disabled {
  --assessment-play-state: paused;
  --assessment-stars: url("/assets/assessment-star-trio.svg#still");
}

@keyframes assessment-color-sweep {
  from { transform: translateX(0); }
  to { transform: translateX(-41%); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --assessment-sweep: none; --assessment-sweep-edge: 0; --assessment-stars: url("/assets/assessment-star-trio.svg#still"); }
}

.textlink[href^="/estimate/"], .ro-light-link[href^="/estimate/"],
.coat-film-player figcaption a[href^="/estimate/"] {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
  padding: .55em 1em;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
}
.textlink[href^="/estimate/"] { padding-inline-end: 1.6em; }

/* Reserve room for the entire cluster at the widest point of each pulse. */
:is(main a[href^="/estimate/"]:not(.tour-page-link, .review-section-link),
    footer a.btn[href^="/estimate/"], .rx-inspection-action, .price-form .price-submit) {
  padding-inline-end: 3.6rem;
}

.showcase-destinations a[href^="/estimate/"] strong,
.showcase-destinations a[href^="/estimate/"] span { color: inherit; }

header a[href^="/estimate/"]:focus-visible,
main a[href^="/estimate/"]:not(.tour-page-link):not(.review-section-link):focus-visible,
footer a.btn[href^="/estimate/"]:focus-visible,
.rx-inspection-action:focus-visible,
.price-form .price-submit:focus-visible {
  outline: 3px solid #145a78;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fff;
}

@media (forced-colors: active) {
  :root { --assessment-sparkle-display: none; }

  header a[href^="/estimate/"],
  main a[href^="/estimate/"]:not(.tour-page-link):not(.review-section-link),
  footer a.btn[href^="/estimate/"],
  .rx-inspection-action,
  .price-form .price-submit {
    color: ButtonText !important;
    border: 1px solid ButtonText;
    background: ButtonFace;
  }
  header a[href^="/estimate/"]::before,
  main a[href^="/estimate/"]:not(.tour-page-link):not(.review-section-link)::before,
  footer a.btn[href^="/estimate/"]::before,
  .rx-inspection-action::before,
  .price-form .price-submit::before {
    display: none;
  }
}
