.captcha-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 32, 43, 0.28);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.captcha-overlay.open {
  opacity: 1;
  visibility: visible;
}

.captcha-overlay.hidden {
  display: flex;
}

.captcha-modal {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid #dce5ea;
  border-radius: 8px;
  padding: 28px 24px 24px;
  position: relative;
  box-shadow: 0 24px 80px rgba(20, 32, 43, 0.18);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s ease;
}

.captcha-overlay.open .captcha-modal {
  transform: scale(1) translateY(0);
}

.captcha-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #eef4f6;
  color: #607080;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.captcha-close:hover {
  background: #dbeafe;
  color: #2563eb;
}

.captcha-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
  color: #14202b;
}

.captcha-sub {
  font-size: 0.85rem;
  color: #607080;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.4;
}

.captcha-box {
  background: #f8fbff;
  border: 1px solid #d6e3ee;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 20px;
  position: relative;
  min-height: 74px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.captcha-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.captcha-check-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.captcha-check-ui {
  width: 28px;
  height: 28px;
  border: 2px solid #c1c1c1;
  border-radius: 3px;
  background: #fff;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}

.captcha-check-row input:checked + .captcha-check-ui {
  border-color: #0f9f7a;
  background: #0f9f7a;
}

.captcha-check-row input:checked + .captcha-check-ui::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.captcha-check-row input:disabled + .captcha-check-ui {
  opacity: 0.5;
  cursor: wait;
}

.captcha-check-label {
  font-size: 0.95rem;
  color: #222;
  font-weight: 500;
  font-family: Arial, sans-serif;
}

.captcha-brand {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.55;
}

.captcha-brand span {
  font-size: 1.2rem;
}

.captcha-brand small {
  font-size: 0.55rem;
  color: #555;
  font-family: Arial, sans-serif;
  letter-spacing: 0.3px;
}

.captcha-verifying {
  position: absolute;
  inset: 0;
  background: rgba(249, 249, 249, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: #333;
}

.captcha-verifying.hidden,
.captcha-done.hidden {
  display: none;
}

.captcha-mini-spin {
  width: 22px;
  height: 22px;
  border: 2px solid #ddd;
  border-top-color: #4285f4;
  border-radius: 50%;
  animation: captchaSpin 0.7s linear infinite;
}

@keyframes captchaSpin {
  to { transform: rotate(360deg); }
}

.captcha-done {
  position: absolute;
  inset: 0;
  background: rgba(249, 249, 249, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #16a34a;
}

.captcha-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.captcha-submit {
  width: 100%;
  margin-top: 4px;
}

.captcha-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.captcha-error {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #f87171;
  text-align: center;
}

.captcha-error.hidden {
  display: none;
}
