/**
 * Contact Form Styles
 */

/* Form message styles */
.form-message {
    animation: slideDown 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.form-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: currentColor;
}

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

/* Form loading state */
.contact-form-loading {
    position: relative;
    overflow: hidden;
}

.contact-form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2B7DFF, transparent);
    animation: loadingBar 1.5s infinite;
    z-index: 10;
}

@keyframes loadingBar {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Field validation styles */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444;
}

.field-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981;
}

/* Success/Error icons */
.form-message-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 8px;
}

/* RTL Support */
[dir="rtl"] .form-message-icon {
    margin-right: 0;
    margin-left: 8px;
}

/* Button loading animation */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Focus states for better accessibility */
.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid #2B7DFF;
    outline-offset: 2px;
}

/* Success checkmark animation */
.success-checkmark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #10b981;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: checkmark-fill 0.4s ease-in-out 0.4s forwards, checkmark-scale 0.3s ease-in-out 0.9s both;
}

.success-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: checkmark-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkmark-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes checkmark-stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes checkmark-scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes checkmark-fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #10b981;
    }
}
