.hcaptcha-container {
    margin: 15px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.h-captcha {
    display: inline-block;
    margin: 0 auto;
    text-align: center;
}
#hcaptchaContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 78px;
}

#hcaptchaContainer .h-captcha {
    display: flex;
    justify-content: center;
    align-items: center;
}
.dark-mode .h-captcha {
    filter: invert(1) hue-rotate(180deg);
}
@media (max-width: 768px) {
    .h-captcha {
        transform: scale(0.9);
        transform-origin: center;
    }
    
    #hcaptchaContainer {
        min-height: 70px;
    }
}

@media (max-width: 480px) {
    .h-captcha {
        transform: scale(0.8);
        transform-origin: center;
    }
    
    #hcaptchaContainer {
        min-height: 62px;
    }
}
.hcaptcha-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}
.hcaptcha-success {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 5px;
}
.hcaptcha-loading {
    opacity: 0.6;
    pointer-events: none;
}
.h-captcha[data-size="invisible"] {
    display: none;
}
.h-captcha[data-size="invisible"],
.h-captcha[data-size="compact"] {
    display: none;
}
#h-captcha-response,
input[name="h-captcha-response"] {
    display: none;
}
.h-captcha {
    margin: 15px 0;
    text-align: center;
}
.h-captcha[data-size="normal"],
.h-captcha[data-size="compact"] {
    display: block !important;
}
.h-captcha[data-size="invisible"] {
    display: none !important;
}
.hcaptcha-badge {
    visibility: hidden !important;
}
.hcaptcha-badge[data-style*="inline"] {
    display: none !important;
}
.h-captcha {
    min-height: 0;
    margin: 0;
    padding: 0;
}
.h-captcha[data-size="compact"] {
    transform: scale(0.9);
}
.hcaptcha-top {
    margin-bottom: 15px;
}

.hcaptcha-bottom {
    margin-top: 15px;
}
.form-group .h-captcha {
    margin-top: 10px;
}
.login-form .h-captcha {
    margin: 15px 0;
}
.profile-login-card .h-captcha {
    margin: 15px 0;
}
.h-captcha:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}
@media (prefers-contrast: high) {
    .h-captcha {
        border: 2px solid currentColor;
    }
}
@media (prefers-reduced-motion: reduce) {
    .h-captcha {
        transition: none;
    }
}
.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.hcaptcha-error-message {
    font-size: 0.875rem;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}
.btn-secondary[title*="Đang tải"] {
    position: relative;
}

.btn-secondary[title*="Đang tải"]::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}
.hcaptcha-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
    padding: 20px;
}

.hcaptcha-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    position: relative;
}

.hcaptcha-modal-header {
    padding: 20px 20px 10px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.hcaptcha-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.hcaptcha-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.hcaptcha-modal-close:hover {
    background-color: #f8f9fa;
    color: #333;
}

.hcaptcha-modal-body {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 180px;
    text-align: center;
}

.hcaptcha-modal-body p {
    text-align: center;
    margin-bottom: 25px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}
.dark-mode .hcaptcha-modal-overlay {
    background-color: rgba(0, 0, 0, 0.8);
}

.dark-mode .hcaptcha-modal-content {
    background: #2d3748;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #4a5568;
}

.dark-mode .hcaptcha-modal-header {
    border-bottom: 1px solid #4a5568;
}

.dark-mode .hcaptcha-modal-title {
    color: #e2e8f0;
}

.dark-mode .hcaptcha-modal-close {
    color: #a0aec0;
}

.dark-mode .hcaptcha-modal-close:hover {
    background-color: #4a5568;
    color: #e2e8f0;
}

.dark-mode .hcaptcha-modal-body p {
    color: #a0aec0;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.hcaptcha-modal-overlay .h-captcha[data-size="invisible"] {
    display: none !important;
}
.hcaptcha-modal-overlay .h-captcha[data-size="normal"] {
    display: block !important;
    margin: 0 auto;
}
.hcaptcha-modal-overlay .h-captcha > div {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
}
.hcaptcha-modal-overlay .h-captcha iframe {
    margin: 0 auto !important;
    display: block !important;
}
.form-group .hcaptcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 15px 0;
}
.loginForm .hcaptcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 15px 0;
}
#profileLoginForm .hcaptcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 15px 0;
}
@media (max-width: 768px) {
    .hcaptcha-modal-overlay {
        padding: 15px;
    }
    
    .hcaptcha-modal-content {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .hcaptcha-modal-body {
        padding: 25px 15px;
        min-height: 160px;
    }
}

@media (max-width: 480px) {
    .hcaptcha-modal-overlay {
        padding: 10px;
    }
    
    .hcaptcha-modal-content {
        margin: 0 5px;
    }
    
    .hcaptcha-modal-body {
        padding: 20px 15px;
        min-height: 150px;
    }
}
