.captcha-check {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: .875rem;
  width: 100%;
  max-width: 21rem;
  min-height: 4.5rem;
  margin: 0 auto 1rem;
  padding: .75rem 1rem;
  border: 1px solid #d5e0ec;
  border-radius: .625rem;
  background: #f4f8fc;
  color: #17283b;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

.captcha-check__input {
  appearance: none;
  display: grid;
  place-content: center;
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 2px solid #60768d;
  border-radius: .3rem;
  background: #fff;
  cursor: inherit;
}

.captcha-check__input:focus-visible {
  outline: 2px solid #347db9;
  outline-offset: 3px;
}

.captcha-check__input:checked {
  border-color: #16734b;
  background: #16734b;
}

.captcha-check__input:checked::after {
  content: "";
  display: block;
  width: .45rem;
  height: .8rem;
  margin-top: -.15rem;
  border: solid #fff;
  border-width: 0 .15rem .15rem 0;
  transform: rotate(45deg);
}

.captcha-check__success {
  display: none;
  color: #16734b;
}

.captcha-check__input:checked ~ .captcha-check__prompt {
  display: none;
}

.captcha-check__input:checked ~ .captcha-check__success {
  display: inline;
}

@media (forced-colors: active) {
  .captcha-check__input {
    appearance: auto;
    display: inline-block;
  }

  .captcha-check__input:checked::after {
    content: none;
  }
}

.captcha-check-error {
  box-sizing: border-box;
  width: 100%;
  max-width: 21rem;
  margin: 0 auto .5rem;
  padding: .55rem .75rem;
  border: 1px solid #e7a6a6;
  border-radius: .625rem;
  background: #fff0f0;
  color: #9f2525;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .captcha-check-error {
    animation: captcha-error-pulse .65s ease-in-out 2;
  }

  @keyframes captcha-error-pulse {
    50% { background-color: #ffd4d4; }
  }
}

@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  .captcha-check.is-confirming .captcha-check__input:checked {
    border-color: #60768d;
    background: #fff;
  }

  .captcha-check.is-confirming .captcha-check__input:checked::after {
    width: .95rem;
    height: .95rem;
    margin: 0;
    border: 2px solid #d5e0ec;
    border-top-color: #347db9;
    border-radius: 50%;
    animation: captcha-spin .55s linear infinite;
  }

  .captcha-check.is-confirming .captcha-check__prompt { display: inline; }
  .captcha-check.is-confirming .captcha-check__success { display: none; }

  @keyframes captcha-spin {
    to { transform: rotate(360deg); }
  }
}
