/* Cloudflare Turnstile widget styling */

.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

/* Centered in authentication forms */
.login-form .cf-turnstile,
.register-form .cf-turnstile,
.forgot-password-form .cf-turnstile {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Validation error state indicator */
.cf-turnstile.is-invalid {
    border: 2px solid var(--theme-danger, #dc3545);
    border-radius: 4px;
    padding: 4px;
}

/* Dark mode support - Turnstile handles internal theming via data-theme */
[data-bs-theme="dark"] .cf-turnstile {
    background-color: transparent;
}

/* Loading state while widget initializes */
.cf-turnstile:empty::before {
    content: '';
    display: block;
    width: 300px;
    height: 65px;
    background: linear-gradient(90deg,
        var(--theme-bg-secondary, #f0f0f0) 25%,
        var(--theme-bg-primary, #e0e0e0) 50%,
        var(--theme-bg-secondary, #f0f0f0) 75%);
    background-size: 200% 100%;
    animation: turnstile-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes turnstile-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Compact size adjustments */
.cf-turnstile[data-size="compact"]:empty::before {
    width: 150px;
    height: 140px;
}
