:root {
  color-scheme: dark;
  --blue: #3d8fe3;
  --blue-strong: #2477cf;
  --ink: #102334;
  --muted: #718493;
  --accent: #49d7bd;
  --danger: #c93434;
  font-family: Arial, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; color: #f6fbff; background: radial-gradient(circle at 16% 22%, rgba(40,166,146,.2), transparent 30rem), radial-gradient(circle at 86% 80%, rgba(61,143,227,.22), transparent 34rem), #06131f; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.page-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.demo-card { width: min(100%, 560px); padding: 30px 34px 22px; border: 1px solid rgba(191,222,235,.16); border-radius: 26px; background: linear-gradient(145deg, rgba(15,39,57,.97), rgba(7,25,38,.96)); box-shadow: 0 34px 90px rgba(0,0,0,.44); }
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #062720; background: var(--accent); font-weight: 900; }
.eyebrow { color: #bfd0db; font-size: .82rem; font-weight: 800; letter-spacing: .06em; }
.nav-link { margin-inline-start: auto; color: var(--accent); font-size: .78rem; font-weight: 800; text-decoration: none; }
.copy-block { margin-bottom: 25px; }
.step { margin: 0 0 7px; color: var(--accent); font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.1rem); letter-spacing: -.04em; }
.copy-block > p:last-child { margin: 12px 0 0; color: #9eb2c0; line-height: 1.6; }

.human-gate { width: 100%; min-height: 106px; display: grid; grid-template-columns: 58px 1fr 72px; gap: 16px; align-items: center; padding: 15px 18px; border: 1px solid #cbd2d7; border-radius: 5px; direction: rtl; color: var(--ink); background: #f8f9fa; box-shadow: 0 7px 22px rgba(0,0,0,.2); cursor: pointer; text-align: right; transition: transform .16s ease, box-shadow .16s ease; }
.human-gate:hover { transform: translateY(-1px); box-shadow: 0 11px 30px rgba(0,0,0,.28); }
.gate-check { position: relative; display: block; width: 42px; height: 42px; border: 3px solid #7f8c94; border-radius: 4px; background: white; }
.human-gate.loading .gate-check { border-color: transparent; border-radius: 50%; border-top-color: var(--blue); animation: spin .8s linear infinite; }
.human-gate.verified .gate-check { display: grid; place-items: center; border-color: #21a96f; border-radius: 50%; color: white; background: #21a96f; }
.human-gate.verified .gate-check::after { content: "✓"; font-size: 1.65rem; font-weight: 900; }
.gate-copy { display: grid; gap: 6px; }
.gate-copy strong { font-size: 1.2rem; }
.gate-copy small { color: #637580; font-size: .76rem; }
.gate-brand { display: grid; place-items: center; color: #4b606d; }
.gate-brand b { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: white; background: linear-gradient(145deg, var(--blue), #52cdb7); font-size: 1.35rem; }
.gate-brand small { margin-top: 4px; font-size: .55rem; font-weight: 900; letter-spacing: .08em; }
.gate-status { min-height: 22px; margin: 9px 2px 0; color: #ffaaa4; font-size: .82rem; font-weight: 700; }
.restart-button { padding: 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-weight: 800; }

.challenge-dialog { width: min(calc(100% - 24px), 430px); max-height: calc(100dvh - 24px); margin: auto; padding: 0; overflow: auto; border: 0; border-radius: 5px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.challenge-dialog::backdrop { background: rgba(2,12,20,.72); backdrop-filter: blur(4px); }
.close-dialog { position: absolute; z-index: 8; top: 8px; left: 8px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: white; background: rgba(7,45,83,.26); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.challenge-header { min-height: 130px; display: flex; flex-direction: column; justify-content: center; padding: 23px 28px 21px; color: white; background: linear-gradient(145deg, #4b9ae8, #377fd0); text-align: right; }
.challenge-header span { font-size: 1rem; font-weight: 700; }
.challenge-header h2 { margin: 1px 0 3px; color: white; font-size: 2rem; line-height: 1.05; letter-spacing: -.035em; }
.challenge-header small { font-size: .82rem; opacity: .92; }
#captcha-form { margin: 0; }
.captcha-frame { position: relative; display: grid; width: 100%; overflow: hidden; place-items: center; border-block: 4px solid white; background: #e8eef2; }
.captcha-frame[data-type="image"] { aspect-ratio: 1; }
.captcha-frame[data-type="text"] { min-height: 142px; padding: 12px; }
.captcha-frame img { display: block; width: 100%; height: auto; }
.captcha-frame[data-type="image"] img { height: 100%; object-fit: cover; }
.tile-grid { position: absolute; z-index: 2; inset: 0; display: grid; grid-template-columns: repeat(3,1fr); direction: ltr; }
.tile-grid button { position: relative; min-width: 0; padding: 0; border: 1.5px solid rgba(255,255,255,.9); background: transparent; cursor: pointer; }
.tile-grid button::before { position: absolute; inset: 4px; content: ""; border: 4px solid transparent; }
.tile-grid button.selected::before { border-color: #168bea; background: rgba(22,139,234,.15); box-shadow: inset 0 0 0 2px white; }
.tile-grid button.selected::after { position: absolute; top: 8px; right: 8px; display: grid; width: 25px; height: 25px; place-items: center; content: "✓"; border-radius: 50%; color: white; background: #168bea; box-shadow: 0 2px 8px rgba(0,0,0,.3); font-weight: 900; }
.image-skeleton { position: absolute; z-index: 3; inset: 0; background: linear-gradient(100deg,#dfe6eb 30%,#f7fafc 48%,#dfe6eb 66%); background-size: 230% 100%; animation: shimmer 1.15s linear infinite; }
.captcha-frame:not([aria-busy="true"]) .image-skeleton { display: none; }
.text-answer { padding: 14px 18px 4px; }
.text-answer label { display: block; margin-bottom: 7px; color: #344b59; font-weight: 900; }
.text-answer input { width: 100%; padding: 12px; border: 1px solid #b8c6ce; border-radius: 6px; outline: 0; direction: ltr; color: #162c39; background: #f7fafc; font-size: 1.15rem; font-weight: 900; letter-spacing: .2em; text-align: center; text-transform: uppercase; }
.text-answer input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61,143,227,.18); }
.info-panel { margin: 8px 16px 0; padding: 10px 12px; border-right: 3px solid var(--blue); color: #506773; background: #edf5fb; font-size: .75rem; line-height: 1.5; }
.status { min-height: 18px; margin: 7px 16px 0; color: var(--danger); font-size: .78rem; font-weight: 800; }
.challenge-toolbar { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 14px 15px; border-top: 1px solid #e0e5e8; direction: ltr; }
.tool-buttons { display: flex; gap: 2px; }
.tool-button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; color: #5c6970; background: transparent; cursor: pointer; font-size: 1.35rem; }
.tool-button:hover { color: var(--blue); background: #edf5fc; }
.mode-button { justify-self: start; padding: 8px 7px; border: 0; color: #56717f; background: transparent; cursor: pointer; font-size: .74rem; font-weight: 800; }
.verify-button { min-width: 95px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 3px; color: white; background: var(--blue); cursor: pointer; font-weight: 900; }
.verify-button:hover { background: var(--blue-strong); }
button:focus-visible { outline: 3px solid #142a38; outline-offset: 3px; }
button:disabled, input:disabled { cursor: wait; opacity: .55; }
footer { margin-top: 24px; color: #718695; font-size: .72rem; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (max-width: 520px) {
  .page-shell { align-items: start; padding: 12px; }
  .demo-card { padding: 23px 18px 18px; border-radius: 20px; }
  .eyebrow { display: none; }
  .human-gate { min-height: 96px; grid-template-columns: 50px 1fr 58px; gap: 9px; padding: 12px; }
  .gate-copy strong { font-size: 1.05rem; }
  .challenge-header { min-height: 116px; padding: 20px 22px 17px; }
  .challenge-header h2 { font-size: 1.7rem; }
  .challenge-toolbar { gap: 3px; padding-inline: 8px; }
  .tool-button { width: 36px; }
  .verify-button { min-width: 82px; padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; } }
