/* Pinflo Assistent — chat-widget styles. Geen build-step, geen CSS-in-JS. */

.pf-chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #FF7636;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 118, 54, 0.35), 0 2px 6px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 9990;
    transition: transform .18s ease, box-shadow .18s ease;
}

.pf-chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 118, 54, 0.45), 0 4px 8px rgba(0,0,0,.12);
}

.pf-chat-launcher:focus-visible {
    outline: 3px solid #1a1a1a;
    outline-offset: 3px;
}

.pf-chat-launcher__icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.pf-chat-launcher__close {
    width: 22px;
    height: 22px;
    position: relative;
}
.pf-chat-launcher__close::before,
.pf-chat-launcher__close::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
}
.pf-chat-launcher__close::before { transform: rotate(45deg); }
.pf-chat-launcher__close::after  { transform: rotate(-45deg); }

.pf-chat-tip {
    position: fixed;
    right: 92px;
    bottom: 34px;
    background: var(--color-white, #fff);
    color: var(--color-text, #0F0E0D);
    padding: 12px 16px 13px;
    border: 1.5px solid var(--color-orange, #FF7636);
    border-radius: var(--radius-lg, 18px);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: 14px;
    line-height: 1.4;
    max-width: 260px;
    z-index: 9989;
    box-shadow: var(--shadow-lg, 0 18px 48px rgba(15, 14, 13, 0.12));
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity .28s var(--easing-out, ease), transform .28s var(--easing-out, ease);
    pointer-events: none;
}
/* Oranje merk-label boven de tip-tekst */
.pf-chat-tip::before {
    content: 'Pinflo-assistent';
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-orange, #FF7636);
}
/* Tekstballon-staart: een wit, oranje-omrand vierkantje (45° gedraaid) dat
   onderaan rechts uit de bubbel steekt en naar de assistent wijst — zo lijkt
   het alsof de Pinflo-assistent praat. */
.pf-chat-tip::after {
    content: '';
    position: absolute;
    right: 24px;
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: var(--color-white, #fff);
    border-right: 1.5px solid var(--color-orange, #FF7636);
    border-bottom: 1.5px solid var(--color-orange, #FF7636);
    border-bottom-right-radius: 4px;
    transform: rotate(45deg);
}
.pf-chat-tip.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.pf-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: 70vh;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.08);
    z-index: 9991;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px) scale(.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.pf-chat-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.pf-chat-header {
    background: #FF7636;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pf-chat-header__title-wrap {
    flex: 1;
    min-width: 0;
}
.pf-chat-header__logo {
    height: 22px;
    width: auto;
    max-width: 200px;
    display: block;
}
.pf-chat-header__sub {
    font-size: 12px;
    opacity: .9;
    margin: 4px 0 0;
}
.pf-chat-header__close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
}
.pf-chat-header__close:hover { background: rgba(255,255,255,.15); }

.pf-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 6px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.pf-chat-msg {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.45;
    word-wrap: break-word;
}
.pf-chat-msg--assistant {
    background: #fff;
    border: 1px solid #ececec;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.pf-chat-msg--user {
    background: #FF7636;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.pf-chat-msg--system {
    background: transparent;
    color: #888;
    font-size: 12px;
    text-align: center;
    max-width: 100%;
    padding: 4px;
}
.pf-chat-msg strong { font-weight: 700; }
.pf-chat-msg a { color: inherit; text-decoration: underline; }
.pf-chat-msg--user a { color: #fff; }
.pf-chat-msg ul { margin: 6px 0 0; padding-left: 18px; }
.pf-chat-msg li { margin: 2px 0; }

.pf-chat-typing {
    display: inline-flex;
    gap: 4px;
    align-self: flex-start;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}
.pf-chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FF7636;
    opacity: .35;
    animation: pf-chat-dot 1.2s infinite ease-in-out;
}
.pf-chat-typing span:nth-child(2) { animation-delay: .15s; }
.pf-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pf-chat-dot {
    0%, 60%, 100% { transform: scale(1); opacity: .35; }
    30% { transform: scale(1.4); opacity: 1; }
}

.pf-chat-quickreplies {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0 8px;
}
.pf-chat-qr {
    background: #fff;
    border: 1px solid #FF7636;
    color: #FF7636;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    line-height: 1.3;
    font-family: inherit;
    transition: background .15s ease, color .15s ease;
}
.pf-chat-qr:hover { background: #FF7636; color: #fff; }

.pf-chat-handoff {
    background: #fff8f3;
    border: 1px solid #ffd5be;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
}
.pf-chat-handoff__label {
    font-size: 13px;
    color: #555;
    margin: 0;
}
.pf-chat-handoff__row {
    display: flex;
    gap: 6px;
}
.pf-chat-handoff__input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}
.pf-chat-handoff__input:focus {
    outline: none;
    border-color: #FF7636;
}
.pf-chat-handoff__send {
    background: #FF7636;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.pf-chat-handoff__send:disabled {
    opacity: .5;
    cursor: wait;
}

.pf-chat-footer {
    border-top: 1px solid #ececec;
    padding: 10px 12px;
    background: #fff;
}
.pf-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.pf-chat-input {
    flex: 1;
    border: 1px solid #d4d4d4;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14.5px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    max-height: 100px;
    min-height: 38px;
    outline: none;
}
.pf-chat-input:focus { border-color: #FF7636; }
.pf-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #FF7636;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}
.pf-chat-send:disabled { opacity: .5; cursor: not-allowed; }
.pf-chat-send svg { width: 18px; height: 18px; }

.pf-chat-legal {
    text-align: center;
    font-size: 11px;
    color: #999;
    margin: 6px 0 0;
}
.pf-chat-legal a { color: inherit; }

@media (max-width: 480px) {
    .pf-chat-launcher { right: 16px; bottom: 16px; width: 52px; height: 52px; }
    .pf-chat-panel {
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 90vh;
        height: 90vh;
        border-radius: 16px 16px 0 0;
    }
    .pf-chat-tip { display: none; }
}
