/* ==========================================================================
   Zicky — Checklogix landing page chatbot widget
   ========================================================================== */

.checkai-widget {
    --checkai-primary: var(--primary_cl, #000dbb);
    --checkai-secondary: var(--secondary_cl, #0041ff);
    --checkai-gradient: linear-gradient(135deg, var(--checkai-primary), var(--checkai-secondary));
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: "Poppins", "Open Sans", sans-serif;
}

/* ---------- Floating toggle button ---------- */
.checkai-toggle-btn {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    background: var(--checkai-gradient);
    box-shadow: 0 10px 25px rgba(0, 13, 187, 0.35);
    color: #fff;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.checkai-toggle-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 30px rgba(0, 13, 187, 0.45);
}

.checkai-toggle-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.checkai-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.checkai-widget.is-open .checkai-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.checkai-widget.is-open .checkai-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.checkai-ping {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--checkai-gradient);
    opacity: 0.55;
    animation: checkai-ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
    z-index: -1;
}

.checkai-widget.is-open .checkai-ping {
    display: none;
}

@keyframes checkai-ping {
    0% {
        transform: scale(1);
        opacity: 0.55;
    }

    75%,
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

/* ---------- Teaser bubble ---------- */
.checkai-teaser {
    position: absolute;
    right: 74px;
    bottom: 10px;
    width: 250px;
    max-width: 240px;
    background: #fff;
    color: #222;
    padding: 12px 30px 12px 14px;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-size: 13.5px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
}

.checkai-teaser.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.checkai-teaser-close {
    position: absolute;
    top: 4px;
    right: 6px;
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}

.checkai-widget.is-open .checkai-teaser {
    display: none;
}

/* ---------- Chat panel ---------- */
.checkai-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 570px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.checkai-widget.is-open .checkai-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.checkai-header {
    background: var(--checkai-gradient);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.checkai-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.checkai-header-info {
    flex: 1;
    min-width: 0;
}

.checkai-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    font-family: "Poppins", sans-serif;
}

.checkai-header-info span {
    font-size: 12px;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.checkai-dot {
    width: 7px;
    height: 7px;
    background: #35e17c;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.checkai-close-btn {
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.checkai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ---------- Messages ---------- */
.checkai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f5f7fb;
}

.checkai-messages::-webkit-scrollbar {
    width: 6px;
}

.checkai-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 13, 187, 0.2);
    border-radius: 10px;
}

.checkai-msg {
    max-width: 88%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    word-wrap: break-word;
    animation: checkai-fade-in 0.2s ease;
}

.checkai-msg p {
    margin: 0 0 10px;
    color: inherit;
}

.checkai-msg p:last-child {
    margin-bottom: 0;
}

.checkai-msg .checkai-list {
    margin: 8px 0 4px;
    padding-left: 0;
    list-style: none;
}

.checkai-msg .checkai-list li {
    position: relative;
    margin: 0 0 10px;
    padding: 0 0 0 16px;
    line-height: 1.55;
}

.checkai-msg .checkai-list li:last-child {
    margin-bottom: 0;
}

.checkai-msg ul.checkai-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--checkai-primary, #000dbb);
}

.checkai-msg ol.checkai-list {
    counter-reset: checkai-ol;
}

.checkai-msg ol.checkai-list li {
    counter-increment: checkai-ol;
    padding-left: 22px;
}

.checkai-msg ol.checkai-list li::before {
    content: counter(checkai-ol) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--checkai-primary, #000dbb);
}

.checkai-msg .checkai-li-label {
    display: block;
    font-weight: 600;
    color: #0f1a4a;
    margin-bottom: 2px;
}

.checkai-msg .checkai-li-body {
    display: block;
    color: #445;
    font-size: 13.5px;
    line-height: 1.55;
}

.checkai-msg strong {
    font-weight: 600;
    color: #0f1a4a;
}

.checkai-msg.user strong,
.checkai-msg.user .checkai-li-label,
.checkai-msg.user .checkai-li-body {
    color: #fff;
}

.checkai-msg a {
    color: var(--checkai-primary, #000dbb);
    text-decoration: underline;
    word-break: break-word;
}

.checkai-msg.user a {
    color: #fff;
}

@keyframes checkai-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkai-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #2f3447;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.checkai-msg.user {
    align-self: flex-end;
    background: var(--checkai-gradient);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.checkai-msg.error {
    align-self: flex-start;
    background: #fdeaea;
    color: #b3261e;
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.checkai-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.checkai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9aa3c2;
    animation: checkai-bounce 1.2s infinite ease-in-out;
}

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

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

@keyframes checkai-bounce {

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

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

/* Email capture card */
.checkai-email-card {
    align-self: flex-start;
    width: 100%;
    max-width: 92%;
    background: #fff;
    border: 1px solid rgba(0, 13, 187, 0.12);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.checkai-email-card p {
    margin: 0 0 10px;
    font-size: 13.5px;
    color: #2b2b2b;
    line-height: 1.45;
}

.checkai-email-card form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkai-email-card input {
    border: 1px solid #d9deee;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s ease;
}

.checkai-email-card input:focus {
    border-color: var(--checkai-primary);
}

.checkai-email-card button {
    border: none;
    background: var(--checkai-gradient);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.checkai-email-card button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.checkai-email-card .checkai-email-error {
    color: #b3261e;
    font-size: 12px;
    display: none;
}

/* Quick replies */
.checkai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 10px;
    background: #f5f7fb;
    flex-shrink: 0;
}

.checkai-quick-replies:empty {
    display: none;
}

.checkai-chip {
    border: 1px solid rgba(0, 13, 187, 0.25);
    background: #fff;
    color: var(--checkai-primary);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.checkai-chip:hover {
    background: var(--checkai-gradient);
    color: #fff;
    border-color: transparent;
}

/* Input area */
.checkai-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eceef5;
    background: #fff;
    flex-shrink: 0;
}

.checkai-input-area input {
    flex: 1;
    border: 1px solid #d9deee;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13.8px;
    outline: none;
    transition: border-color 0.2s ease;
}

.checkai-input-area input:focus {
    border-color: var(--checkai-primary);
}

.checkai-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--checkai-gradient);
    color: #fff;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.checkai-input-area button:hover {
    transform: scale(1.05);
}

.checkai-input-area button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.checkai-footer-note {
    text-align: center;
    font-size: 10.5px;
    color: #9aa3c2;
    padding-bottom: 8px;
    background: #fff;
    flex-shrink: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 576px) {
    .checkai-widget {
        right: 16px;
        bottom: 16px;
    }

    .checkai-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 110px);
        right: -4px;
    }

    .checkai-teaser {
        max-width: 190px;
        right: 68px;
    }
}
