/* Elementor Activepieces Webhook Form Styles */

.eaw-form-wrapper {
    width: 100%;
    max-width: 100%;
}

.eaw-form {
    width: 100%;
}

.eaw-form-fields {
    display: flex;
    flex-wrap: wrap;
    row-gap: 15px;
    column-gap: 15px;
}

.eaw-form-field {
    display: flex;
    flex-direction: column;
}

/* Inline button layout */
.eaw-fields-with-button {
    align-items: flex-end;
}

.eaw-form-submit-inline {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 0 0 30%;
    max-width: 30%;
}

.eaw-form-submit-inline .eaw-submit-button {
    width: 100%;
    margin-top: 0;
}

.eaw-field-width-100 {
    width: 100%;
}

.eaw-field-width-50 {
    width: calc(50% - 7.5px);
}

.eaw-field-width-33 {
    width: calc(33.333% - 10px);
}

.eaw-field-width-25 {
    width: calc(25% - 11.25px);
}

@media (max-width: 768px) {
    .eaw-field-width-50,
    .eaw-field-width-33,
    .eaw-field-width-25 {
        width: 100%;
    }
}

.eaw-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.eaw-required {
    color: #e74c3c;
    margin-left: 3px;
}

.eaw-field-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.eaw-field-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.eaw-field-input::placeholder {
    color: #999;
}

textarea.eaw-field-input {
    resize: vertical;
    min-height: 100px;
}

select.eaw-field-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Checkbox and Radio Groups */
.eaw-checkbox-group,
.eaw-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eaw-checkbox-label,
.eaw-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.eaw-checkbox-label input[type="checkbox"],
.eaw-radio-label input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.eaw-checkbox-label span,
.eaw-radio-label span {
    user-select: none;
}

/* Submit Section */
.eaw-form-submit {
    margin-top: 20px;
}

.eaw-button-inline .eaw-form-submit {
    margin-top: 0;
}

.eaw-submit-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.eaw-submit-button:hover:not(:disabled) {
    background-color: #0056b3;
}

.eaw-submit-button:active {
    transform: translateY(0);
}

.eaw-submit-button:disabled {
    background-color: #ccc;
    cursor: not allowed;
    transform: none;
    box-shadow: none;
}

/* Messages */
.eaw-form-messages {
    margin-top: 20px;
}

.eaw-message {
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.eaw-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.eaw-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading State */
.eaw-form.loading .eaw-submit-button {
    position: relative;
    color: transparent;
}

.eaw-form.loading .eaw-submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .eaw-field-input {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .eaw-submit-button {
        width: 100%;
        padding: 14px 20px;
    }
}
