/* MxChat Forms Public Styles */

.mxchat-form {
    border-radius: 8px;
    padding: 5px;
    margin-top: -30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 500px;
}

.mxchat-form-field {
    margin-bottom: 16px;
}

.mxchat-form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.mxchat-required {
    color: #dc3545;
    margin-left: 4px;
}

.mxchat-input,
.mxchat-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.mxchat-input:focus,
.mxchat-textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px rgba(34, 113, 177, 0.2);
}

.mxchat-textarea {
    min-height: 100px;
    resize: vertical;
}

.mxchat-submit-form {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mxchat-submit-form:hover {
    background: #135e96;
}

.mxchat-submit-form:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Success Message */
.mxchat-form .success {
}

/* Error Message */
.mxchat-form .error {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 10px 0;
}

/* Loading State */
.mxchat-form.loading .mxchat-submit-form::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Responsive Design */
@media screen and (max-width: 600px) {
    .mxchat-form {
        padding: 15px;
        margin: 5px 0;
    }

    .mxchat-submit-form {
        width: 100%;
    }
}

/* Form Field Validation Styles */
.mxchat-form-field.error .mxchat-input,
.mxchat-form-field.error .mxchat-textarea {
    border-color: #dc3545;
}

.mxchat-form-field.error .mxchat-form-label {
    color: #dc3545;
}

.mxchat-validation-message {
    font-size: 12px;
    margin-top: 4px;
    display: none;
    color: #dc3545;
}

.mxchat-form-field.error .mxchat-validation-message {
    display: block;
}