.jnp-direct-chat-popup,
.jnp-direct-chat-popup * {
    box-sizing: border-box;
}

.jnp-direct-chat-popup {
    --jnp-floating-bg: #25d366;
    --jnp-floating-text: #fff;
    --jnp-header-start: #075e54;
    --jnp-header-end: #128c7e;
    --jnp-header-text: #fff;
    --jnp-body-bg: #fff;
    --jnp-body-text: #172033;
    --jnp-submit-bg: #25d366;
    --jnp-submit-text: #fff;
}

.jnp-direct-chat-popup__floating-button {
    position: fixed;
    bottom: 24px;
    z-index: 9998;
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 66px;
    max-width: min(340px, calc(100vw - 32px));
    padding: 10px 18px 10px 12px;
    border: 0;
    border-radius: 12px;
    background: var(--jnp-floating-bg);
    color: var(--jnp-floating-text);
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    text-align: left;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.jnp-direct-chat-popup--right .jnp-direct-chat-popup__floating-button,
.jnp-direct-chat-popup--right .jnp-direct-chat-popup__dialog {
    right: 24px;
}

.jnp-direct-chat-popup--left .jnp-direct-chat-popup__floating-button,
.jnp-direct-chat-popup--left .jnp-direct-chat-popup__dialog {
    left: 24px;
}

.jnp-direct-chat-popup__floating-button:hover,
.jnp-direct-chat-popup__floating-button:focus-visible {
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
    filter: brightness(0.94);
    transform: translateY(-3px);
}

.jnp-direct-chat-popup__floating-button > svg {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    fill: currentColor;
}

.jnp-direct-chat-popup__floating-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.jnp-direct-chat-popup__floating-copy strong,
.jnp-direct-chat-popup__floating-copy span {
    display: block;
    color: inherit;
    line-height: 1.25;
}

.jnp-direct-chat-popup__floating-copy strong {
    font-size: 13px;
    font-weight: 700;
}

.jnp-direct-chat-popup__floating-copy span {
    font-size: 15px;
    font-weight: 800;
}

.jnp-direct-chat-popup__backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(3px);
}

.jnp-direct-chat-popup__dialog {
    position: fixed;
    bottom: 108px;
    z-index: 9999;
    width: min(420px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    background: var(--jnp-body-bg);
    color: var(--jnp-body-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
    animation: jnp-popup-enter 180ms ease-out;
}

.jnp-direct-chat-popup__header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 22px 22px 18px;
    background: linear-gradient(135deg, var(--jnp-header-start), var(--jnp-header-end));
    color: var(--jnp-header-text);
}

.jnp-direct-chat-popup__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    opacity: 0.78;
    text-transform: uppercase;
}

.jnp-direct-chat-popup__header h2,
.jnp-direct-chat-popup__header p {
    margin: 0;
    color: inherit;
}

.jnp-direct-chat-popup__header h2 {
    font-size: 22px;
    line-height: 1.2;
}

.jnp-direct-chat-popup__header p {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.88;
}

.jnp-direct-chat-popup__close {
    flex: 0 0 auto;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    place-items: center;
}

.jnp-direct-chat-popup__form {
    display: grid;
    gap: 14px;
    padding: 20px 22px 22px;
    background: var(--jnp-body-bg);
    color: var(--jnp-body-text);
}

.jnp-direct-chat-popup__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.jnp-direct-chat-popup__field {
    display: grid;
    gap: 6px;
    margin: 0;
}

.jnp-direct-chat-popup__field span {
    color: var(--jnp-body-text);
    font-size: 13px;
    font-weight: 700;
}

.jnp-direct-chat-popup__field strong {
    color: #dc2626;
}

.jnp-direct-chat-popup__field input,
.jnp-direct-chat-popup__field textarea {
    width: 100%;
    margin: 0;
    border: 1px solid #d8dee8;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.jnp-direct-chat-popup__field input {
    min-height: 44px;
    padding: 0 12px;
}

.jnp-direct-chat-popup__field textarea {
    min-height: 94px;
    padding: 10px 12px;
    resize: vertical;
}

.jnp-direct-chat-popup__field input:focus,
.jnp-direct-chat-popup__field textarea:focus {
    border-color: var(--jnp-header-end);
    box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.14);
}

.jnp-direct-chat-popup__field input[aria-invalid="true"],
.jnp-direct-chat-popup__field textarea[aria-invalid="true"] {
    border-color: #dc2626;
}

.jnp-direct-chat-popup__error {
    margin: 0;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
}

.jnp-direct-chat-popup__submit {
    display: flex;
    gap: 9px;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--jnp-submit-bg);
    color: var(--jnp-submit-text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: filter 160ms ease, transform 160ms ease;
}

.jnp-direct-chat-popup__submit:hover,
.jnp-direct-chat-popup__submit:focus-visible {
    filter: brightness(0.94);
    transform: translateY(-1px);
}

.jnp-direct-chat-popup__submit svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

body.jnp-direct-chat-popup-is-open {
    overflow: hidden;
}

@keyframes jnp-popup-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

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

@media (max-width: 540px) {
    .jnp-direct-chat-popup__floating-button {
        bottom: 16px;
        min-height: 60px;
        padding: 9px 14px 9px 10px;
    }

    .jnp-direct-chat-popup--right .jnp-direct-chat-popup__floating-button,
    .jnp-direct-chat-popup--right .jnp-direct-chat-popup__dialog {
        right: 16px;
    }

    .jnp-direct-chat-popup--left .jnp-direct-chat-popup__floating-button,
    .jnp-direct-chat-popup--left .jnp-direct-chat-popup__dialog {
        left: 16px;
    }

    .jnp-direct-chat-popup__floating-button > svg {
        width: 40px;
        height: 40px;
    }

    .jnp-direct-chat-popup__floating-copy strong {
        font-size: 12px;
    }

    .jnp-direct-chat-popup__floating-copy span {
        font-size: 13px;
    }

    .jnp-direct-chat-popup__dialog {
        bottom: 94px;
        width: calc(100vw - 32px);
        max-height: calc(100vh - 112px);
        overflow-y: auto;
    }

    .jnp-direct-chat-popup__grid {
        grid-template-columns: 1fr;
    }
}
