.textbox-captcha-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 12px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.64);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.textbox-captcha-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.textbox-captcha-dialog {
  width: min(100%, 468px);
  box-sizing: border-box;
  padding: 22px 23px 24px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  background: #070707;
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  transform: translate3d(0, 8px, 0);
  transition: transform 180ms ease;
}

.textbox-captcha-overlay.is-open .textbox-captcha-dialog {
  transform: translate3d(0, 0, 0);
}

.textbox-captcha-header,
.textbox-captcha-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.textbox-captcha-title {
  margin: 0;
  color: #fff;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.textbox-captcha-close,
.textbox-captcha-refresh {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font: inherit;
  cursor: pointer;
}

.textbox-captcha-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -5px -7px -5px 0;
  font-size: 23px;
  font-weight: 300;
}

.textbox-captcha-refresh {
  padding: 0;
  font-size: 12px;
}

.textbox-captcha-close:hover,
.textbox-captcha-refresh:hover,
.textbox-captcha-close:focus-visible,
.textbox-captcha-refresh:focus-visible {
  color: #fff;
  outline: none;
}

.textbox-captcha-description {
  margin: 8px 0 18px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 13px;
  line-height: 1.5;
}

.textbox-captcha-toolbar {
  margin-bottom: 8px;
}

.textbox-captcha-label {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.textbox-captcha-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: #111;
}

.textbox-captcha-background,
.textbox-captcha-piece {
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
}

.textbox-captcha-background {
  inset: 0;
  width: 100%;
  height: 100%;
}

.textbox-captcha-piece {
  left: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.66));
  will-change: transform;
}

.textbox-captcha-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 5, 5, 0.78);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.textbox-captcha-stage.is-loading .textbox-captcha-status,
.textbox-captcha-stage.is-error .textbox-captcha-status,
.textbox-captcha-stage.is-verified .textbox-captcha-status {
  opacity: 1;
}

.textbox-captcha-stage.is-verified .textbox-captcha-status {
  background: rgba(5, 5, 5, 0.48);
  color: #9be0b4;
}

.textbox-captcha-stage.is-invalid {
  animation: textbox-captcha-shake 260ms ease;
}

.textbox-captcha-rail {
  --textbox-captcha-x: 0px;
  position: relative;
  width: 100%;
  height: 48px;
  margin-top: 12px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  touch-action: none;
}

.textbox-captcha-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--textbox-captcha-x) + 46px);
  background: rgba(255, 255, 255, 0.1);
}

.textbox-captcha-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
  pointer-events: none;
}

.textbox-captcha-thumb {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  background: #fff;
  color: #050505;
  transform: translate3d(var(--textbox-captcha-x), 0, 0);
  cursor: grab;
  font: inherit;
  font-size: 18px;
  touch-action: none;
}

.textbox-captcha-thumb:active {
  cursor: grabbing;
}

.textbox-captcha-thumb:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.textbox-captcha-rail.is-verified .textbox-captcha-thumb {
  background: #9be0b4;
}

@keyframes textbox-captcha-shake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  30% { transform: translate3d(-5px, 0, 0); }
  65% { transform: translate3d(4px, 0, 0); }
}

@media (max-width: 500px) {
  .textbox-captcha-dialog {
    width: 100%;
    padding: 19px 17px 20px;
  }

  .textbox-captcha-stage {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .textbox-captcha-overlay,
  .textbox-captcha-dialog,
  .textbox-captcha-status {
    transition-duration: 20ms;
  }

  .textbox-captcha-stage.is-invalid {
    animation-duration: 20ms;
  }
}
