/* ==========================================================================
   HUMAN SECURITY CAPTCHA & ANTI-BOT DEFENSE STYLESHEET
   ========================================================================== */

.security-captcha-group {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 10px 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .security-captcha-group,
.contact-form-card .security-captcha-group {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

.aimi-lead-form .security-captcha-group,
.cap-lead-form .security-captcha-group {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="dark"] .aimi-lead-form .security-captcha-group,
[data-theme="dark"] .cap-lead-form .security-captcha-group {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

.security-captcha-group.captcha-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
  animation: vpCaptchaShake 0.4s ease;
}

@keyframes vpCaptchaShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.captcha-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.captcha-shield-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary-blue, #0052ff);
  text-transform: uppercase;
}

[data-theme="dark"] .captcha-shield-badge,
.contact-form-card .captcha-shield-badge {
  color: #38bdf8;
}

.captcha-shield-badge svg {
  color: inherit;
}

.captcha-desc {
  font-size: 0.72rem;
  color: var(--slate-400, #94a3b8);
  font-weight: 500;
}

.captcha-challenge-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.captcha-math-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 82, 255, 0.08);
  border: 1px solid rgba(0, 82, 255, 0.2);
  color: var(--primary-blue, #0052ff);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-heading, monospace);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  user-select: none;
  flex-shrink: 0;
}

[data-theme="dark"] .captcha-math-pill,
.contact-form-card .captcha-math-pill {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.3);
  color: #38bdf8;
}

.captcha-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.captcha-input {
  width: 100%;
  max-width: 140px;
  text-align: center;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  padding: 8px 12px !important;
  border-radius: 8px !important;
}

.captcha-refresh-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--slate-400, #94a3b8);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.captcha-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: rotate(45deg);
}

.aimi-lead-form .captcha-refresh-btn,
.cap-lead-form .captcha-refresh-btn {
  border-color: #cbd5e1;
  color: #64748b;
}

.aimi-lead-form .captcha-refresh-btn:hover,
.cap-lead-form .captcha-refresh-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.captcha-error-msg {
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 600;
  display: none;
  line-height: 1.35;
}

.captcha-error-msg.visible {
  display: block;
}

/* Chrome/Safari number arrows removal */
.captcha-input::-webkit-outer-spin-button,
.captcha-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.captcha-input[type=number] {
  -moz-appearance: textfield;
}
