/**
 * CAPTCHA ASTRAL - Estilos Premium (Versão Texto Tradicional)
 * Design compacto, elegante e responsivo
 */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

.captcha-astral {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.captcha-astral::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    animation: rotateGradient 20s linear infinite;
    pointer-events: none;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.captcha-header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.captcha-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FBBF24;
    margin-top: 0.125rem;
    position: relative;
    width: 32px;
    height: 32px;
}

.captcha-icon svg.star-icon {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6));
    animation: starTwinkle 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.star-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: starGlowPulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6));
    }
    25% {
        opacity: 0.7;
        transform: scale(0.95) rotate(-5deg);
        filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4));
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.9));
    }
    75% {
        opacity: 0.8;
        transform: scale(0.98) rotate(-3deg);
        filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
    }
}

@keyframes starGlowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

.captcha-text {
    flex: 1;
}

.captcha-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #E9D5FF;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.3;
}

.captcha-text p {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: rgba(233, 213, 255, 0.8);
    margin: 0;
    line-height: 1.5;
}

/* Display do código */
.captcha-code-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    background: rgba(10, 14, 39, 0.6);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.captcha-code-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(139, 92, 246, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 3s linear infinite;
    border-radius: 12px;
    pointer-events: none;
}

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

.code-char {
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 2rem;
    font-weight: 800;
    color: #8B5CF6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    letter-spacing: 0;
    padding: 0.5rem 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
    animation: charAppear 0.5s ease-out;
    animation-delay: var(--delay);
    animation-fill-mode: both;
    transform: rotate(-2deg);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.code-char:nth-child(even) {
    transform: rotate(2deg);
}

@keyframes charAppear {
    0% {
        opacity: 0;
        transform: translateY(-20px) rotate(-2deg) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(-2deg) scale(1);
    }
}

.captcha-input-wrapper {
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
}

.captcha-input {
    position: relative;
    z-index: 1;
}

.captcha-input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: rgba(10, 14, 39, 0.6);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 1.25rem;
    font-family: 'Orbitron', 'Space Grotesk', 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.35rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
}

.captcha-input:focus {
    border-color: #8B5CF6;
    box-shadow: 
        0 0 0 4px rgba(139, 92, 246, 0.15), 
        0 0 25px rgba(139, 92, 246, 0.4),
        inset 0 0 20px rgba(139, 92, 246, 0.1);
    transform: translateY(-2px) scale(1.02);
    background: rgba(10, 14, 39, 0.85);
    letter-spacing: 0.5rem;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.8), 0 0 25px rgba(139, 92, 246, 0.4);
    animation: inputGlow 2s ease-in-out infinite;
}

.captcha-input:not(:placeholder-shown) {
    color: #E9D5FF;
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.6), 0 0 20px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 
        0 0 0 2px rgba(139, 92, 246, 0.2), 
        0 0 15px rgba(139, 92, 246, 0.3);
}

.captcha-input::placeholder {
    color: rgba(148, 163, 184, 0.4);
    letter-spacing: 0.15rem;
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.captcha-input:focus::placeholder {
    opacity: 0.3;
}

@keyframes inputGlow {
    0%, 100% {
        box-shadow: 
            0 0 0 4px rgba(139, 92, 246, 0.15), 
            0 0 25px rgba(139, 92, 246, 0.4),
            inset 0 0 20px rgba(139, 92, 246, 0.1);
    }
    50% {
        box-shadow: 
            0 0 0 4px rgba(139, 92, 246, 0.25), 
            0 0 35px rgba(139, 92, 246, 0.6),
            inset 0 0 25px rgba(139, 92, 246, 0.15);
    }
}

/* Efeito de digitação - animação nos caracteres */
.captcha-input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(139, 92, 246, 0.08) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    opacity: 0;
    pointer-events: none;
    border-radius: 12px;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.captcha-input-wrapper:focus-within::before,
.captcha-input-wrapper.typing-active::before {
    opacity: 1;
    animation: typingEffect 1.5s ease-in-out infinite;
}

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

.btn-refresh {
    padding: 0.875rem;
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-refresh:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #8B5CF6;
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

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

.btn-refresh svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s;
}

.captcha-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Estado inicial com animação dourada */
.captcha-status-initial {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    animation: goldenGlow 3s ease-in-out infinite;
}

.captcha-status-initial::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(251, 191, 36, 0.1) 50%,
        transparent 70%
    );
    background-size: 200% 200%;
    animation: goldenShimmer 3s linear infinite;
    pointer-events: none;
}

.captcha-status-initial .status-text {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 50%, #FBBF24 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldenTextShimmer 3s ease-in-out infinite;
    font-weight: 600;
}

.captcha-status-initial .status-icon {
    color: #FBBF24;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
    animation: goldenIconPulse 2s ease-in-out infinite;
}

@keyframes goldenGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.2), 0 0 20px rgba(251, 191, 36, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.4), 0 0 30px rgba(251, 191, 36, 0.2);
    }
}

@keyframes goldenShimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes goldenTextShimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes goldenIconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

.captcha-status.checking {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
}

.captcha-status.valid {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    animation: successGlow 2s ease-in-out infinite;
}

@keyframes successGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.4); }
}

.captcha-status.error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    animation: shake 0.5s ease;
}

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

.status-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon svg {
    width: 18px;
    height: 18px;
    animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.status-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: rgba(233, 213, 255, 0.9);
    font-weight: 500;
    line-height: 1.4;
}

.captcha-status.checking .status-text {
    color: #FBBF24;
}

.captcha-status.valid .status-text {
    color: #6ee7b7;
    font-weight: 600;
}

.captcha-status.error .status-text {
    color: #fca5a5;
}

/* Responsividade */
@media (max-width: 768px) {
    .captcha-astral {
        padding: 1.25rem;
        margin: 1.25rem 0;
    }
    
    .captcha-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        align-items: center;
    }
    
    .captcha-icon {
        align-self: center;
    }
    
    .captcha-text {
        text-align: center;
    }
    
    .captcha-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .captcha-text h3 {
        font-size: 0.9375rem;
    }
    
    .captcha-text p {
        font-size: 0.8125rem;
    }
    
    .captcha-code-display {
        gap: 0.4rem;
        padding: 0.875rem;
        justify-content: center;
    }
    
    .code-char {
        font-size: 1.35rem;
        padding: 0.35rem 0.45rem;
        min-width: 36px;
    }
    
    .captcha-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
        letter-spacing: 0.15rem;
        text-align: center;
    }
    
    .captcha-input:focus {
        letter-spacing: 0.2rem;
    }
    
    .captcha-input::placeholder {
        font-size: 0.8rem;
        letter-spacing: 0.1rem;
    }
    
    .captcha-input-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-refresh {
        padding: 0.75rem;
        width: 100%;
        justify-content: center;
    }
    
    .captcha-status {
        padding: 0.625rem 0.75rem;
        text-align: center;
        justify-content: center;
    }
    
    .status-text {
        font-size: 0.7rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .captcha-astral {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 12px;
    }
    
    .captcha-text h3 {
        font-size: 0.875rem;
    }
    
    .captcha-text p {
        font-size: 0.75rem;
    }
    
    .captcha-code-display {
        gap: 0.3rem;
        padding: 0.75rem;
        justify-content: center;
    }
    
    .code-char {
        font-size: 1.15rem;
        padding: 0.3rem 0.35rem;
        min-width: 32px;
    }
    
    .captcha-input {
        padding: 0.625rem 0.6875rem;
        font-size: 0.875rem;
        letter-spacing: 0.1rem;
        text-align: center;
    }
    
    .captcha-input:focus {
        letter-spacing: 0.15rem;
    }
    
    .captcha-input::placeholder {
        font-size: 0.7rem;
        letter-spacing: 0.08rem;
    }
    
    .captcha-input-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-refresh {
        padding: 0.625rem;
        width: 100%;
        justify-content: center;
    }
    
    .btn-refresh svg {
        width: 16px;
        height: 16px;
    }
    
    .captcha-status {
        padding: 0.5625rem 0.625rem;
        text-align: center;
        justify-content: center;
    }
    
    .status-text {
        font-size: 0.65rem;
        text-align: center;
    }
}
