#captcha-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10001; /* Higher than #seven */
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#captcha-screen.captcha-hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.captcha-container {
    background: #fff;
    width: 320px;
    max-width: 90%;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.captcha-header {
    color: #333;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
}

.captcha-refresh-icon {
    font-size: 18px;
    cursor: pointer;
    color: #999;
}

.captcha-image {
    width: 100%;
    height: 160px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

.captcha-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Slider Container */
.captcha-slider-container {
    position: relative;
    width: 100%;
    height: 40px;
    background-color: #f2f2f2;
    border-radius: 2px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    user-select: none;
}

/* Base text that stays behind */
.captcha-slider-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #888;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to right, #888 0%, #333 50%, #888 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

/* The track that fills up as you drag (optional, usually green or just clear) */
.captcha-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #d1ffe3;
    width: 0; /* Updated via JS */
    z-index: 1;
    border-right: 1px solid #26c281;
}

/* The thumb handle */
.captcha-slider-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 38px; /* -2px for border */
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #333;
    transition: background-color 0.2s;
    border-radius: 2px;
}

.captcha-slider-thumb:hover {
    background-color: #f9f9f9;
}

.captcha-slider-thumb.captcha-success {
    background-color: #26c281; /* Green success */
    color: #fff;
    border-color: #26c281;
}

/* Success Message Overlay on Slider */
.captcha-slider-success-msg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4;
    color: #26c281;
    font-size: 14px;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    border: 1px solid #26c281;
}
.captcha-slider-success-msg.visible {
    opacity: 1;
}

.captcha-rotate {
    animation: spin 0.5s linear;
}
@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Hide the sticky popup when captcha is active */
#captcha-screen.is-active ~ #popup-um {
    display: none !important;
}
