/* =========================================================
   GLOBAL DEBT CONSOLIDATION LEAD CHAT WIDGET
   Premium Fintech UI
========================================================= */

.lead-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: Inter, sans-serif;
}


/* =========================================================
   FLOATING BUTTON
========================================================= */

.lead-chat-toggle {
    display: flex;
    align-items: center;
    gap: 10px;

    height: 52px;
    padding: 6px 18px 6px 7px;

    border: 0;
    border-radius: 999px;

    background: linear-gradient(135deg,
            #155EEF 0%,
            #1248C4 100%);

    color: #fff;

    font-family: inherit;
    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 14px 35px rgba(21, 94, 239, .24),
        0 4px 10px rgba(16, 24, 40, .10);

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        opacity .2s ease;
}

.lead-chat-toggle:hover {
    transform: translateY(-2px);

    box-shadow:
        0 18px 40px rgba(21, 94, 239, .28),
        0 5px 12px rgba(16, 24, 40, .12);
}

.lead-chat-toggle-icon {
    width: 39px;
    height: 39px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, .16);

    font-size: 17px;
}

.lead-chat-toggle-text {
    white-space: nowrap;
}

.lead-chat-widget.chat-open .lead-chat-toggle {
    opacity: 0;
    visibility: hidden;
    transform: scale(.85);
}


/* =========================================================
   CHAT WINDOW
========================================================= */

.lead-chat-window {
    position: absolute;

    right: 0;
    bottom: 0;

    width: 460px;
    height: 720px;

    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 35px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #fff;

    border: 1px solid #E4E7EC;
    border-radius: 22px;

    box-shadow:
        0 30px 80px rgba(16, 24, 40, .20),
        0 8px 25px rgba(16, 24, 40, .08);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(20px) scale(.96);

    transform-origin: bottom right;

    transition:
        opacity .22s ease,
        visibility .22s ease,
        transform .22s ease;
}

.lead-chat-widget.chat-open .lead-chat-window {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0) scale(1);
}


/* =========================================================
   HEADER
========================================================= */

.lead-chat-header {
    flex: 0 0 auto;

    min-height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 16px;

    background:
        linear-gradient(135deg,
            #155EEF 0%,
            #1248C4 100%);

    color: #fff;
}

.lead-chat-agent {
    display: flex;
    align-items: center;
    gap: 11px;
}

.lead-chat-avatar {
    position: relative;

    width: 43px;
    height: 43px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border-radius: 50%;

    background: #fff;
    color: #155EEF;

    font-size: 15px;
    font-weight: 800;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, .13);
}

.lead-chat-online {
    position: absolute;

    right: 0;
    bottom: 0;

    width: 11px;
    height: 11px;

    border-radius: 50%;

    background: #12B76A;

    border: 2px solid #fff;
}

.lead-chat-agent-info strong {
    display: block;

    color: #fff;

    font-size: 13px;
    font-weight: 700;

    line-height: 1.35;
}

.lead-chat-agent-info span {
    display: flex;
    align-items: center;
    gap: 5px;

    margin-top: 4px;

    color: rgba(255, 255, 255, .82);

    font-size: 9px;
    font-weight: 500;
}

.lead-chat-agent-info span i {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #7FE8B3;
}

.lead-chat-close {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 50%;

    background: rgba(255, 255, 255, .12);
    color: #fff;

    font-family: inherit;
    font-size: 24px;
    font-weight: 300;

    line-height: 1;

    cursor: pointer;

    transition: background .2s ease;
}

.lead-chat-close:hover {
    background: rgba(255, 255, 255, .22);
}


/* =========================================================
   CHAT MESSAGE AREA
========================================================= */

.lead-chat-messages {
    position: relative;

    flex: 1 1 auto;

    overflow-y: auto;

    padding: 22px 17px 18px;

    background:
        linear-gradient(180deg,
            #F8FAFC 0%,
            #F6F8FB 100%);

    scroll-behavior: smooth;
}

.lead-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.lead-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.lead-chat-messages::-webkit-scrollbar-thumb {
    background: #D0D5DD;
    border-radius: 10px;
}


/* =========================================================
   EXPERT MESSAGE
========================================================= */

.lead-chat-message {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    margin-bottom: 16px;
}

.message-avatar {
    width: 28px;
    height: 28px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #155EEF;
    color: #fff;

    font-size: 9px;
    font-weight: 800;
}

.message-content {
    max-width: 82%;
}

.message-bubble {
    padding: 12px 14px;

    border: 1px solid #EAECF0;
    border-radius: 5px 14px 14px 14px;

    background: #fff;

    color: #344054;

    font-size: 11px;
    line-height: 1.7;

    box-shadow:
        0 2px 7px rgba(16, 24, 40, .035);
}

.message-bubble strong {
    color: #101828;
    font-weight: 700;
}

.message-time {
    display: block;

    margin-top: 4px;
    margin-left: 3px;

    color: #98A2B3;

    font-size: 8px;
}


/* =========================================================
   START OPTIONS
========================================================= */

.lead-chat-start-options {
    display: flex;
    flex-direction: column;
    gap: 10px;

    margin:
        20px 0 8px 37px;
}

.lead-chat-start-option {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 13px 12px;

    border: 1px solid #D9DEE8;
    border-radius: 13px;

    background: #fff;

    text-align: left;

    cursor: pointer;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease,
        background .2s ease;
}

.lead-chat-start-option:hover {
    transform: translateY(-2px);

    border-color: #155EEF;

    background: #fff;

    box-shadow:
        0 8px 20px rgba(21, 94, 239, .10);
}

.lead-chat-start-option.primary {
    border-color: #C9D8FF;

    background:
        linear-gradient(135deg,
            #F8FAFF 0%,
            #EFF4FF 100%);
}

.start-option-icon {
    width: 37px;
    height: 37px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: #E9F0FF;
    color: #155EEF;

    font-size: 14px;
    font-weight: 800;
}

.start-option-icon.status {
    background: #ECFDF3;
    color: #12B76A;
}

.start-option-content {
    min-width: 0;
    flex: 1;
}

.start-option-content strong {
    display: block;

    color: #101828;

    font-size: 11px;
    font-weight: 700;

    line-height: 1.4;
}

.start-option-content small {
    display: block;

    margin-top: 3px;

    color: #667085;

    font-size: 9px;
    font-weight: 400;

    line-height: 1.4;
}

.start-option-arrow {
    flex: 0 0 auto;

    color: #98A2B3;

    font-size: 17px;

    transition:
        color .2s ease,
        transform .2s ease;
}

.lead-chat-start-option:hover .start-option-arrow {
    color: #155EEF;
    transform: translateX(3px);
}


/* =========================================================
   PROGRESS
========================================================= */

.lead-chat-progress {
    flex: 0 0 auto;

    padding: 10px 17px 11px;

    background: #fff;

    border-bottom: 1px solid #EAECF0;
}

.lead-chat-progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 7px;

    color: #667085;

    font-size: 9px;
    font-weight: 600;
}

.lead-chat-progress-top span:last-child {
    color: #155EEF;
    font-weight: 700;
}

.lead-chat-progress-bar {
    width: 100%;
    height: 10px;

    overflow: hidden;

    border-radius: 999px;

    background: #EAECF0;
}

.lead-chat-progress-bar span {
    display: block;

    width: 0;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(90deg,
            #155EEF,
            #12B76A);

    transition: width .3s ease;
}


/* =========================================================
   APPLICATION QUESTION
========================================================= */

#leadChatQuestionArea {
    margin-top: 5px;
}

.lead-chat-question {
    margin-bottom: 12px;
}

.lead-chat-question-text {
    margin:
        0 0 10px 37px;

    color: #101828;

    font-size: 12px;
    font-weight: 700;

    line-height: 1.5;
}

.lead-chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-left: 37px;
}

.lead-chat-option {
    padding: 8px 12px;

    border: 1px solid #D0D5DD;
    border-radius: 999px;

    background: #fff;
    color: #344054;

    font-family: inherit;

    font-size: 10px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.lead-chat-option:hover {
    border-color: #155EEF;

    background: #EFF4FF;
    color: #155EEF;

    transform: translateY(-1px);
}


/* =========================================================
   STATUS CHECK
========================================================= */

.lead-chat-status-step {
    margin-top: 7px;
}

.lead-chat-status-form {
    margin:
        5px 0 18px 37px;
}

.lead-chat-status-form label {
    display: block;

    margin-bottom: 7px;

    color: #344054;

    font-size: 10px;
    font-weight: 700;
}

.lead-chat-status-input-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.lead-chat-status-input-row .lead-chat-input {
    flex: 1;
}

.lead-chat-error {
    display: block;

    min-height: 14px;

    margin-top: 5px;

    color: #D92D20;

    font-size: 9px;
    line-height: 1.4;
}

.lead-chat-change-mobile {
    margin-top: 5px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #667085;

    font-family: inherit;

    font-size: 9px;
    font-weight: 600;

    cursor: pointer;
}

.lead-chat-change-mobile:hover {
    color: #155EEF;
}


/* =========================================================
   INPUT
========================================================= */

.lead-chat-input-area {
    flex: 0 0 auto;

    padding: 11px 14px 12px;

    background: #fff;

    border-top: 1px solid #EAECF0;
}

.lead-chat-input-wrap {
    display: flex;
    align-items: center;

    gap: 7px;
}

.lead-chat-input {
    width: 100%;
    min-width: 0;
    height: 42px;

    padding: 0 13px;

    border: 1px solid #D0D5DD;
    border-radius: 10px;

    background: #fff;

    color: #101828;

    font-family: inherit;

    font-size: 11px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.lead-chat-input::placeholder {
    color: #98A2B3;
}

.lead-chat-input:focus {
    border-color: #155EEF;

    box-shadow:
        0 0 0 3px rgba(21, 94, 239, .09);
}

.lead-chat-send {
    width: 42px;
    height: 42px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 10px;

    background: #155EEF;
    color: #fff;

    font-family: inherit;

    font-size: 18px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.lead-chat-send:hover {
    background: #1248C4;
    transform: translateX(1px);
}

.lead-chat-send:disabled {
    opacity: .5;
    cursor: not-allowed;
}


/* =========================================================
   BACK BUTTON
========================================================= */

.lead-chat-back {
    display: none;

    margin-top: 7px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #667085;

    font-family: inherit;

    font-size: 9px;
    font-weight: 600;

    cursor: pointer;
}

.lead-chat-back.visible {
    display: inline-block;
}

.lead-chat-back:hover {
    color: #155EEF;
}


/* =========================================================
   TYPING
========================================================= */

.lead-chat-typing {
    display: none;
    align-items: center;

    gap: 8px;

    padding:
        0 15px 9px;

    background: #F8FAFC;
}

.lead-chat-typing.visible {
    display: flex;
}

.typing-bubble {
    display: flex;
    align-items: center;
    gap: 3px;

    padding: 10px 12px;

    border: 1px solid #EAECF0;
    border-radius: 4px 12px 12px 12px;

    background: #fff;
}

.typing-bubble span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #98A2B3;

    animation:
        leadChatTyping 1.2s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) {
    animation-delay: .15s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes leadChatTyping {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .45;
    }

    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}


/* =========================================================
   STATUS RESULT
========================================================= */

.lead-chat-status-result {
    margin:
        25px 0 10px;

    padding: 22px 18px;

    border: 1px solid #DDE3EC;
    border-radius: 15px;

    background: #fff;

    text-align: center;

    box-shadow:
        0 8px 25px rgba(16, 24, 40, .05);
}

.status-result-icon {
    width: 48px;
    height: 48px;

    margin: 0 auto 12px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #ECFDF3;
    color: #12B76A;

    font-size: 20px;
    font-weight: 800;
}

.status-result-label {
    display: block;

    color: #12B76A;

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 1px;
}

.lead-chat-status-result h3 {
    margin: 5px 0 3px;

    color: #101828;

    font-size: 17px;
    font-weight: 700;
}

.status-application-id {
    color: #667085;

    font-size: 9px;
}

.status-application-id strong {
    color: #344054;
}

.status-current-box {
    margin: 17px 0 12px;

    padding: 12px;

    border-radius: 10px;

    background: #F8FAFC;
}

.status-current-box span {
    display: block;

    margin-bottom: 5px;

    color: #667085;

    font-size: 8px;
    font-weight: 700;

    letter-spacing: .7px;
}

.status-current-box strong {
    display: inline-block;

    padding: 5px 11px;

    border-radius: 999px;

    background: #EFF4FF;
    color: #155EEF;

    font-size: 10px;
    font-weight: 700;
}

.lead-chat-status-result p {
    margin: 0 0 12px;

    color: #667085;

    font-size: 10px;
    line-height: 1.65;
}

.lead-chat-status-result>small {
    display: block;

    color: #98A2B3;

    font-size: 8px;
}

.lead-chat-status-result>small strong {
    color: #667085;
}


/* =========================================================
   SUCCESS
========================================================= */

.lead-chat-success {
    position: absolute;
    inset: 0;

    z-index: 20;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 35px;

    background: #fff;

    text-align: center;
}

.lead-chat-success[hidden],
.lead-chat-status-result[hidden],
.lead-chat-status-step[hidden],
#leadChatQuestionArea[hidden],
#leadChatInputArea[hidden],
#leadChatProgress[hidden] {
    display: none;
}

.lead-chat-success-icon {
    width: 64px;
    height: 64px;

    margin-bottom: 16px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #ECFDF3;
    color: #12B76A;

    font-size: 28px;
    font-weight: 800;
}

.lead-chat-success h3 {
    margin: 0 0 7px;

    color: #101828;

    font-size: 20px;
}

.lead-chat-success p {
    margin: 0 0 7px;

    color: #344054;

    font-size: 12px;
    font-weight: 600;
}

.lead-chat-success span {
    max-width: 300px;

    color: #667085;

    font-size: 10px;
    line-height: 1.7;
}

.lead-chat-restart {
    margin-top: 20px;

    padding: 10px 18px;

    border: 0;
    border-radius: 9px;

    background: #155EEF;
    color: #fff;

    font-family: inherit;

    font-size: 10px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.lead-chat-restart:hover {
    background: #1248C4;
    transform: translateY(-1px);
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .lead-chat-widget {
        right: 14px;
        bottom: 14px;
        left: 14px;
    }

    .lead-chat-toggle {
        margin-left: auto;
    }

    .lead-chat-window {
        right: 0;
        bottom: 0;

        width: 100%;
        max-width: 100%;

        height: min(680px, calc(100vh - 20px));
        max-height: calc(100vh - 20px);

        border-radius: 18px;
    }

    .lead-chat-messages {
        padding: 18px 13px 14px;
    }

    .lead-chat-start-options {
        margin-left: 35px;
    }

    .message-content {
        max-width: 86%;
    }

    .lead-chat-question-text,
    .lead-chat-options {
        margin-left: 35px;
    }

    .lead-chat-status-form {
        margin-left: 35px;
    }

}


@media (max-width: 420px) {

    .lead-chat-toggle {
        height: 49px;

        padding:
            5px 15px 5px 6px;
    }

    .lead-chat-toggle-icon {
        width: 37px;
        height: 37px;
    }

    .lead-chat-toggle-text {
        font-size: 11px;
    }

    .lead-chat-window {
        height: calc(100vh - 15px);
        max-height: calc(100vh - 15px);

        border-radius: 17px;
    }

    .lead-chat-header {
        min-height: 70px;
        padding: 13px;
    }

    .lead-chat-agent-info strong {
        font-size: 12px;
    }

    .lead-chat-messages {
        padding:
            16px 11px 12px;
    }

    .lead-chat-start-options {
        margin-left: 34px;
    }

    .start-option-content strong {
        font-size: 10px;
    }

    .start-option-content small {
        font-size: 8px;
    }

}