/* ====== FERIK CAPTCHA (Cloudflare Turnstile style) ====== */

.captcha {
    margin: 18px 0;
}

.captcha__box {
    position: relative;
    max-width: 340px;
    width: 100%;
    border: 1px solid var(--border, #2a2d3a);
    border-radius: 10px;
    background: var(--card, #171923);
    color: var(--text, #e8eaf2);
    padding: 12px 14px;
    min-height: 58px;
    box-sizing: border-box;
    transition: border-color .2s;
    overflow: hidden;
}

.captcha__box:hover,
.captcha__box:focus-visible {
    border-color: #5a7bff;
    outline: none;
}

.captcha__state {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    min-height: 32px;
}

.captcha__label {
    font-size: 13px;
    flex: 1;
}

.captcha__brand {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--muted, #8b91a8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.captcha__brand-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f3801e;
    display: inline-block;
}

.captcha__icon--shield {
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 50%;
    border: 2px solid #8b91a8;
    position: relative;
}
.captcha__icon--shield::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border-top: 2px solid #8b91a8;
}

.captcha__icon--check {
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 50%;
    background: #22c55e;
    position: relative;
}
.captcha__icon--check::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* ---- puzzle panel ---- */
.captcha__puzzle {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.captcha__hidden {
    display: none !important;
}

.captcha canvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
}

.captcha__track {
    position: relative;
    height: 40px;
    border-radius: 8px;
    background: #0f1117;
    border: 1px solid #2a2d3a;
    overflow: hidden;
}

.captcha__fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(90, 123, 255, .18);
    pointer-events: none;
}

.captcha__thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #5a7bff;
    cursor: grab;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.captcha__thumb::after {
    content: '→';
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.captcha__thumb:active {
    cursor: grabbing;
}

.captcha__hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #8b91a8;
    pointer-events: none;
    transition: opacity .2s;
}

.captcha__refresh {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(15, 17, 23, .75);
    color: #e8eaf2;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    z-index: 2;
}

.captcha__refresh:hover {
    background: #5a7bff;
}

.captcha__ok {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    font-size: 13px;
    color: #b7f0cd;
}

.captcha__shake {
    animation: captcha-shake .4s;
}

@keyframes captcha-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}
