:root {
  color-scheme: dark;
  --bg: #0e1117;
  --panel: #151a22;
  --panel-2: #10151d;
  --border: #2a3341;
  --text: #f1f5f9;
  --muted: #a7b0c0;
  --accent: #2cd4b3;
  --accent-strong: #22c55e;
  --danger: #ff4d5e;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

[data-custom-captcha] {
  display: grid;
  justify-items: center;
  width: 100%;
}

.captcha-box,
.captcha-box * {
  box-sizing: border-box;
}

.captcha-box button,
.captcha-box input {
  font: inherit;
}

.demo-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.demo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.score-panel,
.demo-card {
  border: 1px solid var(--border);
  background: rgba(16, 21, 29, 0.96);
  box-shadow: var(--shadow);
}

.score-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 8px;
}

.score-panel label {
  color: var(--muted);
  font-size: 0.92rem;
}

.score-panel input {
  grid-column: 1 / -1;
  accent-color: var(--accent);
}

.score-panel strong {
  color: var(--accent);
  font-size: 1.6rem;
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.demo-card {
  padding: 20px;
  border-radius: 8px;
}

.card-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.card-heading span {
  color: var(--accent);
  font-weight: 800;
}

.card-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.metadata-preview {
  max-height: 460px;
  margin: 0;
  overflow: auto;
  color: #d6deeb;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.captcha-box {
  width: 100%;
  margin-inline: auto;
  padding: 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  overflow: visible;
  box-shadow: none;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.captcha-title {
  display: none;
}

.captcha-title strong {
  display: block;
  font-size: 1.12rem;
}

.captcha-title span {
  color: var(--muted);
  font-size: 0.86rem;
}

.captcha-form {
  display: grid;
  gap: 8px;
}

.captcha-check {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid rgba(125, 231, 235, 0.24);
  border-radius: 12px;
  background:
    radial-gradient(circle at 9% 12%, rgba(44, 212, 179, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(18, 24, 33, 0.98), rgba(12, 16, 23, 0.96));
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.captcha-check:hover {
  border-color: rgba(44, 212, 179, 0.55);
  box-shadow: 0 10px 26px rgba(44, 212, 179, 0.08);
}

.captcha-check input {
  position: relative;
  width: 38px;
  height: 38px;
  margin: 0;
  appearance: none;
  border: 2px solid rgba(167, 176, 192, 0.7);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(10, 14, 20, 0.62);
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.captcha-check input:hover {
  border-color: rgba(44, 212, 179, 0.86);
  box-shadow:
    0 0 0 4px rgba(44, 212, 179, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.captcha-check input:focus-visible {
  outline: 2px solid rgba(44, 212, 179, 0.85);
  outline-offset: 3px;
}

.captcha-check input:checked {
  border-color: var(--accent);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.24), transparent 34%),
    linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow:
    0 0 0 5px rgba(44, 212, 179, 0.13),
    0 10px 22px rgba(44, 212, 179, 0.2);
  animation: captcha-box-pop 260ms cubic-bezier(0.2, 1.8, 0.35, 1);
}

.captcha-check input:checked::after {
  display: block;
  width: 10px;
  height: 18px;
  margin: 5px 0 0 12px;
  border: solid #05110f;
  border-width: 0 4px 4px 0;
  content: "";
  animation: captcha-check-pop 220ms ease-out 80ms both;
  transform: rotate(45deg);
}

.captcha-check span {
  color: #eef6ff;
  font-size: 0.95rem;
}

.captcha-check-text {
  min-width: 0;
  padding-left: 0;
}

.captcha-brand {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-self: end;
  padding: 5px 7px;
  border: 1px solid rgba(125, 231, 235, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(220, 235, 255, 0.74) !important;
  font-size: 0.72rem !important;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.captcha-brand-mark {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 0 3px rgba(44, 212, 179, 0.1);
}

.captcha-brand-mark::after {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 9px;
  border: solid #05110f;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.math-question {
  padding: 16px 14px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 21, 29, 0.96);
  font-size: 1.45rem;
  font-weight: 800;
}

.captcha-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: rgba(10, 14, 20, 0.48);
  color: var(--text);
}

.captcha-input:focus {
  border-color: var(--accent);
}

.slider-track {
  position: relative;
  height: 48px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.58);
}

.slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(44, 212, 179, 0.3), rgba(34, 197, 94, 0.5));
  pointer-events: none;
}

.slider-control {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.slider-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #05110f;
  font-size: 1.3rem;
  font-weight: 900;
  pointer-events: none;
  transition: transform 120ms ease;
}

.captcha-button {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #8be8ee 0%, #42d5df 48%, #2cb9c8 100%);
  color: #061018;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(44, 212, 179, 0.18);
  transition:
    box-shadow 180ms ease,
    filter 180ms ease,
  transform 180ms ease;
}

.captcha-box[data-mode="checkbox"] .captcha-button {
  display: none !important;
}

.captcha-button:hover {
  box-shadow: 0 16px 34px rgba(44, 212, 179, 0.26);
  filter: saturate(1.08);
  transform: translateY(-1px);
}

.captcha-button:active {
  transform: translateY(0);
}

.captcha-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.75);
  opacity: 0.55;
}

.captcha-message {
  min-height: 0;
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.captcha-form > .captcha-message:last-child {
  padding: 0 2px;
  background: transparent;
}

.captcha-form > .captcha-message:first-child {
  padding: 0 2px;
}

.captcha-message.success {
  color: var(--accent-strong);
  font-weight: 700;
}

.captcha-message.error {
  color: var(--danger);
}

@keyframes captcha-check-pop {
  from {
    opacity: 0;
    transform: rotate(45deg) scale(0.45) translate(-4px, 4px);
  }

  to {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }
}

@keyframes captcha-box-pop {
  0% {
    transform: scale(0.9);
  }

  62% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 860px) {
  .demo-hero,
  .demo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .demo-shell {
    width: min(100% - 20px, 1180px);
    padding: 28px 0;
  }

  .captcha-box,
  .demo-card {
    padding: 6px;
  }
}

@media (max-width: 390px) {
  .captcha-check {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .captcha-brand {
    grid-column: 2;
    justify-self: start;
  }
}
