/* ── Captcha Window ─────────────────────────────────────────────────────────── */
.captcha-window {
  position: fixed;
  top: 280px;
  left: 12px;
  width: 272px;
  min-width: 0 !important;
  z-index: 80;
  user-select: none;
}

/* Always show as active/focused — captcha is outside the main focus system */
.captcha-window .win-header {
  background: var(--title-bg-active) !important;
  cursor: default !important;
  pointer-events: none;
}

/* Buttons inside header still need to be clickable */
.captcha-window .win-controls {
  pointer-events: auto;
}

/* Collapsed: hide body */
.captcha-window.collapsed .captcha-body {
  display: none !important;
}

/* Shake on wrong answer */
.captcha-window.shake {
  animation: cap-shake 0.45s ease;
}

@keyframes cap-shake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-10px); }
  35%  { transform: translateX(10px); }
  55%  { transform: translateX(-7px); }
  75%  { transform: translateX(7px); }
  90%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

/* Success collapse */
.captcha-window.verified {
  animation: cap-collapse 0.35s ease forwards;
  transform-origin: bottom left;
  pointer-events: none;
}

@keyframes cap-collapse {
  to { transform: scale(0.05); opacity: 0; }
}

/* Body — no win-body padding, full-bleed content */
.captcha-body {
  overflow: hidden;
  background: #fff;
}

/* ── reCAPTCHA blue header ──────────────────────────────────────────────────── */
.captcha-recap-header {
  background: #4285f4;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.captcha-recap-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  font-family: var(--font-family);
}

.captcha-select-label {
  font-size: 11px;
  opacity: 0.88;
  letter-spacing: 0.3px;
}

.captcha-recap-text strong {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.captcha-header-refresh {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.captcha-header-refresh:hover { color: #fff; }

/* ── 3×3 grid ───────────────────────────────────────────────────────────────── */
.captcha-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: #fff;
  padding: 2px;
}

.captcha-cell {
  aspect-ratio: 1;
  background-repeat: no-repeat;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: filter 0.1s;
}
.captcha-cell:hover { filter: brightness(0.92); }

/* Blue overlay on selected */
.captcha-cell.selected::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(66, 133, 244, 0.35);
  border: 3px solid #4285f4;
  z-index: 1;
  pointer-events: none;
}

/* Checkmark badge */
.captcha-cell.selected::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  background: #4285f4;
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  font-family: var(--font-family);
  z-index: 2;
  pointer-events: none;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.captcha-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
}

.captcha-footer-icons {
  display: flex;
  gap: 2px;
}

.captcha-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  padding: 3px 6px;
  line-height: 1;
  transition: color 0.12s;
}
.captcha-icon-btn:hover { color: #555; }

.captcha-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.captcha-error-text {
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 700;
  color: #d32f2f;
  white-space: nowrap;
}

.captcha-verify-btn {
  background: #4285f4;
  color: #fff;
  border: none;
  padding: 7px 18px;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s;
}
.captcha-verify-btn:hover { background: #3367d6; }
.captcha-verify-btn:active { background: #2a56c6; }

/* ── Success screen ─────────────────────────────────────────────────────────── */
.captcha-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px 24px;
  background: #fff;
  text-align: center;
}

.captcha-success-check {
  width: 52px;
  height: 52px;
  line-height: 52px;
  text-align: center;
  background: #4285f4;
  color: #fff;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 900;
}

.captcha-success-text {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.captcha-success-sub {
  font-family: var(--font-family);
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

.captcha-continue-btn {
  margin-top: 4px;
}
