/* Professional CAPTCHA Styling */

.captcha-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.captcha-image-container {
    text-align: center;
    margin-bottom: 15px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    max-width: 100%;
    box-sizing: border-box;
}

.captcha-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.captcha-loading {
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.captcha-controls .btn {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.captcha-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.captcha-input-container {
    margin-bottom: 10px;
}

.captcha-input {
    width: 100%;
    max-width: 350px; /* Match CAPTCHA image width on desktop; responsive on small screens */
    height: 60px; /* Match CAPTCHA image height */
    text-align: center;
    box-sizing: border-box;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0px;
    text-transform: uppercase;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #ffffff !important;
    background-color: #000000 !important;
    text-shadow: none;
    box-shadow: none;
    flex-shrink: 0;
    box-sizing: border-box;
}

.captcha-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    text-shadow: none;
    color: #ffffff !important;
    background-color: #000000 !important;
}

.captcha-input.is-valid {
    border-color: #28a745;
    background-color: #000000 !important;
    color: #ffffff !important;
}

.captcha-input.is-invalid {
    border-color: #dc3545;
    background-color: #000000 !important;
    color: #ffffff !important;
}

.captcha-help {
    text-align: center;
    margin-top: 10px;
}

.captcha-help small {
    font-size: 12px;
    line-height: 1.4;
}

.captcha-help i {
    margin-right: 5px;
    color: #6c757d;
}

/* Accessibility improvements */
.captcha-container:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.captcha-image:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 576px) {
    .captcha-container {
        padding: 15px;
        margin: 10px 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .captcha-image-container {
        width: 100%;
        max-width: 100%;
    }
    
    .captcha-image {
        max-width: 100%;
        width: 100%;
        height: auto;
        min-height: 56px;
    }
    
    .captcha-controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .captcha-controls .btn {
        width: auto;
        max-width: 200px;
    }
    
    .captcha-input {
        width: 100%;
        max-width: 100%;
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        font-size: 16px;
        padding: 8px 12px;
        letter-spacing: 0px;
        font-weight: 400;
        background-color: #000000 !important;
        color: #ffffff !important;
    }

    .captcha-input::placeholder {
        font-size: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .captcha-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .captcha-image-container {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .captcha-loading {
        color: #a0aec0;
    }
    
    .captcha-input {
        background: #1a202c !important;
        border-color: #4a5568;
        color: #e2e8f0 !important;
    }
    
    .captcha-input:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25);
        background: #1a202c !important;
        color: #e2e8f0 !important;
    }
    
    .captcha-help small {
        color: #a0aec0;
    }
}

/* Animation for loading state */
@keyframes captcha-loading {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.captcha-loading {
    animation: captcha-loading 1.5s ease-in-out infinite;
}

/* Error state styling */
.captcha-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    text-align: center;
}

.captcha-success {
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
    text-align: center;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .captcha-container {
        border-width: 2px;
        border-color: #000000;
    }
    
    .captcha-image {
        border-width: 2px;
        border-color: #000000;
    }
    
    .captcha-input {
        border-width: 2px;
    }
}

