/**
 * Unified Form Styles for WordPress
 * Applies to forms with class "unified-form-style-standard"
 * Modern, clean, elegant design with #367C2B primary color
 * High specificity to override all other styles
 */

/* Reset and base styles for unified forms */
.unified-form-style-standard,
.unified-form-style-standard * {
    box-sizing: border-box !important;
}

.unified-form-style-standard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    line-height: 1.6 !important;
    color: #2c3e50 !important;
    background: transparent !important;
}

/* Form container styling */
.unified-form-style-standard .jet-form,
.unified-form-style-standard form {
    background: transparent !important;
    border-radius: 12px !important;
    padding: 32px 0 !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    max-width: 100% !important;
}

/* Form rows and sections */
.unified-form-style-standard .jet-form__row,
.unified-form-style-standard .form-row,
.unified-form-style-standard .elementor-field-group {
    margin-bottom: 24px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

/* Labels */
.unified-form-style-standard label,
.unified-form-style-standard .jet-form__label,
.unified-form-style-standard .elementor-field-label,
.unified-form-style-standard .jet-form-builder__label-text {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #2c3e50 !important;
    margin-bottom: 8px !important;
    display: block !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    line-height: 1.4 !important;
}

/* Required asterisk */
.unified-form-style-standard .required-mark,
.unified-form-style-standard .jet-form__required,
.unified-form-style-standard .required {
    color: #e74c3c !important;
    margin-left: 4px !important;
}

/* Text inputs, textareas, selects */
.unified-form-style-standard input[type="text"],
.unified-form-style-standard input[type="email"],
.unified-form-style-standard input[type="password"],
.unified-form-style-standard input[type="tel"],
.unified-form-style-standard input[type="url"],
.unified-form-style-standard input[type="number"],
.unified-form-style-standard input[type="date"],
.unified-form-style-standard input[type="datetime-local"],
.unified-form-style-standard input[type="time"],
.unified-form-style-standard textarea,
.unified-form-style-standard select {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: #2c3e50 !important;
    background-color: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: 1.5 !important;
    font-family: inherit !important;
}

/* Input focus states */
.unified-form-style-standard input[type="text"]:focus,
.unified-form-style-standard input[type="email"]:focus,
.unified-form-style-standard input[type="password"]:focus,
.unified-form-style-standard input[type="tel"]:focus,
.unified-form-style-standard input[type="url"]:focus,
.unified-form-style-standard input[type="number"]:focus,
.unified-form-style-standard input[type="date"]:focus,
.unified-form-style-standard input[type="datetime-local"]:focus,
.unified-form-style-standard input[type="time"]:focus,
.unified-form-style-standard textarea:focus,
.unified-form-style-standard select:focus {
    border-color: #367C2B !important;
    box-shadow: 0 0 0 3px rgba(54, 124, 43, 0.15) !important;
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

/* Placeholder styling */
.unified-form-style-standard input[type="text"]::placeholder,
.unified-form-style-standard input[type="email"]::placeholder,
.unified-form-style-standard input[type="password"]::placeholder,
.unified-form-style-standard input[type="tel"]::placeholder,
.unified-form-style-standard input[type="url"]::placeholder,
.unified-form-style-standard input[type="number"]::placeholder,
.unified-form-style-standard input[type="date"]::placeholder,
.unified-form-style-standard input[type="datetime-local"]::placeholder,
.unified-form-style-standard input[type="time"]::placeholder,
.unified-form-style-standard textarea::placeholder {
    color: #7f8c8d !important;
    opacity: 1 !important;
    font-style: italic !important;
}

/* Textarea specific */
.unified-form-style-standard textarea {
    min-height: 120px !important;
    resize: vertical !important;
}

/* Select dropdown styling */
.unified-form-style-standard select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 48px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* Select2 AJAX/Autocomplete fields styling */
.unified-form-style-standard .select2-container {
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.unified-form-style-standard .select2-container .select2-selection,
.unified-form-style-standard .select2-container .select2-selection--single {
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    background-image: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: inherit !important;
}

.unified-form-style-standard .select2-container .select2-selection .select2-selection__rendered {
    padding: 14px 16px !important;
    padding-right: 48px !important;
    color: #2c3e50 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    height: 46px !important;
    display: flex !important;
    align-items: center !important;
}

.unified-form-style-standard .select2-container .select2-selection .select2-selection__placeholder {
    color: #7f8c8d !important;
    font-style: italic !important;
}

.unified-form-style-standard .select2-container .select2-selection .select2-selection__arrow {
    height: 46px !important;
    right: 12px !important;
    top: 2px !important;
    width: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.unified-form-style-standard .select2-container .select2-selection .select2-selection__arrow b {
    border-style: solid !important;
    border-color: #6b7280 transparent transparent transparent !important;
    border-width: 6px 5px 0 5px !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    position: static !important;
}

/* Focus states for Select2 */
.unified-form-style-standard .select2-container--focus .select2-selection,
.unified-form-style-standard .select2-container--focus .select2-selection--single,
.unified-form-style-standard .select2-container.select2-container--focus .select2-selection {
    border-color: #367C2B !important;
    box-shadow: 0 0 0 3px rgba(54, 124, 43, 0.15) !important;
    background-color: #ffffff !important;
    outline: none !important;
}

/* Hover states for Select2 */
.unified-form-style-standard .select2-container:hover .select2-selection,
.unified-form-style-standard .select2-container:hover .select2-selection--single {
    border-color: #367C2B !important;
}

/* Specific targeting for jet-select-autocomplete */
.unified-form-style-standard .jet-form-builder__field-wrap .select2-container,
.unified-form-style-standard .jet-form-builder__field-wrap .select2-container .select2-selection,
.unified-form-style-standard .jet-form-builder__field-wrap .select2-container .select2-selection--single {
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
}

.unified-form-style-standard .jet-form-builder__field-wrap .select2-container--focus .select2-selection,
.unified-form-style-standard .jet-form-builder__field-wrap .select2-container--focus .select2-selection--single {
    border-color: #367C2B !important;
    box-shadow: 0 0 0 3px rgba(54, 124, 43, 0.15) !important;
}

/* Select2 dropdown styling */
.unified-form-style-standard .select2-dropdown {
    border: 2px solid #367C2B !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(54, 124, 43, 0.15) !important;
    background-color: #ffffff !important;
    margin-top: 4px !important;
    z-index: 9999 !important;
}

.unified-form-style-standard .select2-dropdown .select2-results__option {
    padding: 12px 16px !important;
    color: #2c3e50 !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.unified-form-style-standard .select2-dropdown .select2-results__option--highlighted {
    background-color: rgba(54, 124, 43, 0.1) !important;
    color: #367C2B !important;
}

.unified-form-style-standard .select2-dropdown .select2-results__option[aria-selected="true"] {
    background-color: #367C2B !important;
    color: #ffffff !important;
}

/* Select2 search field styling */
.unified-form-style-standard .select2-dropdown .select2-search .select2-search__field {
    border: 2px solid #e1e8ed !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
}

/* Checkbox and Radio styling */
.unified-form-style-standard input[type="checkbox"],
.unified-form-style-standard input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #e1e8ed !important;
    background-color: #ffffff !important;
    margin: 0 12px 0 0 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.unified-form-style-standard input[type="checkbox"] {
    border-radius: 4px !important;
}

.unified-form-style-standard input[type="radio"] {
    border-radius: 50% !important;
}

.unified-form-style-standard input[type="checkbox"]:checked,
.unified-form-style-standard input[type="radio"]:checked {
    background-color: #367C2B !important;
    border-color: #367C2B !important;
}

.unified-form-style-standard input[type="checkbox"]:checked::after {
    content: '✓' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: bold !important;
}

.unified-form-style-standard input[type="radio"]:checked::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 8px !important;
    height: 8px !important;
    background-color: white !important;
    border-radius: 50% !important;
}

/* Checkbox and radio labels - only for individual option labels */
.unified-form-style-standard .checkbox-label,
.unified-form-style-standard .radio-label {
    display: flex !important;
    align-items: center !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    margin-bottom: 0 !important;
    line-height: 1.5 !important;
}

/* Checkbox and radio field wrapper labels - maintain field label styling */
.unified-form-style-standard .jet-form__field-wrap label {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    margin-bottom: 0 !important;
    line-height: 1.5 !important;
}

/* Switch/Toggle styling */
.unified-form-style-standard .jet-form__field--switcher input[type="checkbox"] {
    width: 48px !important;
    height: 24px !important;
    border-radius: 12px !important;
    background-color: #e1e8ed !important;
    border: none !important;
    position: relative !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.unified-form-style-standard .jet-form__field--switcher input[type="checkbox"]:checked {
    background-color: #367C2B !important;
}

.unified-form-style-standard .jet-form__field--switcher input[type="checkbox"]:before {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: white !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.unified-form-style-standard .jet-form__field--switcher input[type="checkbox"]:checked:before {
    transform: translateX(24px) !important;
}

/* File upload styling */
.unified-form-style-standard input[type="file"] {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 2px dashed #e1e8ed !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 14px !important;
    color: #2c3e50 !important;
}

.unified-form-style-standard input[type="file"]:hover {
    border-color: #367C2B !important;
    background-color: rgba(54, 124, 43, 0.05) !important;
}

.unified-form-style-standard input[type="file"]:focus {
    border-color: #367C2B !important;
    box-shadow: 0 0 0 3px rgba(54, 124, 43, 0.15) !important;
    outline: none !important;
}

/* Upload area styling */
.unified-form-style-standard .jet-form__field--media .jet-form__field-wrap {
    border: 2px dashed #e1e8ed !important;
    border-radius: 8px !important;
    padding: 24px !important;
    text-align: center !important;
    background-color: #f8fafc !important;
    transition: all 0.3s ease !important;
}

.unified-form-style-standard .jet-form__field--media .jet-form__field-wrap:hover {
    border-color: #367C2B !important;
    background-color: rgba(54, 124, 43, 0.05) !important;
}

/* Buttons */
.unified-form-style-standard button,
.unified-form-style-standard input[type="submit"],
.unified-form-style-standard input[type="button"],
.unified-form-style-standard .jet-form__submit,
.unified-form-style-standard .elementor-button {
    background-color: #367C2B !important;
    color: white !important;
    border: none !important;
    padding: 16px 32px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
    min-height: auto !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 2px 8px rgba(54, 124, 43, 0.2) !important;
}

.unified-form-style-standard button:hover,
.unified-form-style-standard input[type="submit"]:hover,
.unified-form-style-standard input[type="button"]:hover,
.unified-form-style-standard .jet-form__submit:hover,
.unified-form-style-standard .elementor-button:hover {
    background-color: #2a5f21 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(54, 124, 43, 0.3) !important;
}

.unified-form-style-standard button:active,
.unified-form-style-standard input[type="submit"]:active,
.unified-form-style-standard input[type="button"]:active,
.unified-form-style-standard .jet-form__submit:active,
.unified-form-style-standard .elementor-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(54, 124, 43, 0.2) !important;
}

/* Secondary button styling */
.unified-form-style-standard .button-secondary,
.unified-form-style-standard .btn-secondary {
    background-color: transparent !important;
    color: #367C2B !important;
    border: 2px solid #367C2B !important;
}

.unified-form-style-standard .button-secondary:hover,
.unified-form-style-standard .btn-secondary:hover {
    background-color: #367C2B !important;
    color: white !important;
}

/* Field groups and multi-column layouts */
.unified-form-style-standard .jet-form__field-group {
    display: flex !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

.unified-form-style-standard .jet-form__field-group .jet-form__field {
    flex: 1 !important;
    min-width: 200px !important;
}

/* Error states */
.unified-form-style-standard .jet-form__field--error input,
.unified-form-style-standard .jet-form__field--error textarea,
.unified-form-style-standard .jet-form__field--error select,
.unified-form-style-standard .error input,
.unified-form-style-standard .error textarea,
.unified-form-style-standard .error select {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
}

/* Error messages */
.unified-form-style-standard .jet-form__field-error,
.unified-form-style-standard .error-message {
    color: #e74c3c !important;
    font-size: 13px !important;
    margin-top: 4px !important;
    display: block !important;
    font-weight: 400 !important;
}

/* Success states - removed select styling to prevent persistent green borders */
.unified-form-style-standard .jet-form__field--success input,
.unified-form-style-standard .jet-form__field--success textarea,
.unified-form-style-standard .success input,
.unified-form-style-standard .success textarea {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15) !important;
}

/* Force remove green borders from select elements in all success states */
.unified-form-style-standard .jet-form__field--success select,
.unified-form-style-standard .success select,
.unified-form-style-standard select.jet-form__field--success,
.unified-form-style-standard select.success,
.unified-form-style-standard .jet-form-builder__field-wrap.jet-form__field--success select,
.unified-form-style-standard .jet-form-builder__field-wrap.success select {
    border-color: #e1e8ed !important;
    box-shadow: none !important;
}

/* Force remove green borders from Select2 elements in success states */
.unified-form-style-standard .jet-form__field--success .select2-container .select2-selection,
.unified-form-style-standard .success .select2-container .select2-selection,
.unified-form-style-standard .jet-form-builder__field-wrap.jet-form__field--success .select2-container .select2-selection,
.unified-form-style-standard .jet-form-builder__field-wrap.success .select2-container .select2-selection,
.unified-form-style-standard .select2-container.jet-form__field--success .select2-selection,
.unified-form-style-standard .select2-container.success .select2-selection {
    border-color: #e1e8ed !important;
    box-shadow: none !important;
}

/* MAXIMUM PRIORITY: Override ALL green borders on selects - regardless of source */
body .unified-form-style-standard select:not(:focus),
body .unified-form-style-standard .select2-container:not(.select2-container--focus) .select2-selection,
body .unified-form-style-standard .select2-container:not(.select2-container--focus) .select2-selection--single,
body .unified-form-style-standard .jet-form-builder__field-wrap select:not(:focus),
body .unified-form-style-standard .jet-form-builder__field-wrap .select2-container:not(.select2-container--focus) .select2-selection {
    border-color: #e1e8ed !important;
    border: 2px solid #e1e8ed !important;
    box-shadow: none !important;
}

/* DEBUG: Force red borders to see if CSS is working at all */
/* Temporarily uncomment this section to test if the CSS is being loaded:
body .unified-form-style-standard select,
body .unified-form-style-standard .select2-container .select2-selection {
    border: 3px solid red !important;
    background: yellow !important;
}
*/

/* Success messages */
.unified-form-style-standard .jet-form__message--success,
.unified-form-style-standard .success-message {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
    font-size: 14px !important;
}

/* Loading states */
.unified-form-style-standard .jet-form__submit--loading,
.unified-form-style-standard .loading {
    opacity: 0.7 !important;
    pointer-events: none !important;
}

.unified-form-style-standard .jet-form__submit--loading::after {
    content: '' !important;
    width: 16px !important;
    height: 16px !important;
    border: 2px solid transparent !important;
    border-top: 2px solid white !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    margin-left: 8px !important;
}

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

/* Form validation styling */
.unified-form-style-standard .jet-form__field.required .jet-form__label::after {
    content: ' *' !important;
    color: #e74c3c !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .unified-form-style-standard .jet-form,
    .unified-form-style-standard form {
        padding: 24px 0 !important;
        border-radius: 8px !important;
    }
    
    .unified-form-style-standard .jet-form__row,
    .unified-form-style-standard .form-row,
    .unified-form-style-standard .elementor-field-group {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .unified-form-style-standard .jet-form__field-group {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .unified-form-style-standard .jet-form__field-group .jet-form__field {
        min-width: auto !important;
        margin-bottom: 24px !important;
    }
    
    .unified-form-style-standard button,
    .unified-form-style-standard input[type="submit"],
    .unified-form-style-standard input[type="button"],
    .unified-form-style-standard .jet-form__submit,
    .unified-form-style-standard .elementor-button {
        width: 100% !important;
        padding: 16px !important;
    }

    /* iOS date field fixes */
    .unified-form-style-standard input[type="date"],
    .unified-form-style-standard input[type="datetime-local"],
    .unified-form-style-standard input[type="time"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        min-height: 50px !important;
        height: 50px !important;
        box-sizing: border-box !important;
    }
}

/* Specific iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
    .unified-form-style-standard input[type="date"],
    .unified-form-style-standard input[type="datetime-local"],
    .unified-form-style-standard input[type="time"] {
        -webkit-appearance: none !important;
        min-height: 50px !important;
        height: 50px !important;
        padding: 14px 16px !important;
        line-height: normal !important;
    }
}



/* Print styles */
@media print {
    .unified-form-style-standard .jet-form,
    .unified-form-style-standard form {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: white !important;
    }
    
    .unified-form-style-standard button,
    .unified-form-style-standard input[type="submit"],
    .unified-form-style-standard input[type="button"],
    .unified-form-style-standard .jet-form__submit,
    .unified-form-style-standard .elementor-button {
        display: none !important;
    }
}