/* Mortgage Global Solutions - Chatbot Popup */
:root {
    --chatbot-primary: #00125c;
    --chatbot-light-blue: #e8eef9;
    --chatbot-border-blue: #b8c9e8;
    --chatbot-text-gray: #6c757d;
    --chatbot-card-highlight: #e8eef9;
}

.chatbot-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 20px;
    padding-bottom: 96px;
    overflow-x: hidden;
}

.chatbot-popup-wrapper.hidden {
    display: none !important;
}

.chatbot-popup {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    min-width: 0;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e8ecf2;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 18, 92, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.chatbot-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chatbot-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, #001a7a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-avatar i {
    font-size: 24px;
    color: #fff;
}

.chatbot-brand h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--chatbot-primary);
    margin: 0;
    line-height: 1.2;
}

.chatbot-brand span {
    font-size: 13px;
    font-weight: 500;
    color: var(--chatbot-primary);
    letter-spacing: 2px;
}

.chatbot-window-controls {
    display: flex;
    gap: 12px;
}

.chatbot-btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--chatbot-primary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-btn-icon:hover {
    background: var(--chatbot-light-blue);
}

/* Body */
.chatbot-body {
    padding: 28px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-width: 0;
}

.chatbot-greeting {
    font-size: 28px;
    font-weight: 700;
    color: var(--chatbot-primary);
    text-align: center;
    margin: 0 0 8px 0;
}

.chatbot-intro {
    font-size: 20px;
    font-weight: 700;
    color: var(--chatbot-primary);
    text-align: center;
    margin: 0 0 8px 0;
}

.chatbot-prompt {
    font-size: 15px;
    color: #777;
    text-align: center;
    margin: 0 0 24px 0;
}

.chatbot-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-width: 0;
}

.chatbot-card {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chatbot-card:hover {
    background: #f0f4fc;
    border-color: var(--chatbot-border-blue);
    box-shadow: 0 2px 6px rgba(0, 18, 92, 0.08);
}

.chatbot-card.highlight {
    background: #e8eef9;
    border-color: var(--chatbot-primary);
    box-shadow: 0 2px 6px rgba(0, 18, 92, 0.1);
}

.chatbot-card-icon-wrap {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #e0efff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-card-icon-wrap i {
    font-size: 20px;
    color: var(--chatbot-primary);
}

.chatbot-card-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chatbot-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 4px 0;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.chatbot-card p {
    font-size: 12px;
    color: var(--chatbot-text-gray);
    margin: 0;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Footer input - inside box design like image */
.chatbot-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
}

.chatbot-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 0 4px 0 16px;
    border: 1px solid #eee;
}

.chatbot-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 8px 14px 0;
    font-size: 15px;
    color: #333;
    outline: none;
}

.chatbot-input-wrap input::placeholder {
    color: #999;
}

.chatbot-input-wrap .chatbot-attach,
.chatbot-input-wrap .chatbot-mic {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send {
    background: #6c9afe;
    color: #fff;
    border: none;
    padding: 14px 26px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.chatbot-send:hover {
    background: #5a89f5;
    color: #fff;
}

/* Floating Chatbot Button - Fixed bottom right, always visible */
.chatbot-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 18, 92, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s;
}

.chatbot-float-btn:hover {
    background: #001a7a;
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 18, 92, 0.5);
}

.chatbot-float-btn i {
    font-size: 28px;
}

.chatbot-float-btn .chatbot-float-text {
    position: absolute;
    right: 100%;
    margin-right: 12px;
    white-space: nowrap;
    background: var(--chatbot-primary);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.chatbot-float-btn:hover .chatbot-float-text {
    opacity: 1;
    visibility: visible;
}

/* Legacy - keep for any inline buttons */
.chatbot-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--chatbot-primary);
    color: #fff;
    border: none;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.chatbot-footer-btn:hover {
    background: #001a7a;
    color: #fff;
}

.chatbot-footer-btn i {
    font-size: 20px;
}

/* 6-button grid - 1 column */
.chatbot-cards-6 {
    grid-template-columns: 1fr;
}

/* Step visibility */
.chatbot-step {
    display: block;
}

.chatbot-step.hidden {
    display: none !important;
}

/* Lead capture form */
.chatbot-lead-title,
.chatbot-flow-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--chatbot-primary);
    text-align: center;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.chatbot-lead-form {
    max-width: 400px;
    margin: 0 auto;
}

.chatbot-form-group {
    margin-bottom: 16px;
}

.chatbot-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--chatbot-primary);
    margin-bottom: 6px;
}

.chatbot-form-group label i {
    margin-right: 8px;
    opacity: 0.8;
}

.chatbot-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--chatbot-border-blue);
    border-radius: 8px;
    font-size: 15px;
    color: var(--chatbot-primary);
}

.chatbot-input::placeholder {
    color: var(--chatbot-text-gray);
}

.chatbot-select {
    cursor: pointer;
    background: #fff;
}

.chatbot-send-btn {
    width: 100%;
    margin-top: 8px;
    padding: 14px 24px;
    background: var(--chatbot-primary);
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

.chatbot-send-btn:hover {
    background: #001a7a;
    color: #fff;
}

/* Option buttons (Buy/Refinance/Invest) */
.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.chatbot-option-btn {
    padding: 14px 20px;
    background: #fff;
    border: 2px solid var(--chatbot-border-blue);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--chatbot-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-option-btn:hover {
    background: var(--chatbot-light-blue);
    border-color: var(--chatbot-primary);
}

/* Chat view - Talk to Expert */
.chatbot-chat-view {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    height: 100%;
    min-height: 320px;
}

.chatbot-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin: 0 0 12px 0;
    background: transparent;
    border: 1px solid var(--chatbot-border-blue);
    border-radius: 6px;
    color: var(--chatbot-primary);
    font-size: 12px;
    cursor: pointer;
    align-self: flex-start;
}

.chatbot-back-btn:hover {
    background: var(--chatbot-light-blue);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-msg-user {
    align-self: flex-end;
    background: var(--chatbot-primary);
    color: #fff;
}

.chatbot-msg-bot {
    align-self: flex-start;
    background: #f5f5f5;
    color: #333;
}

.chatbot-msg-call a {
    color: var(--chatbot-primary);
    font-weight: 600;
    text-decoration: none;
}

.chatbot-msg-call a:hover {
    text-decoration: underline;
}

.chatbot-view.hidden {
    display: none !important;
}

/* Pre-approval flow */
.chatbot-preapproval-view {
    padding: 8px 24px 20px;
    display: flex;
    flex-direction: column;
}

.chatbot-pa-step {
    display: block;
}

.chatbot-pa-step.hidden {
    display: none !important;
}

.chatbot-pa-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--chatbot-primary);
    text-align: center;
    margin: 0 0 12px 0;
}

.chatbot-pa-question {
    font-size: 15px;
    color: var(--chatbot-text-gray);
    text-align: center;
    margin: 0 0 20px 0;
}

.chatbot-pa-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.chatbot-pa-option {
    padding: 14px 20px;
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--chatbot-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-pa-option:hover {
    background: var(--chatbot-light-blue);
    border-color: var(--chatbot-border-blue);
}

.chatbot-pa-form {
    max-width: 400px;
    margin: 0 auto;
}

.chatbot-pa-form .chatbot-form-group {
    margin-bottom: 14px;
}

.chatbot-send-btn .pa-submit-loader,
.chatbot-send-btn .pa-submit-text {
    display: inline-block;
}

.chatbot-send-btn .pa-submit-loader.hidden,
.chatbot-send-btn .pa-submit-text.hidden {
    display: none !important;
}

.chatbot-send-btn .pa-submit-loader i {
    margin-right: 8px;
}

.chatbot-send-btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

/* Today's Rates view */
.chatbot-rates-view {
    padding: 8px 24px 20px;
    display: flex;
    flex-direction: column;
}

.chatbot-rates-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--chatbot-text-gray);
}

.chatbot-rates-loading i {
    margin-right: 8px;
}

.chatbot-rates-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--chatbot-primary);
    text-align: center;
    margin: 0 0 8px 0;
}

.chatbot-rates-subtitle {
    font-size: 14px;
    color: var(--chatbot-text-gray);
    text-align: center;
    margin: 0 0 20px 0;
}

.chatbot-rates-tbl {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.chatbot-rates-tbl th,
.chatbot-rates-tbl td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.chatbot-rates-tbl th {
    background: var(--chatbot-light-blue);
    color: var(--chatbot-primary);
    font-weight: 600;
}

.chatbot-rates-tbl .rates-note {
    font-size: 12px;
    color: var(--chatbot-text-gray);
    font-weight: 400;
}

.chatbot-rates-disclaimer {
    font-size: 12px;
    color: var(--chatbot-text-gray);
    text-align: center;
    margin: 0;
}

/* Affordability Calculator */
.chatbot-afford-view {
    padding: 8px 24px 20px;
    display: flex;
    flex-direction: column;
}

.chatbot-afford-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--chatbot-primary);
    text-align: center;
    margin: 0 0 6px 0;
}

.chatbot-afford-subtitle {
    font-size: 14px;
    color: var(--chatbot-text-gray);
    text-align: center;
    margin: 0 0 20px 0;
}

.chatbot-afford-form {
    max-width: 400px;
    margin: 0 auto 20px;
}

.chatbot-afford-form .chatbot-form-group {
    margin-bottom: 14px;
}

.chatbot-afford-result {
    margin-top: 20px;
}

.afford-result-box {
    background: var(--chatbot-light-blue);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: center;
}

.afford-result-label {
    font-size: 13px;
    color: var(--chatbot-text-gray);
    margin: 0 0 6px 0;
}

.afford-result-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--chatbot-primary);
    margin: 0;
}

.chatbot-afford-disclaimer {
    font-size: 12px;
    color: var(--chatbot-text-gray);
    text-align: center;
    margin: 12px 0 0 0;
}

/* Investor & Commercial Loans - Talk to Team */
.chatbot-investor-view {
    padding: 8px 24px 20px;
    display: flex;
    flex-direction: column;
}

.chatbot-investor-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--chatbot-primary);
    text-align: center;
    margin: 0 0 16px 0;
}

.chatbot-investor-msg {
    font-size: 15px;
    color: var(--chatbot-text-gray);
    text-align: center;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.chatbot-investor-contact {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chatbot-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--chatbot-light-blue);
    border-radius: 10px;
    color: var(--chatbot-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.chatbot-contact-item:hover {
    background: var(--chatbot-primary);
    color: #fff;
}

.chatbot-contact-item i {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 767px) {
    .chatbot-popup-wrapper {
        padding: 12px;
        padding-bottom: 80px;
        align-items: flex-end;
        justify-content: center;
    }
    .chatbot-popup {
        max-width: 100%;
        max-height: 88vh;
    }
    .chatbot-cards,
    .chatbot-cards-6 {
        gap: 10px;
    }
    .chatbot-card { padding: 12px 14px; }
    .chatbot-card-icon-wrap { width: 40px; height: 40px; min-width: 40px; }
    .chatbot-card h4 { font-size: 14px; }
    .chatbot-card p { font-size: 11px; }
    .chatbot-greeting { font-size: 20px; }
    .chatbot-intro { font-size: 15px; }
    .chatbot-prompt { font-size: 14px; }
    .chatbot-header { padding: 16px 18px; }
    .chatbot-brand h2 { font-size: 18px; }
    .chatbot-body { padding: 20px 18px; }
    .chatbot-footer { padding: 12px 18px 16px; }
    .chatbot-float-btn {
        bottom: 14px;
        right: 14px;
        width: 52px;
        height: 52px;
    }
    .chatbot-float-btn i { font-size: 22px; }
    .chatbot-float-btn .chatbot-float-text { display: none; }
}

