/* aimess Spam-Guard Captcha, im Markenstil (eckig, Blau #009FE3) */

.aimess-captcha {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #023C55;
  border-radius: 0;            /* eckig, wie das uebrige UI */
  background: #fff;
  color: #333;
  font: 400 15px/1.2 "Roboto", "Liberation Sans", Arial, sans-serif;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease;
}

.aimess-captcha:hover { border-color: #009FE3; }
.aimess-captcha:focus-visible { outline: 2px solid #009FE3; outline-offset: 2px; }

.aimess-captcha__box {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid #023C55;
  border-radius: 0;
  background: #fff;
}

/* Ladezustand: rotierender Balken */
.aimess-captcha[data-state="working"] { cursor: progress; }
.aimess-captcha[data-state="working"] .aimess-captcha__box {
  border-color: #009FE3;
  border-top-color: transparent;
  border-radius: 50%;          /* einziger runder Moment: der Spinner */
  animation: aimess-spin .7s linear infinite;
}

/* Erfolg: blaues Feld mit weissem Haken */
.aimess-captcha[data-state="done"] { border-color: #009FE3; cursor: default; }
.aimess-captcha[data-state="done"] .aimess-captcha__box {
  background: #009FE3;
  border-color: #009FE3;
}
.aimess-captcha[data-state="done"] .aimess-captcha__box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Fehler */
.aimess-captcha[data-state="error"] { border-color: #B0191E; }
.aimess-captcha[data-state="error"] .aimess-captcha__label { color: #B0191E; }

.aimess-captcha__label { white-space: nowrap; }

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

@media (prefers-reduced-motion: reduce) {
  .aimess-captcha[data-state="working"] .aimess-captcha__box { animation: none; }
}
