/* V8Loans Form Overrides - Targeting Actual Form Classes */

/* Safari/iOS iframe fix: reinforce display:none set by the form library's JS.
   Without this, Safari can visually ignore an inline display:none when author
   !important rules exist on the same element, leaving previous steps visible. */
#embdFormContainer [style*="display: none"],
#embdFormContainer [style*="display:none"] {
    display: none !important;
    visibility: hidden !important;
}

/* Remove wrapper styling */
#embdFormContainer,
#embdFormContainer > .applicationFromOuter,
#embdFormContainer .applicationFromWraper {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* PROGRESS BAR WRAPPER - kill the original border-bottom bar layout */
#embdFormContainer .applicationFromWraper .progressBarWrap,
#embdFormContainer .progressBarWrap {
    padding: 0 !important;
    margin: 0 0 1rem 0 !important;
}

#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar,
#embdFormContainer .progressBarWrap .progressBar,
#embdFormContainer .max_cash_emebed_progress_bar,
#embdFormContainer #max_cash_emebed_progress_bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    background: #f5f5f5 !important;
    border: none !important;
    border-bottom: none !important;
    border-radius: 0.5rem !important;
    min-height: unset !important;
    list-style: none !important;
    box-sizing: border-box !important;
}

/* Progress bar step items */
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep,
#embdFormContainer .progressBar .pbStep,
#embdFormContainer #pbStep1,
#embdFormContainer #pbStep2,
#embdFormContainer #pbStep3,
#embdFormContainer #pbStep4 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0.25rem !important;
    text-align: center !important;
    float: none !important;
    width: auto !important;
}

/* Step number circles - target both .stepNum and .stepNo */
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep .stepNo,
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep .stepNum,
#embdFormContainer .progressBar .pbStep .stepNo,
#embdFormContainer .progressBar .pbStep .stepNum,
#embdFormContainer .stepNum,
#embdFormContainer .stepNo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    background: #fff !important;
    color: #999 !important;
    border: 2px solid #ddd !important;
    border-radius: 50% !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    transition: all 0.2s !important;
    float: none !important;
}

/* Active step circle */
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep.active .stepNo,
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep.active .stepNum,
#embdFormContainer .pbStep.active .stepNo,
#embdFormContainer .pbStep.active .stepNum,
#embdFormContainer #pbStep1.active .stepNo,
#embdFormContainer #pbStep2.active .stepNo,
#embdFormContainer #pbStep3.active .stepNo,
#embdFormContainer #pbStep4.active .stepNo,
#embdFormContainer #pbStep1.active .stepNum,
#embdFormContainer #pbStep2.active .stepNum,
#embdFormContainer #pbStep3.active .stepNum,
#embdFormContainer #pbStep4.active .stepNum {
    background: #004D2C !important;
    color: #fff !important;
    border-color: #004D2C !important;
}

/* Done/completed step circle */
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep.done .stepNo,
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep.done .stepNum,
#embdFormContainer .pbStep.done .stepNo,
#embdFormContainer .pbStep.done .stepNum {
    background: #004D2C !important;
    color: #fff !important;
    border-color: oklch(0.65 0.18 140) !important;
}

/* Step labels - target both .stepLbl and .stepTxt */
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep .stepTxt,
#embdFormContainer .applicationFromWraper .progressBarWrap .progressBar .pbStep .stepLbl,
#embdFormContainer .progressBar .pbStep .stepTxt,
#embdFormContainer .progressBar .pbStep .stepLbl,
#embdFormContainer .stepLbl,
#embdFormContainer .stepTxt {
    display: block !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    color: #555 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

/* Active step label */
#embdFormContainer .pbStep.active .stepTxt,
#embdFormContainer .pbStep.active .stepLbl {
    color: #004D2C !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
}

/* Form inputs */
#embdFormContainer input[type="text"],
#embdFormContainer input[type="email"],
#embdFormContainer input[type="tel"],
#embdFormContainer input[type="number"],
#embdFormContainer input[type="password"],
#embdFormContainer select,
#embdFormContainer textarea {
    width: 100% !important;
    background: #fafafa !important;
    border: 1px solid #ebebeb !important;
    border-radius: 0.5rem !important;
    padding: 0.625rem 0.875rem !important;
    font-family: 'Poppins', 'Inter', Arial, sans-serif !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    color: #2e2e2e !important;
    box-shadow: none !important;
    outline: none !important;
    transition: border 0.2s, box-shadow 0.2s !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    /* Safari/iOS: disable native input chrome so custom borders render correctly */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

#embdFormContainer input:focus,
#embdFormContainer select:focus,
#embdFormContainer textarea:focus {
    border-color: oklch(0.65 0.18 140) !important;
    box-shadow: 0 0 0 2px oklch(0.65 0.18 140 / 0.2) !important;
}

/* Labels */
#embdFormContainer label {
    font-family: 'Poppins', 'Inter', Arial, sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: #2e2e2e !important;
    margin: 0 0 0.4rem 0 !important;
    display: block !important;
}

/* Buttons */
#embdFormContainer button,
#embdFormContainer .btn,
#embdFormContainer #mx_submit,
#embdFormContainer #next_btn_step_1,
#embdFormContainer #previous_btn_step_1 {
    width: 100% !important;
    background: #004D2C !important;
    color: white !important;
    border: none !important;
    border-radius: 0.5rem !important;
    padding: 0.65rem 1.5rem !important;
    font-family: 'Poppins', 'Inter', Arial, sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

#embdFormContainer button:hover {
    background: #006B3D !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

#embdFormContainer #previous_btn_step_1 {
    background: #f5f5f5 !important;
    color: #2e2e2e !important;
}

#embdFormContainer #previous_btn_step_1:hover {
    background: #e8e8e8 !important;
}

/* Form layout */
#embdFormContainer .row {
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
}

#embdFormContainer .col,
#embdFormContainer [class*="col-"] {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

#embdFormContainer .form-group {
    margin-bottom: 1rem !important;
}

/* Step containers */
#embdFormContainer #max_cash_embeded_form_step_1,
#embdFormContainer #max_cash_embeded_form_step_2 {
    padding: 0 !important;
}

#embdFormContainer .appFormPage {
    padding: 0 !important;
}

/* Hide d-none */
#embdFormContainer .d-none {
    display: none !important;
}

/* Error/Success messages */
#embdFormContainer .alertWrap {
    margin-bottom: 1rem !important;
}

#embdFormContainer .alert {
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
}

/* Override the external form's gradient button */
#embdFormContainer .applicationFromWraper .appFormBody .appFormPage .appFormPageFooter .btnWrap .btn,
#embdFormContainer .applicationFromWraper .appFormPageFooter .btnWrap .btn,
#embdFormContainer .btnWrap .btn {
    background: #004D2C !important;
    background-image: none !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 1.5rem !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    box-shadow: 0 1px 3px rgba(0, 77, 44, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
}

#embdFormContainer .applicationFromWraper .appFormBody .appFormPage .appFormPageFooter .btnWrap .btn:focus-visible,
#embdFormContainer .applicationFromWraper .appFormPageFooter .btnWrap .btn:focus-visible,
#embdFormContainer .btnWrap .btn:focus-visible {
    outline: 3px solid #004D2C !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(0, 77, 44, 0.25) !important;
}

#embdFormContainer .applicationFromWraper .appFormBody .appFormPage .appFormPageFooter .btnWrap .btn:hover,
#embdFormContainer .applicationFromWraper .appFormPageFooter .btnWrap .btn:hover,
#embdFormContainer .btnWrap .btn:hover {
    background: #006B3D !important;
    background-image: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(0, 77, 44, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

/* Responsive */
@media (max-width: 768px) {
    #embdFormContainer .applicationFromWraper .progressBarWrap .progressBar,
    #embdFormContainer .progressBarWrap .progressBar,
    #embdFormContainer .max_cash_emebed_progress_bar {
        padding: 0.5rem 0.25rem !important;
    }

    #embdFormContainer .stepNum,
    #embdFormContainer .stepNo {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        font-size: 0.7rem !important;
    }

    #embdFormContainer .stepLbl,
    #embdFormContainer .stepTxt {
        font-size: 0.55rem !important;
    }

    #embdFormContainer .row {
        margin: 0 !important;
    }

    #embdFormContainer .col,
    #embdFormContainer [class*="col-"] {
        padding: 0 0 0.5rem 0 !important;
    }
}
