/**
 * Custom Elementor Form Widget Styles
 * File: css/custom-form-widget.css
 */

 .cef-custom-form-wrapper {
    max-width: 100%;
    box-sizing: border-box;
}

.cef-custom-form {
    width: 100%;
}

.cef-form-fields {
    display: flex;
    flex-wrap: wrap;
    column-gap: 20px;
    row-gap: 20px;
}

.cef-form-group {
    flex: 1 1 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

.cef-form-group.cef-hidden-field {
    display: none !important;
}

.cef-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.cef-required {
    color: #dc3232;
    margin-left: 2px;
}

.cef-form-field {
    width: 100%;
    border: 1px solid #d0d0d0;
    border-style: solid;
    padding: 12px 15px;
    font-size: 15px;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-sizing: border-box;
    border-radius: 3px;
    background-color: #fff;
    color: #333;
}

.cef-form-field:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.cef-form-field::placeholder {
    color: #999;
    opacity: 1;
}

textarea.cef-form-field {
    min-height: 120px;
    resize: vertical;
}

.cef-form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
}

.cef-submit-button {
    display: inline-block;
    width: auto;
    min-width: 150px;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #0073aa;
    color: #fff;
    border-radius: 3px;
    text-align: center;
}

.cef-submit-button:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.cef-submit-button:active {
    transform: translateY(0);
}

.cef-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.cef-form-messages {
    margin-top: 15px;
}

.cef-success-message {
    padding: 15px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    margin-bottom: 10px;
    display: none;
}

.cef-error-message {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    margin-bottom: 10px;
    display: none;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .cef-form-group {
        flex-basis: 100% !important;
        max-width: 100% !important;
    }
    
    .cef-submit-button {
        width: 100%;
    }
}

/* Radio and Checkbox Groups */
.cef-radio-group,
.cef-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cef-radio-label,
.cef-checkbox-label,
.cef-acceptance-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
}

.cef-radio-label input[type="radio"],
.cef-checkbox-label input[type="checkbox"],
.cef-acceptance-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* File Upload */
.cef-file-field {
    padding: 10px;
    border: 2px dashed #d0d0d0 !important;
    background-color: #fafafa !important;
    cursor: pointer;
}

.cef-file-field:hover {
    border-color: #0073aa !important;
    background-color: #f0f0f0 !important;
}

/* HTML Field */
.cef-html-field {
    padding: 15px 0;
}

.cef-html-field p {
    margin: 0 0 10px 0;
}

.cef-html-field h1,
.cef-html-field h2,
.cef-html-field h3,
.cef-html-field h4,
.cef-html-field h5,
.cef-html-field h6 {
    margin: 0 0 15px 0;
}

/* reCAPTCHA */
.g-recaptcha {
    margin: 10px 0;
}

/* Honeypot - Always hidden */
.cef-honeypot-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

/* Select dropdown */
select.cef-form-field {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Date and Time inputs */
input[type="date"].cef-form-field,
input[type="time"].cef-form-field {
    cursor: pointer;
}

/* Number input - remove spinners on some browsers */
input[type="number"].cef-form-field::-webkit-inner-spin-button,
input[type="number"].cef-form-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"].cef-form-field {
    -moz-appearance: textfield;
}

/* Elementor Editor specific styles */
.elementor-editor-active .cef-custom-form {
    pointer-events: auto;
}

.elementor-editor-active .cef-form-field {
    pointer-events: auto;
}

/* Error styling for validation */
.cef-form-field:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3232;
}

/* Focus states for radio and checkbox */
.cef-radio-label input[type="radio"]:focus,
.cef-checkbox-label input[type="checkbox"]:focus,
.cef-acceptance-label input[type="checkbox"]:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}