.comment-form-captcha {
    position: relative;
}

.comment-form-captcha label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #495057;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.comment-form-captcha .captcha-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.comment-form-captcha .captcha-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-form-captcha input[type="text"].rccp-captcha-input {
    width: 140px;
    padding: 12px 15px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #495057;
    background-color: #fff;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.comment-form-captcha input[type="text"].rccp-captcha-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.comment-form-captcha input[type="text"].rccp-captcha-input.correct {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.25);
}

.comment-form-captcha input[type="text"].rccp-captcha-input.incorrect {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.captcha-question {
    position: absolute;
    top: -12px;
    left: 15px;
    font-weight: 700;
    color: #0d6efd;
    font-size: 14px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    padding: 0 8px;
    z-index: 1;
}

.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background-color: #0d6efd;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

.refresh-btn:hover {
    background-color: #0b5ed7;
    transform: rotate(90deg);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.4);
}

.refresh-btn:active {
    transform: rotate(180deg);
}

.rccp-message {
    display: block;
    margin-top: 12px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.rccp-message:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

.rccp-message.error {
    background-color: #f8d7da;
    color: #dc3545;
    border: 1px solid #f5c6cb;
}

.rccp-message.success {
    background-color: #d1e7dd;
    color: #198754;
    border: 1px solid #badbcc;
}

.comment-form-captcha input.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

@media screen and (max-width: 576px) {
    .comment-form-captcha .captcha-input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .comment-form-captcha .captcha-wrapper {
        width: 100%;
    }
    
    .comment-form-captcha input[type="text"].rccp-captcha-input {
        width: 100%;
    }
    
    .refresh-btn {
        width: 100%;
        height: 45px;
        border-radius: 8px;
    }
    
    .captcha-question {
        font-size: 14px;
        top: -12px;
        left: 12px;
    }
    
    .rccp-message {
        font-size: 13px;
        width: 100%;
    }
}