/* ============================================
   Puzzle Slide Captcha Styles
   ============================================ */
.puzzle-captcha {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.pc-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Canvas area */
.pc-canvas-wrap {
    position: relative;
    width: 260px;
    height: 110px;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
    background: #eee;
}

/* Clip the bg canvas to the rounded rect, but NOT the puzzle canvas */
.pc-bg-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.pc-puzzle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    cursor: default;
    transition: none;
    /* overflow:hidden on parent clips the canvas, but we still need
       the puzzle canvas to be transparent outside the piece shape.
       drop-shadow works with transparent canvas pixels correctly. */
    filter: drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.35));
    background: transparent;
}

.pc-refresh {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    color: #fff;
    transition:
        background 0.2s,
        transform 0.3s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pc-refresh:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(180deg);
}

.pc-refresh svg {
    width: 12px;
    height: 12px;
}

/* Slider track */
.pc-slider-wrap {
    padding: 0 2px;
}

.pc-slider-track {
    position: relative;
    width: 260px;
    height: 36px;
    background: #f0f1f3;
    border-radius: 18px;
    margin: 0 auto;
    overflow: hidden;
    border: 1.5px solid #e0e2e6;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pc-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 22px;
    transition: none;
}

.pc-slider-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    transition:
        box-shadow 0.2s,
        color 0.2s;
    z-index: 2;
}

.pc-slider-btn:active {
    cursor: grabbing;
    box-shadow: 0 4px 18px rgba(67, 233, 123, 0.35);
    color: #43e97b;
}

.pc-slider-btn svg {
    width: 16px;
    height: 16px;
}

.pc-slider-btn.pc-success {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #fff;
    box-shadow: 0 4px 18px rgba(67, 233, 123, 0.45);
}

.pc-slider-btn.pc-fail {
    background: linear-gradient(135deg, #f5576c, #f093fb);
    color: #fff;
    animation: pc-shake 0.4s ease;
}

.pc-slider-text {
    position: absolute;
    width: 100%;
    text-align: center;
    color: #aaa;
    font-size: 12px;
    line-height: 36px;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.2s;
    white-space: nowrap;
}

/* Status message */
.pc-status {
    text-align: center;
    font-size: 11.5px;
    min-height: 14px;
    font-weight: 500;
}

.pc-status-success {
    color: #27ae60;
}

.pc-status-fail {
    color: #e74c3c;
}

/* Verified state extras */
.puzzle-captcha.pc-verified .pc-slider-track {
    border-color: #43e97b;
}

.puzzle-captcha.pc-failed .pc-slider-track {
    border-color: #f5576c;
}

@keyframes pc-shake {
    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }
    20% {
        transform: translateY(-50%) translateX(-6px);
    }
    40% {
        transform: translateY(-50%) translateX(6px);
    }
    60% {
        transform: translateY(-50%) translateX(-4px);
    }
    80% {
        transform: translateY(-50%) translateX(4px);
    }
}
