/**
 * Form Success Animation Styles
 * Visual feedback for successful form submissions
 */

/* Success state for buttons */
.btn-success-animation {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.btn-success-animation i {
    animation: checkmark-pop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Checkmark pop animation */
@keyframes checkmark-pop {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* Success ripple effect */
@keyframes success-ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }
}

.btn-success-animation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    transform: translate(-50%, -50%);
    animation: success-ripple 1s ease-out;
}

/* Disabled state during submission */
.btn-submitting {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-submitting::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spinner 0.6s linear infinite;
}

@keyframes btn-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Error state animation */
.btn-error-animation {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    animation: shake 0.5s ease-in-out;
}

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

/* Form input success state */
.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Newsletter form success */
.newsletter-success {
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .btn-success-animation,
    .btn-error-animation,
    .newsletter-success {
        animation: none;
        transition: background 0.2s ease;
    }
    
    @keyframes checkmark-pop {
        0%, 100% {
            transform: none;
            opacity: 1;
        }
    }
}
