/*
 * De chat rechtsonder (templates/partials/chat.php, assets/js/chat.js). Losse stijl, zonder Tailwind of Bootstrap,
 * zodat hij op de pagina's met de nieuwe en de oude opmaak hetzelfde oogt. Kleuren uit het logo.
 */

.bkc {
    --bkc-ink: #1b1e20;
    --bkc-ink-2: #3d4246;
    --bkc-mute: #5e666d;
    --bkc-faint: #6b737a;
    --bkc-line: #e9ecef;
    --bkc-mist: #f7f8fa;
    --bkc-blue: #2a8ae2;
    --bkc-blue-deep: #1a69b8;
    --bkc-blue-50: #f0f6fd;
    --bkc-radius: 22px;
    -webkit-font-smoothing: antialiased;
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    color: var(--bkc-ink);
    font-family: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    position: fixed;
    right: 1.25rem;
    z-index: 1070;
}

.bkc *,
.bkc *::before,
.bkc *::after {
    box-sizing: border-box;
}

.bkc button,
.bkc input,
.bkc textarea {
    font: inherit;
}

.bkc [hidden] {
    display: none !important;
}

.bkc-sr {
    clip: rect(0 0 0 0);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* ---- De knop ---- */

.bkc-launch {
    align-items: center;
    background: var(--bkc-ink);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 14px 34px -12px rgba(16, 24, 40, .55), 0 2px 6px rgba(16, 24, 40, .18);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 14.5px;
    font-weight: 600;
    gap: .55rem;
    height: 52px;
    margin-left: auto;
    padding: 0 1.15rem 0 .55rem;
    position: relative;
    transition: transform .2s cubic-bezier(.2, .8, .2, 1), background-color .15s;
}

.bkc-launch:hover {
    background: #000;
    transform: translateY(-2px);
}

.bkc-launch:focus-visible {
    outline: 3px solid rgba(42, 138, 226, .45);
    outline-offset: 3px;
}

.bkc-launch-icon {
    align-items: center;
    background: var(--bkc-blue);
    border-radius: 999px;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.bkc-i-close,
.bkc.is-open .bkc-i-chat {
    display: none;
}

.bkc.is-open .bkc-i-close {
    display: block;
}

.bkc-launch-dot {
    background: #3ddc84;
    border: 2px solid var(--bkc-ink);
    border-radius: 999px;
    height: 12px;
    left: 38px;
    position: absolute;
    top: 7px;
    width: 12px;
}

.bkc.is-open .bkc-launch {
    padding-right: .55rem;
}

.bkc.is-open .bkc-launch-text,
.bkc.is-open .bkc-launch-dot {
    display: none;
}

.bkc.is-raised {
    bottom: calc(max(1.25rem, env(safe-area-inset-bottom, 0px)) + var(--bkc-raise, 0px));
}

/* ---- Het paneel ---- */

.bkc-panel {
    animation: bkc-in .28s cubic-bezier(.2, .8, .2, 1) both;
    background: #fff;
    border: 1px solid var(--bkc-line);
    border-radius: var(--bkc-radius);
    bottom: 64px;
    box-shadow: 0 30px 70px -20px rgba(16, 24, 40, .45), 0 4px 14px rgba(16, 24, 40, .1);
    display: flex;
    flex-direction: column;
    height: min(640px, calc(100vh - 120px));
    overflow: hidden;
    position: absolute;
    right: 0;
    transform-origin: bottom right;
    width: 384px;
}

@keyframes bkc-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: none; }
}

.bkc-head {
    align-items: center;
    background: radial-gradient(120% 140% at 100% 0%, rgba(42, 138, 226, .28), transparent 55%), var(--bkc-ink);
    color: #fff;
    display: flex;
    flex: none;
    gap: .75rem;
    padding: 1rem 1rem 1rem 1.1rem;
}

.bkc-avatar {
    align-items: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    color: #bfdaf6;
    display: inline-flex;
    flex: none;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.bkc-head-text {
    flex: 1;
    min-width: 0;
}

.bkc .bkc-title {
    color: #fff;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -.01em;
    line-height: 1.2;
    margin: 0;
}

.bkc .bkc-sub {
    align-items: center;
    color: rgba(255, 255, 255, .62);
    display: flex;
    font-size: 12.5px;
    gap: .4rem;
    margin: .15rem 0 0;
}

.bkc-online {
    background: #3ddc84;
    border-radius: 999px;
    box-shadow: 0 0 0 3px rgba(61, 220, 132, .2);
    height: 7px;
    width: 7px;
}

.bkc-icon-btn {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    flex: none;
    height: 36px;
    justify-content: center;
    opacity: .8;
    transition: background-color .15s, opacity .15s;
    width: 36px;
}

.bkc-icon-btn:hover {
    background: rgba(127, 127, 127, .14);
    opacity: 1;
}

.bkc-body {
    background: var(--bkc-mist);
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.1rem 1rem .5rem;
    scroll-behavior: smooth;
}

.bkc-log {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.bkc-msg {
    animation: bkc-msg .22s ease-out both;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.5;
    max-width: 88%;
    overflow-wrap: anywhere;
    padding: .65rem .9rem;
}

@keyframes bkc-msg {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.bkc .bkc-msg p {
    margin: 0;
}

.bkc .bkc-msg p + p,
.bkc .bkc-msg p + ul,
.bkc .bkc-msg ul + p {
    margin-top: .5rem;
}

.bkc .bkc-msg ul {
    list-style: disc;
    margin: 0;
    padding-left: 1.15rem;
}

.bkc .bkc-msg li + li {
    margin-top: .15rem;
}

.bkc-bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--bkc-line);
    border-bottom-left-radius: 6px;
    color: var(--bkc-ink-2);
}

.bkc-me {
    align-self: flex-end;
    background: var(--bkc-blue);
    border-bottom-right-radius: 6px;
    color: #fff;
}

.bkc .bkc-bot a {
    color: var(--bkc-blue-deep);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(26, 105, 184, .35);
    text-underline-offset: 3px;
}

.bkc .bkc-bot a:hover {
    text-decoration-color: currentColor;
}

.bkc-cta {
    align-self: flex-start;
    background: var(--bkc-ink);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    padding: .5rem .95rem;
}

.bkc-cta:hover {
    background: #000;
}

.bkc-typing {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    padding: .8rem .95rem;
}

.bkc-typing span {
    animation: bkc-dot 1.1s infinite ease-in-out;
    background: var(--bkc-faint);
    border-radius: 999px;
    height: 7px;
    width: 7px;
}

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

@keyframes bkc-dot {
    0%, 60%, 100% { opacity: .35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.bkc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .9rem 0 .4rem;
}

.bkc-chip {
    background: #fff;
    border: 1px solid #dce1e6;
    border-radius: 999px;
    color: var(--bkc-ink);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    padding: .42rem .8rem;
    transition: border-color .15s, background-color .15s, color .15s;
}

.bkc-chip:hover {
    background: var(--bkc-blue-50);
    border-color: #93c2ef;
    color: var(--bkc-blue-deep);
}

/* ---- Typen ---- */

.bkc-form {
    align-items: flex-end;
    background: #fff;
    border-top: 1px solid var(--bkc-line);
    display: flex;
    flex: none;
    gap: .5rem;
    padding: .7rem .75rem .7rem 1rem;
}

.bkc-input {
    background: transparent;
    border: 0;
    color: var(--bkc-ink);
    flex: 1;
    font-size: 15px;
    line-height: 1.45;
    max-height: 120px;
    min-height: 40px;
    outline: none;
    padding: .5rem 0;
    resize: none;
}

.bkc-input::placeholder {
    color: var(--bkc-faint);
}

.bkc-send {
    align-items: center;
    background: var(--bkc-blue);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex: none;
    height: 40px;
    justify-content: center;
    transition: background-color .15s, opacity .15s;
    width: 40px;
}

.bkc-send:hover {
    background: var(--bkc-blue-deep);
}

.bkc-send:disabled {
    cursor: default;
    opacity: .4;
}

.bkc .bkc-foot {
    align-items: center;
    background: #fff;
    color: var(--bkc-faint);
    display: flex;
    flex: none;
    flex-wrap: wrap;
    font-size: 11.5px;
    gap: .25rem .75rem;
    justify-content: space-between;
    margin: 0;
    padding: 0 1rem .75rem;
}

.bkc-link {
    background: none;
    border: 0;
    color: var(--bkc-blue-deep);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    padding: 0;
}

.bkc-link:hover {
    text-decoration: underline;
}

/* ---- Mailen ---- */

.bkc-mail {
    background: #fff;
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    padding: 1rem 1.1rem 1.1rem;
}

.bkc-mail-head {
    align-items: flex-start;
    display: flex;
    gap: .5rem;
    margin: 0 0 .9rem -.4rem;
}

.bkc .bkc-mail-head h3 {
    color: var(--bkc-ink);
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -.01em;
    margin: .35rem 0 .15rem;
}

.bkc .bkc-mail-head p {
    color: var(--bkc-mute);
    font-size: 13.5px;
    margin: 0;
}

.bkc-label {
    color: var(--bkc-ink-2);
    font-size: 13px;
    font-weight: 600;
    margin: .7rem 0 .3rem;
}

.bkc-label span {
    color: var(--bkc-faint);
    font-weight: 400;
}

.bkc-field {
    background: #fff;
    border: 1px solid #dce1e6;
    border-radius: 12px;
    color: var(--bkc-ink);
    font-size: 15px;
    outline: none;
    padding: .6rem .8rem;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}

.bkc-field:focus {
    border-color: var(--bkc-blue);
    box-shadow: 0 0 0 3px rgba(42, 138, 226, .15);
}

textarea.bkc-field {
    min-height: 96px;
    resize: vertical;
}

.bkc-hp {
    height: 0;
    left: -9999px;
    opacity: 0;
    position: absolute;
    width: 0;
}

.bkc .bkc-mail-note {
    color: var(--bkc-faint);
    font-size: 12.5px;
    margin: .6rem 0 0;
}

.bkc .bkc-error {
    background: #fdecec;
    border-radius: 10px;
    color: #a12626;
    font-size: 13.5px;
    margin: .7rem 0 0;
    padding: .55rem .75rem;
}

.bkc-submit {
    background: var(--bkc-ink);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-top: .9rem;
    min-height: 46px;
    transition: background-color .15s;
}

.bkc-submit:hover {
    background: #000;
}

.bkc-submit:disabled {
    cursor: default;
    opacity: .6;
}

/* ---- Telefoon: het paneel vult het scherm, de knop wordt een rondje ---- */

@media (max-width: 560px) {
    .bkc {
        bottom: max(.9rem, env(safe-area-inset-bottom, 0px));
        right: .9rem;
    }

    .bkc-launch {
        height: 56px;
        padding: 0 .5rem;
        width: 56px;
    }

    .bkc-launch-icon {
        height: 44px;
        width: 44px;
    }

    .bkc-launch-text {
        display: none;
    }

    .bkc-launch-dot {
        left: 38px;
        top: 6px;
    }

    .bkc.is-open .bkc-launch {
        display: none;
    }

    .bkc-panel {
        border: 0;
        border-radius: 0;
        bottom: auto;
        height: 100dvh;
        inset: 0;
        position: fixed;
        width: 100%;
    }

    .bkc-head {
        padding-top: max(1rem, env(safe-area-inset-top, 0px));
    }

    .bkc-form {
        padding-bottom: max(.7rem, env(safe-area-inset-bottom, 0px));
    }

    .bkc-input {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bkc-panel,
    .bkc-msg,
    .bkc-typing span {
        animation: none;
    }

    .bkc-launch {
        transition: none;
    }
}

@media print {
    .bkc {
        display: none;
    }
}
