/* 
 * HRLinked Premium Slider Jigsaw Puzzle CAPTCHA Stylesheet
 * Vibrant, modern, interactive, and fully responsive.
 */

.slider-captcha-wrapper {
    margin: 1.5rem 0;
    font-family: 'Inter', sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.captcha-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    position: relative;
    max-width: 340px;
    margin: 0 auto;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.captcha-container:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border-color: rgba(30, 58, 138, 0.15);
}

/* Captcha Header */
.captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.captcha-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-trust-blue, #1E3A8A);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.captcha-refresh-btn {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-refresh-btn:hover {
    color: var(--color-primary, #3B82F6);
    transform: rotate(180deg);
}

/* Image & Canvas Stage */
.captcha-stage {
    position: relative;
    width: 300px;
    height: 150px;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #F1F5F9;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.25rem;
}

.captcha-bg-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.captcha-piece-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    cursor: grab;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
}

.captcha-piece-canvas:active {
    cursor: grabbing;
}

/* Slider Track */
.captcha-slider-track {
    position: relative;
    width: 300px;
    height: 44px;
    background: #F1F5F9;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 22px;
    overflow: hidden;
}

.captcha-slider-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 22px 0 0 22px;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

.captcha-slider-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748B;
    pointer-events: none;
    letter-spacing: 0.02em;
    animation: textPulse 2.5s infinite;
}

.captcha-slider-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 40px;
    height: 40px;
    background: #FFFFFF;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-trust-blue, #1E3A8A);
    font-size: 0.95rem;
    z-index: 20;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.captcha-slider-handle:hover {
    background: var(--color-primary, #3B82F6);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.captcha-slider-handle:active {
    cursor: grabbing;
}

/* Success State Animations */
.captcha-container.success {
    border-color: #10B981;
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.1);
}

.captcha-container.success .captcha-title {
    color: #10B981;
}

.captcha-container.success .captcha-slider-progress {
    background: rgba(16, 185, 129, 0.15);
    width: 100% !important;
}

.captcha-container.success .captcha-slider-text {
    color: #047857;
    animation: none;
}

.captcha-container.success .captcha-slider-handle {
    background: #10B981 !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    cursor: default;
}

/* Failure State Shake Animation */
.captcha-container.shake {
    animation: captchaShake 0.4s ease-in-out;
}

/* Animations */
@keyframes textPulse {
    0%, 100% {
        opacity: 0.65;
        transform: translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateX(5px);
    }
}

@keyframes captchaShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Screen overlay during success flash */
.captcha-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 185, 129, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 0.75rem;
}

.captcha-success-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.captcha-success-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    transform: scale(0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.captcha-success-overlay.show .captcha-success-icon {
    transform: scale(1);
}

.captcha-success-text {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Responsive scale for small mobile screens (e.g., 375px and below) */
@media (max-width: 380px) {
    .captcha-container {
        transform: scale(0.88);
        transform-origin: center top;
        margin: 0.5rem auto -1.5rem auto !important;
        padding: 1rem 0.5rem !important;
        max-width: 316px !important;
    }
}
