.altcha {
  background: var(--altcha-color-base, transparent);
  border: var(--altcha-border-width, 1px) solid
    var(--altcha-color-border, #a0a0a0);
  border-radius: var(--altcha-border-radius, 3px);
  color: var(--altcha-color-text, currentColor);
  display: flex;
  flex-direction: column;
  max-width: var(--altcha-max-width, 260px);
  position: relative;
}

.altcha:focus-within {
  border-color: var(--altcha-color-border-focus, currentColor);
}

.altcha[data-floating] {
  background: var(--altcha-color-base, white);
  display: none;
  filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.2));
  left: -100%;
  position: fixed;
  top: -100%;
  width: var(--altcha-max-width, 260px);
  z-index: 999999;
}

.altcha[data-floating="top"] .altcha-anchor-arrow {
  border-bottom-color: transparent;
  border-top-color: var(--altcha-color-border, #a0a0a0);
  bottom: -12px;
  top: auto;
}

.altcha[data-floating="bottom"]:focus-within::after {
  border-bottom-color: var(--altcha-color-border-focus, currentColor);
}

.altcha[data-floating="top"]:focus-within::after {
  border-top-color: var(--altcha-color-border-focus, currentColor);
}

.altcha[data-floating]:not([data-state="unverified"]) {
  display: block;
}

.altcha-anchor-arrow {
  border: 6px solid transparent;
  border-bottom-color: var(--altcha-color-border, #a0a0a0);
  content: '';
  height: 0;
  left: 12px;
  position: absolute;
  top: -12px;
  width: 0;
}

.altcha-main {
  align-items: center;
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem;
  position: relative;
}

.altcha-code-challenge {
  background: var(--altcha-color-base, white);
  border: 1px solid var(--altcha-color-border-focus, currentColor);
  border-radius: var(--altcha-border-radius, 3px);
  filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.2));
  padding: 0.5rem;
  position: absolute;
  top: 2.5rem;
  z-index: 9999999;
}

.altcha-code-challenge > form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.altcha-code-challenge-input {
  border: 1px solid currentColor;
  border-radius: 3px;
  box-sizing: border-box;
  outline: none;
  font-size: 16px;
  padding: 0.35rem;
  width: 220px;
}

.altcha-code-challenge-input:focus {
  outline: 2px solid color-mix(in srgb, var(--altcha-color-active, #1D1DC9) 20%, transparent);
}

.altcha-code-challenge-input:disabled {
  opacity: 0.7;
}

.altcha-code-challenge-image {
  background-color: white;
  border: 1px solid currentColor;
  border-radius: 3px;
  box-sizing: border-box;
  object-fit: contain;
  height: 50px;
  width: 220px;
}

.altcha-code-challenge-audio,
.altcha-code-challenge-reload {
  background: color-mix(in srgb, var(--altcha-color-text, currentColor) 10%, transparent);
  border: 0;
  border-radius: 3px;
  color: var(--altcha-color-text, currentColor);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
}

.altcha-code-challenge-audio:disabled,
.altcha-code-challenge-reload:disabled {
  opacity: 0.7;
  pointer-events: none;
}

.altcha-code-challenge-audio > *,
.altcha-code-challenge-reload > * {
  height: 20px;
  width: 20px;
}

.altcha-code-challenge-buttons {
  display: flex;
  justify-content: space-between;
}

.altcha-code-challenge-buttons-left {
  display: flex;
  gap: 0.25rem;
}

.altcha-code-challenge-verify {
  align-items: center;
  background: var(--altcha-color-active, #1D1DC9);
  border: 0;
  border-radius: 3px;
  color: white;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  font-size: 100%;
  padding: 0.35rem 1rem;
}

.altcha-code-challenge-verify:disabled {
  opacity: 0.7;
  pointer-events: none;
}

.altcha-code-challenge-arrow {
  border: 6px solid transparent;
  border-bottom-color: var(--altcha-color-border, currentColor);
  content: '';
  height: 0;
  left: 0.15rem;
  position: absolute;
  top: -12px;
  width: 0;
}

.altcha[data-floating="top"] .altcha-code-challenge {
  top: -150px;
}

.altcha[data-floating="top"] .altcha-code-challenge-arrow {
  border-bottom-color: transparent;
  border-top-color: var(--altcha-color-border, currentColor);
  bottom: -12px;
  top: auto;
}

.altcha-label {
  cursor: pointer;
  flex-grow: 1;
}

.altcha-logo {
  color: currentColor !important;
  opacity: 0.7;
}

.altcha-logo:hover {
  opacity: 1;
}

.altcha-error {
  color: var(--altcha-color-error-text, #f23939);
  display: flex;
  font-size: 0.85rem;
  gap: 0.3rem;
  padding: 0 0.7rem 0.7rem;
}

.altcha-footer {
  align-items: center;
  background-color: var(--altcha-color-footer-bg, transparent);
  display: flex;
  font-size: 0.75rem;
  opacity: 0.7;
  justify-content: end;
  padding: 0.2rem 0.7rem;
}

.altcha-footer:hover {
  opacity: 1;
}

.altcha-footer a {
  color: currentColor;
}

.altcha-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  position: relative;
  width: 24px;
}

.altcha-checkbox .altcha-spinner {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.altcha-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.altcha-checkbox-verifying input {
  appearance: none;
  opacity: 0;
  pointer-events: none;
}

.altcha-spinner {
  animation: altcha-spinner 0.75s infinite linear;
  transform-origin: center;
}

.altcha-overlay {
  --altcha-color-base: #fff;
  --altcha-color-text: #000;

  animation: overlay-slidein 0.5s forwards;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  left: 50%;
  width: 260px;
  opacity: 0;
  position: fixed;
  top: 45%;
  transform: translate(-50%, -50%);
}

.altcha-overlay-backdrop {
  background: rgba(0, 0, 0, 0.5);
  bottom: 0;
  display: none;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 99999999;
}

.altcha-overlay-close-button {
  align-self: flex-end;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: currentColor;
  font-size: 130%;
  line-height: 1;
  opacity: 0.7;
}

@media (max-height: 450px) {
  .altcha-overlay {
    top: 10% !important;
    transform: translate(-50%, 0);
  }
}

@keyframes overlay-slidein {
  100% {
    opacity: 1;
    top: 50%;
  }
}

@keyframes altcha-spinner {
  100% {
    transform: rotate(360deg);
  }
}