/**
 * NEX Forms Auto-Fill Styles
 * Optional styles for auto-filled forms
 */

/* Add a subtle indication that the field has been auto-filled */
.nex-forms-form input.autofilled,
.nex-forms-form textarea.autofilled,
.nex-forms-form select.autofilled {
    background-color: #f0f8ff;
    /* Light blue tint */
    transition: background-color 0.3s ease;
}

/* Remove the autofill indicator after user interacts */
.nex-forms-form input.autofilled:focus,
.nex-forms-form textarea.autofilled:focus,
.nex-forms-form select.autofilled:focus {
    background-color: #ffffff;
}

/* Optional: Add a small icon to show data is being saved */
.nex-forms-autofill-indicator {
    display: inline-block;
    margin-left: 5px;
    color: #4CAF50;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nex-forms-autofill-indicator.saving {
    opacity: 1;
}

/* Optional: Message display */
.nex-forms-autofill-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.nex-forms-autofill-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.nex-forms-autofill-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.nex-forms-autofill-message.show {
    display: block;
}


/* Ensure the Same as Shipping checkbox is visible */
#same_as_shipping {
    opacity: 1 !important;
    display: inline-block !important;
    visibility: visible !important;
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    position: static !important;
    margin-right: 10px !important;
    cursor: pointer !important;
    z-index: 10;
}

/* Clean Form Layout Section - Removes need for <br> tags */

/* Wrapper for the entire address block */
.nex-form-address-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    /* Consistent spacing between fields */
    margin-bottom: 20px;
    width: 100%;
}

/* Default to half-width for fields (City, State, Zip, Country) */
.nex-form-address-grid>div,
.nex-form-address-grid>.university-field-wrapper {
    flex: 1 1 calc(50% - 20px);
    width: calc(50% - 20px);
    min-width: 250px;
    /* Wrap on small screens */
    margin: 0 !important;
    /* Override any existing margins */
}

/* Full width for the search/main address field */
.nex-form-address-grid>.full-width-field,
.nex-form-address-grid>.nex-checkbox-row,
.nex-form-address-grid>.address-search-wrapper {
    flex: 1 1 100%;
    width: 100%;
}

/* Checkbox Row Styling */
.nex-checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px !important;
    padding-left: 2px;
}

.nex-checkbox-row input[type="checkbox"] {
    margin-right: 10px !important;
    margin-bottom: 0 !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer;
}

.nex-checkbox-row label {
    margin: 0 !important;
    padding: 0;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.5;
}

/* Input Field Styling Fixes */
.university-field-wrapper {
    position: relative;
    display: block;
}

.university-field-wrapper .fa {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    z-index: 5;
    font-size: 16px;
}

.university-field-wrapper input.form-control,
.university-field-wrapper select.form-control {
    width: 100%;
    padding-left: 45px !important;
    /* Space for the icon */
    height: 50px !important;
    line-height: 50px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}