/* Slider captcha — shown only to "grey zone" visitors. Same palette as the
   site (#0C0F12 page, #14181B card, #202427 borders, #2E70C9 accent).

   Everything tinted uses one animatable accent variable, so the whole widget
   glides from blue to green on success instead of snapping (gradients can't be
   transitioned; a registered <color> custom property can). */

@property --ab-accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #2e70c9;
}
@property --ab-accent-deep {
  syntax: '<color>';
  inherits: true;
  initial-value: #004bb1;
}

.ab-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(12, 15, 18, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ab-overlay.ab-in {
  opacity: 1;
}
.ab-overlay.ab-out {
  opacity: 0;
}

.ab-card {
  --ab-accent: #2e70c9;
  --ab-accent-deep: #004bb1;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, #171b1f 0%, #12161a 100%);
  border: 1px solid #232830;
  border-radius: 20px;
  padding: 32px 26px 22px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 0 color-mix(in srgb, var(--ab-accent) 0%, transparent);
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  transition:
    --ab-accent 0.6s ease,
    --ab-accent-deep 0.6s ease,
    transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.3s ease,
    box-shadow 0.6s ease,
    border-color 0.6s ease;
}
.ab-overlay.ab-in .ab-card {
  transform: none;
  opacity: 1;
}
.ab-overlay.ab-out .ab-card {
  transform: translateY(10px) scale(0.985);
  opacity: 0;
}

.ab-glyph {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: #0c0f12;
  border: 1px solid #202427;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ab-glyph svg {
  width: 24px;
  height: auto;
}
.ab-title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.ab-sub {
  margin: 0 0 24px;
  color: #9da1a6;
  font-size: 14px;
  line-height: 20px;
}

/* Track ------------------------------------------------------------------ */
.ab-track {
  position: relative;
  height: 56px;
  border-radius: 999px;
  background: #0b0e11;
  border: 1px solid #1e2328;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ab-slot {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 999px;
  border: 1.5px dashed color-mix(in srgb, var(--ab-accent) 90%, transparent);
  background: color-mix(in srgb, var(--ab-accent) 14%, transparent);
  pointer-events: none;
  animation: ab-pulse 1.8s ease-in-out infinite;
}
@keyframes ab-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ab-accent) 0%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ab-accent) 16%, transparent); }
}

/* Until first touch the handle nudges right to hint the gesture (no text in
   the track — it would collide with the slot). Inline transform takes over
   once the user grabs it. */
.ab-card:not(.ab-touched) .ab-handle {
  animation: ab-nudge 1.6s ease-in-out infinite;
}
@keyframes ab-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

.ab-handle {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background-color: var(--ab-accent);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(0, 0, 0, 0.22) 100%);
  color: #fff;
  cursor: grab;
  outline: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ab-accent) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: box-shadow 0.3s ease;
}
/* Arrow ⇄ check cross-fade instead of swapping markup. */
.ab-handle svg {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.22, 1.25, 0.36, 1);
}
.ab-handle .ab-ico-check {
  opacity: 0;
  transform: scale(0.4) rotate(-60deg);
}
.ab-card.ab-ok .ab-handle .ab-ico-arrow {
  opacity: 0;
  transform: scale(0.4) rotate(60deg);
}
.ab-card.ab-ok .ab-handle .ab-ico-check {
  opacity: 1;
  transform: none;
}
/* Spring-like settle when released (snap into the slot or roll back). */
.ab-handle.ab-settle {
  transition: left 0.55s cubic-bezier(0.22, 1.25, 0.36, 1), box-shadow 0.3s ease;
}
.ab-card.ab-grabbing .ab-handle {
  cursor: grabbing;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--ab-accent) 60%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.ab-card.ab-grabbing .ab-handle .ab-ico-arrow {
  transform: scale(1.12);
}
.ab-handle:focus-visible {
  box-shadow: 0 0 0 2px #12161a, 0 0 0 4px var(--ab-accent);
}

/* Attempts + feedback ----------------------------------------------------- */
.ab-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
}
.ab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #262c33;
  transition: background 0.3s ease, transform 0.3s ease;
}
.ab-dot.ab-dot-current {
  background: var(--ab-accent);
  transform: scale(1.25);
}
.ab-dot.ab-dot-used {
  background: #c24b4b;
}
.ab-hint {
  margin: 10px 0 0;
  color: #7c8288;
  font-size: 13px;
  min-height: 18px;
  line-height: 18px;
  transition: color 0.4s ease;
}
.ab-hint.ab-swap {
  animation: ab-fade-in 0.35s ease;
}
@keyframes ab-fade-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.ab-skip {
  margin-top: 4px;
  background: none;
  border: none;
  color: #6b7178;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.ab-skip:hover {
  color: #8f9296;
}

/* States ------------------------------------------------------------------ */
.ab-card.ab-busy .ab-handle {
  pointer-events: none;
}
.ab-card.ab-error .ab-hint {
  color: #e0a420;
}
.ab-card.ab-shake {
  animation: ab-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes ab-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* Success: the accent variable glides to green and everything follows. */
.ab-card.ab-ok {
  --ab-accent: #2fa96a;
  --ab-accent-deep: #1f8a55;
  border-color: color-mix(in srgb, var(--ab-accent) 55%, transparent);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 4px color-mix(in srgb, var(--ab-accent) 12%, transparent);
}
.ab-card.ab-ok .ab-slot {
  animation: ab-pulse-settle 0.6s ease forwards;
}
@keyframes ab-pulse-settle {
  from { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ab-accent) 16%, transparent); }
  to { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ab-accent) 0%, transparent); }
}
.ab-card.ab-ok .ab-handle {
  animation: ab-pop 0.5s cubic-bezier(0.22, 1.25, 0.36, 1) 0.15s;
}
@keyframes ab-pop {
  0%, 100% { scale: 1; }
  45% { scale: 1.1; }
}
.ab-card.ab-ok .ab-hint {
  color: var(--ab-accent);
}
.ab-card.ab-ok .ab-skip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .ab-overlay, .ab-card, .ab-handle, .ab-handle svg, .ab-handle.ab-settle, .ab-dot, .ab-hint { transition: none; }
  .ab-slot, .ab-card:not(.ab-touched) .ab-handle, .ab-card.ab-shake, .ab-card.ab-ok .ab-handle, .ab-hint.ab-swap { animation: none; }
}
