/* Numeric Code Captcha Styles */
.numeric-captcha-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.captcha-code-display {
    background: linear-gradient(135deg, rgba(124, 58, 237, 1) 0%, rgba(124, 58, 237, 0.85) 100%);
    border-radius: 6px;
    padding: 10px 15px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
    margin-bottom: 10px;
}

.captcha-code-display::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
    pointer-events: none;
}

@keyframes slide {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50%, 50%);
    }
}

.captcha-code-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: 6px;
    font-family: "Courier New", monospace;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 255, 255, 0.2);
    user-select: none;
    position: relative;
    z-index: 1;
    padding: 4px 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-code-text canvas {
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    pointer-events: none;
}

.captcha-code-label {
    color: rgba(255, 255, 255, 0.95);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
}

.captcha-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.captcha-input-wrapper input {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 5px;
    text-align: center;
    font-family: "Courier New", monospace;
    padding: 8px 40px 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.captcha-input-wrapper input:focus {
    outline: none;
    border-color: rgba(124, 58, 237, 1);
    box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.25);
}

.captcha-input-wrapper input.valid {
    border-color: #28a745;
    background-color: #d4edda;
}

.captcha-input-wrapper input.invalid {
    border-color: #dc3545;
    background-color: #f8d7da;
    animation: shake 0.5s;
}

.captcha-refresh-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.captcha-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(180deg);
}

.captcha-refresh-btn:active {
    transform: rotate(180deg) scale(0.9);
}

.captcha-refresh-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.captcha-refresh-btn i {
    transition: transform 0.3s ease;
}

.captcha-refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.captcha-status-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.captcha-status-icon.show {
    opacity: 1;
}

.captcha-status-icon.valid {
    color: #28a745;
}

.captcha-status-icon.invalid {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 480px) {
    .numeric-captcha-container {
        max-width: 280px;
    }

    .captcha-code-display {
        padding: 8px 12px;
    }

    .captcha-code-text {
        font-size: 22px;
        letter-spacing: 5px;
        padding: 4px 0;
        min-height: 55px;
    }

    .captcha-input-wrapper input {
        font-size: 16px;
        letter-spacing: 4px;
        padding: 7px 35px 7px 10px;
    }

    .captcha-refresh-btn {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 12px;
        top: 6px;
        right: 6px;
    }

    .captcha-status-icon {
        font-size: 16px;
        right: 10px;
    }
}

/* Optional: Add noise pattern for better security */
.captcha-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(
            circle at 20% 30%,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px
        ),
        radial-gradient(
            circle at 60% 70%,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px
        ),
        radial-gradient(
            circle at 40% 90%,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px
        );
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0.5;
}
