/* Form Submission Animations */

/* Button animations */
input.button.submitting,
input[type="submit"].submitting {
    animation: pulse 1.5s ease-in-out infinite;
    background-color: #228A91 !important;
    cursor: wait;
    position: relative;
}

input.button.submitting::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

input.button.submitted,
input[type="submit"].submitted {
    background-color: #28a745 !important;
    animation: successPulse 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

@keyframes spin {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }
    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Message animations */
.form-message {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

/* Loading spinner for submitting message */
.form-message-info {
    position: relative;
    padding-left: 40px !important;
}

.form-message-info::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #0c5460;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

