/**
 * HLA CUSTOM CAPTCHA STYLES
 * Privacy-focused, accessible, beautiful CAPTCHA design
 */

.hla-captcha-wrapper {
    --captcha-primary: #052F5F;
    --captcha-secondary: #D5C67A;
    --captcha-success: #28a745;
    --captcha-error: #dc3545;
    --captcha-bg: #ffffff;
    --captcha-text: #241C22;
    --captcha-border: #e0e0e0;
    --captcha-shadow: rgba(0, 0, 0, 0.1);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background: var(--captcha-bg);
    border: 2px solid var(--captcha-border);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--captcha-shadow);
    transition: all 0.3s ease;
}

/* Dark theme */
.hla-captcha-wrapper[data-theme="dark"] {
    --captcha-bg: #1a1a1a;
    --captcha-text: #e0e0e0;
    --captcha-border: #333;
    --captcha-shadow: rgba(0, 0, 0, 0.3);
}

.hla-captcha-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.hla-captcha-icon {
    width: 24px;
    height: 24px;
    color: var(--captcha-primary);
}

.hla-captcha-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--captcha-text);
}

.hla-captcha-instruction {
    font-size: 14px;
    color: var(--captcha-text);
    opacity: 0.8;
    margin-bottom: 20px;
}

/* Slider Container */
.hla-captcha-slider-container {
    position: relative;
    height: 50px;
    margin-bottom: 16px;
}

.hla-captcha-track {
    position: relative;
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    top: 50%;
    transform: translateY(-50%);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hla-captcha-wrapper[data-theme="dark"] .hla-captcha-track {
    background: #2a2a2a;
}

.hla-captcha-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--captcha-primary), var(--captcha-secondary));
    transition: width 0.1s ease;
    border-radius: 6px;
}

.hla-captcha-target {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.hla-captcha-target-marker {
    width: 3px;
    height: 20px;
    background: var(--captcha-secondary);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(213, 198, 122, 0.6),
                0 0 4px rgba(213, 198, 122, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.7;
        transform: scaleY(1.2);
    }
}

.hla-captcha-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--captcha-primary), #0a4a8f);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(5, 47, 95, 0.3),
                0 4px 12px rgba(5, 47, 95, 0.2);
    transition: all 0.2s ease;
    z-index: 2;
}

.hla-captcha-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(5, 47, 95, 0.4),
                0 6px 16px rgba(5, 47, 95, 0.3);
}

.hla-captcha-handle:active,
.hla-captcha-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.05);
}

.hla-captcha-handle.success {
    background: linear-gradient(135deg, var(--captcha-success), #20c997);
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Status Messages */
.hla-captcha-status {
    min-height: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.hla-captcha-status.loading {
    color: var(--captcha-primary);
}

.hla-captcha-status.success {
    color: var(--captcha-success);
    animation: fadeIn 0.3s ease;
}

.hla-captcha-status.error {
    color: var(--captcha-error);
    animation: shake 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Footer */
.hla-captcha-footer {
    display: flex;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--captcha-border);
}

.hla-captcha-privacy {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--captcha-text);
    opacity: 0.6;
}

.hla-captcha-privacy svg {
    color: var(--captcha-primary);
}

/* Error State */
.hla-captcha-error {
    text-align: center;
    padding: 30px 20px;
    background: var(--captcha-bg);
    border: 2px solid var(--captcha-error);
    border-radius: 12px;
}

.hla-captcha-error-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.hla-captcha-error-message {
    font-size: 14px;
    color: var(--captcha-error);
    font-weight: 500;
}

/* Mobile Responsive */
@media screen and (max-width: 480px) {
    .hla-captcha-wrapper {
        padding: 16px;
        max-width: 100%;
    }

    .hla-captcha-handle {
        width: 50px;
        height: 50px;
    }

    .hla-captcha-track {
        height: 14px;
    }
}

/* Accessibility */
.hla-captcha-handle:focus {
    outline: 3px solid var(--captcha-secondary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hla-captcha-wrapper,
    .hla-captcha-handle,
    .hla-captcha-fill,
    .hla-captcha-status {
        animation: none;
        transition: none;
    }

    .hla-captcha-target-marker {
        animation: none;
    }
}

/* Loading indicator */
.hla-captcha-status.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid var(--captcha-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
