/* SmartCaptcha Styles */

.smart-captcha-container {
    width: 320px;
    border-radius: 16px;
    overflow: hidden;
    max-width: 100%;
    border: 1px solid #d4dfe7;
}

.smart-captcha-container iframe {
    box-sizing: content-box;
    margin: -1px;
    min-width: calc(100% + 2px);
    min-height: calc(100% + 2px);
}

.smart-captcha-container.captcha-success {
}

.smart-captcha-container.captcha-error {
    border-color: #dc3545;
}

.smart-captcha-container .smart-captcha {
    margin: 0 auto;
}

.smart-captcha-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.smart-captcha-container label.required:after {
    content: " *";
    color: #dc3545;
}

.smart-captcha-token {
    display: none;
}

/* Loading state */
.smart-captcha-container.loading {
    background-color: #e9ecef;
    border-color: #6c757d;
}

.smart-captcha-container.loading:before {
    content: "Загрузка капчи...";
    color: #6c757d;
    font-style: italic;
}

/* Error state */
.smart-captcha-container.error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.smart-captcha-container.error:before {
    content: "Ошибка загрузки капчи";
    font-weight: 500;
}

/* Success state */
.smart-captcha-container.success {
    background-color: #d4edda;
    border-color: #28a745;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .smart-captcha-container {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .smart-captcha-container label {
        color: #e2e8f0;
    }

    .smart-captcha-container.captcha-success {
        background-color: #22543d;
        border-color: #38a169;
    }

    .smart-captcha-container.captcha-error {
        background-color: #742a2a;
        border-color: #e53e3e;
    }
}

/* Form integration styles */
.form-group .smart-captcha-container {
    margin-top: 5px;
}

.form-horizontal .smart-captcha-container {
    margin-left: 0;
}

.form-inline .smart-captcha-container {
    display: inline-block;
    margin: 0 10px;
}

/* Accessibility improvements */
.smart-captcha-container:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.smart-captcha-container[aria-invalid="true"] {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Print styles */
@media print {
    .smart-captcha-container {
        display: none;
    }
}
