/* gocaptcha.css — self-hosted vanilla widget for the go-captcha click challenge.
   Same-origin only; images arrive as data: URIs (CSP img-src 'self' data:). No
   external fonts/scripts. Styled to match the registration page (translucent dark). */

#gocaptcha-box { margin: 18px 0; }

.gc-wrap {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 14px;
  max-width: 100%;
}

.gc-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.gc-hint {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 10px;
  min-height: 1.1em;
}

/* The order/clue thumbnail issued by the server. */
.gc-thumb {
  display: block;
  margin-bottom: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  image-rendering: auto;
  max-width: 150px;
}

/* The master image the user clicks on. Position:relative anchors the click markers. */
.gc-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 100%;
}

/* Render the master image at its NATURAL size (300x220) so a display click maps 1:1 to a
   natural pixel — go-captcha's click box tolerance is small and any CSS scaling magnifies
   cursor error. On very narrow screens it may scale down via max-width; the JS click handler
   still corrects with naturalWidth/rect.width, and the server padding absorbs the remainder. */
.gc-stage img {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
  pointer-events: none;
}

/* Numbered click markers overlaid on the master image. */
.gc-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -12px;
  border-radius: 50%;
  background: rgba(255, 176, 30, 0.92);
  color: #2d2d2d;
  font-weight: 700;
  font-size: 13px;
  line-height: 24px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.gc-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.gc-btn {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}
.gc-btn:hover { background: rgba(255, 255, 255, 0.28); }

/* Status node is visually hidden — kept only as an ARIA live region for screen readers.
   No visible "not solved yet / verified" text (professional, quiet UI). */
.gc-status {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Visual-only solve/error feedback, applied as a class on .gc-wrap.
   Success: green frame + a ✓ badge. Error: brief red frame flash. */
.gc-wrap.gc-ok .gc-stage  { border-color: #28a745; box-shadow: 0 0 0 2px rgba(40,167,69,0.5); }
.gc-wrap.gc-ok .gc-stage::after {
  content: "✓";
  position: absolute;
  top: 6px; right: 8px;
  width: 26px; height: 26px;
  line-height: 26px; text-align: center;
  border-radius: 50%;
  background: #28a745; color: #fff;
  font-weight: 700; font-size: 1rem;
  z-index: 5;
}
.gc-wrap.gc-bad .gc-stage { animation: gc-shake 0.3s; border-color: #e74c3c; }
@keyframes gc-shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.gc-loading { opacity: 0.7; }

/* ── 5-mode additions (2026-06-24): slide tile + rotate slider ── */
/* IMPORTANT: override `.gc-stage img { pointer-events: none }` (which is more specific than
   a bare `.gc-tile`) — the draggable puzzle tile is ALSO an <img> inside .gc-stage, so without
   this it would inherit pointer-events:none and the user could never grab it. */
.gc-stage img.gc-tile,
.gc-tile {
  position: absolute;
  cursor: grab;
  z-index: 5;
  touch-action: none;
  pointer-events: auto;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}
.gc-tile:active { cursor: grabbing; }

/* Rotate mode: the inner round piece overlaid on the background ring. It is rotated by the
   slider; it must NOT swallow pointer events (the slider drives it). Round-clipped so it reads
   as a disc sitting in the hole. Overrides .gc-stage img{pointer-events:none} harmlessly. */
.gc-stage img.gc-rotor,
.gc-rotor {
  position: absolute;
  z-index: 4;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.05s linear;
}

/* slide stage should not use crosshair cursor */
.gc-wrap[data-mode^="slide"] .gc-stage,
.gc-wrap[data-mode="rotate"] .gc-stage { cursor: default; }

.gc-controls { margin-top: 10px; }
.gc-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.gc-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.25);
  outline: none;
}
.gc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid rgba(0,0,0,0.2);
}
.gc-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid rgba(0,0,0,0.2);
}
.gc-slider-label {
  min-width: 42px;
  text-align: right;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
