/* Своя проверка «Я не робот». Цвета берутся из темы страницы (магазин — тёмная, админка — светлая);
   текст на цвете акцента — --on-accent (белый или тёмный, подбирается по цветам магазина). */
.cap-hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cap {
  --cap-bg: var(--surface-2, #f6f5fb);
  --cap-bg-2: var(--surface-3, #eceaf5);
  --cap-line: var(--line-2, #dcd9e8);
  --cap-text: var(--text, #1b1830);
  --cap-muted: var(--muted, #6b6880);
  --cap-accent: var(--accent, #7c3aed);
  margin: 2px 0 18px;
  color: var(--cap-text);
}
.cap-start {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--cap-line); background: var(--cap-bg); color: var(--cap-text);
  font: inherit; font-weight: 700; text-align: left; cursor: pointer; transition: border-color .2s ease;
}
.cap-start:hover { border-color: var(--cap-accent); }
.cap-box {
  width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--cap-line);
  display: grid; place-items: center; color: transparent; transition: all .2s ease;
}
.cap-box svg { width: 16px; height: 16px; }
.cap-brand { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; color: var(--cap-muted); }
.cap-brand svg { width: 14px; height: 14px; }
.cap.open .cap-start { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }
.cap.passed .cap-start { cursor: default; border-color: #16a34a; }
.cap.passed .cap-box { background: #16a34a; border-color: #16a34a; color: #fff; }
.cap-panel { margin-top: 6px; border-radius: 16px; overflow: hidden; border: 1px solid var(--cap-line); background: var(--cap-bg); }
.cap-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  min-height: 54px; padding: 10px 14px; background: var(--cap-accent); color: var(--on-accent, #fff); font-weight: 700; line-height: 1.3;
}
.cap-strip { height: 34px; width: auto; padding: 3px 8px; border-radius: 10px; background: rgba(0, 0, 0, .28); }
.cap-stage { position: relative; width: 100%; overflow: hidden; background: #111; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.cap-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.cap-stage.tappable { cursor: crosshair; }
.cap-stage.wrong { animation: cap-wrong .5s ease; }
.cap-piece {
  position: absolute; transform: translate(-50%, -50%); cursor: grab; touch-action: none; z-index: 2;
  -webkit-user-drag: none; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .45)); transition: transform .12s ease;
}
.cap-piece.dragging { cursor: grabbing; transform: translate(-50%, -50%) scale(1.08); transition: none; }
.cap-dock {
  position: absolute; transform: translate(-50%, -50%); border-radius: 12px; z-index: 1; pointer-events: none;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); transition: opacity .2s ease;
}
.cap-dock.gone { opacity: 0; }
.cap-tag {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -55%); white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; background: rgba(12, 11, 28, .85); color: #fff; font-size: .7rem; font-weight: 700;
}
.cap-mark {
  position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; z-index: 2;
  display: grid; place-items: center; background: var(--cap-accent); color: var(--on-accent, #fff); font-weight: 800; font-size: .85rem;
  border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .45); pointer-events: none;
}
.cap-track {
  position: relative; height: 46px; margin: 10px 10px 0; border-radius: 999px; background: var(--cap-bg-2);
  border: 1px solid var(--cap-line); overflow: hidden;
}
.cap-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 22px; background: color-mix(in srgb, var(--cap-accent) 30%, transparent); }
.cap-track-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: .82rem; color: var(--cap-muted); pointer-events: none; }
.cap-handle {
  position: absolute; left: 2px; top: 2px; width: 40px; height: 40px; border-radius: 50%; border: 0; z-index: 1;
  background: var(--cap-accent); color: var(--on-accent, #fff); font-size: 1.2rem; font-weight: 800; cursor: grab; touch-action: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}
.cap-track.active .cap-handle { cursor: grabbing; }
.cap-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.cap-icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid var(--cap-line); background: transparent;
  color: var(--cap-text); font-size: 1.15rem; cursor: pointer;
}
.cap-icon-btn:hover { border-color: var(--cap-accent); }
.cap-link { border: 0; background: none; padding: 6px 4px; color: var(--cap-accent); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.cap-msg { font-size: .85rem; color: var(--cap-muted); }
.cap-msg.bad { color: #ef4444; }
.cap-wait { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 14px; font-size: .9rem; color: var(--cap-muted); }
.cap-wait.bad { color: #ef4444; }
.cap-wait.loading::after {
  content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--cap-line);
  border-top-color: var(--cap-accent); animation: cap-spin .8s linear infinite;
}
.cap-note { margin-top: 6px; font-size: .85rem; color: #ef4444; }
.cap.checking .cap-stage { opacity: .75; }
.cap.cap-shake .cap-start { animation: cap-shake .45s ease; border-color: #ef4444; }
@keyframes cap-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes cap-wrong { 30% { filter: brightness(.6) sepia(1) hue-rotate(-50deg) saturate(4); } }
@keyframes cap-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cap * { animation: none !important; transition: none !important; } }

/* Страница проверки (режим «атака») */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 460px; padding: 26px 22px; border-radius: 24px; background: var(--surface, #161530); border: 1px solid var(--line, #2a2750); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.gate-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; margin-bottom: 18px; }
.gate-brand img { height: 34px; width: auto; max-width: 150px; object-fit: contain; }
.gate-card h1 { font-size: 1.45rem; margin: 0 0 8px; }
.gate-card p { color: var(--muted, #a9a6c8); margin: 0 0 18px; }
