.captcha-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.72);
}

.captcha-card {
    width: min(100%, 22rem);
    padding: 1.1rem 1.1rem 1.2rem;
    background: #131313;
    color: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.captcha-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.captcha-head h2 {
    margin: 0;
    font-family: "Google Sans", sans-serif;
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.captcha-close,
.captcha-refresh {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font: inherit;
}

.captcha-close {
    width: 2rem;
    height: 2rem;
    font-size: 1.4rem;
    line-height: 1;
}

.captcha-close:hover,
.captcha-refresh:hover {
    color: #fff;
}

.captcha-hint {
    margin: 0.35rem 0 0.85rem;
    color: #929292;
    font-size: 0.9rem;
}

.captcha-stage {
    position: relative;
    overflow: hidden;
    aspect-ratio: 310 / 155;
    line-height: 0;
    background: #272727;
    touch-action: none;
    user-select: none;
}

.captcha-stage:not(.is-ready) .captcha-bg,
.captcha-stage:not(.is-ready) .captcha-piece {
    display: none;
}

.captcha-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.captcha-stage.is-loading .captcha-loader {
    display: flex;
}

.captcha-spinner {
    width: 1.35rem;
    height: 1.35rem;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: #fff;
    border-radius: 50%;
    animation: captcha-spin 0.7s linear infinite;
}

@keyframes captcha-spin {
    to {
        transform: rotate(360deg);
    }
}

.captcha-bg,
.captcha-piece {
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.captcha-bg {
    width: 100%;
    height: auto;
}

.captcha-piece {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: auto;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.captcha-bar {
    position: relative;
    height: 2.75rem;
    margin-top: 0.75rem;
    background: #272727;
    touch-action: none;
}

.captcha-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: rgba(26, 185, 149, 0.35);
}

.captcha-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}

.captcha-knob {
    position: absolute;
    top: 0;
    left: 0;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    background: #ededed;
    color: #000;
    cursor: grab;
    touch-action: none;
}

.captcha-knob:active {
    cursor: grabbing;
}

.captcha-knob::before {
    content: "";
    display: block;
    width: 0.55rem;
    height: 0.55rem;
    margin: 0 auto;
    border-top: 2px solid #000;
    border-right: 2px solid #000;
    transform: rotate(45deg);
}

.captcha-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 1.5rem;
    margin-top: 0.7rem;
}

.captcha-error {
    margin: 0;
    color: #ffb4a2;
    font-size: 0.85rem;
}

.captcha-refresh {
    margin-left: auto;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.captcha-card.is-busy .captcha-knob {
    cursor: progress;
}

.captcha-card.is-matched .captcha-bar-fill {
    width: 100%;
    background: #1ab995;
}

body.captcha-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .captcha-spinner {
        animation: none;
        border-color: rgba(255, 255, 255, 0.55);
    }
}
