.alfalead-chat,
.alfalead-floating {
    --alfalead-primary: #ea2323;
    --alfalead-panel: rgba(44, 44, 48, 0.68);
    --alfalead-surface: rgba(255, 255, 255, 0.12);
    --alfalead-surface-strong: rgba(255, 255, 255, 0.17);
    --alfalead-border: rgba(255, 255, 255, 0.3);
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0;
}

.alfalead-chat {
    display: grid;
    gap: 48px;
    align-items: start;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    text-align: left;
}

.alfalead-chat--section {
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
}

.alfalead-chat--widget {
    max-width: 560px;
    grid-template-columns: 1fr;
}

.alfalead-chat__eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--alfalead-primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.alfalead-chat__title.primary-font-title {
    margin-bottom: 18px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 42px;
    font-stretch: normal;
    font-weight: 600;
    line-height: 1.12;
    text-transform: none;
}

.alfalead-chat__text {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.65;
}

.alfalead-chat__panel {
    overflow: hidden;
    border: 1px solid var(--alfalead-border);
    border-radius: 24px;
    background: var(--alfalead-panel);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    backdrop-filter: blur(24px) saturate(135%);
}

.alfalead-chat__demo-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(234, 35, 35, 0.1);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.45;
}

.alfalead-chat__demo-note i {
    flex: 0 0 auto;
    color: var(--alfalead-primary);
}

.alfalead-chat--floating .alfalead-chat__panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 32px);
}

.alfalead-chat__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.alfalead-chat--floating .alfalead-chat__header {
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 auto;
    background: rgba(48, 48, 52, 0.58);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}

.alfalead-chat__header > div:first-child {
    display: flex;
    align-items: center;
    gap: 11px;
}

.alfalead-chat__header small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
}

.alfalead-chat__header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alfalead-chat__status {
    font-size: 14px;
    font-weight: 600;
}

.alfalead-chat__status-dot {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-right: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.alfalead-chat__status-dot::before {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #39d98a;
    box-shadow: 0 0 0 5px rgba(57, 217, 138, 0.13);
    content: '';
}

.alfalead-chat__messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    max-height: 430px;
    overflow-y: auto;
    padding: 20px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.alfalead-chat__message {
    max-width: 82%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.alfalead-chat__message--assistant,
.alfalead-chat__message--typing {
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    background: var(--alfalead-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.alfalead-chat__message--system {
    align-self: flex-start;
    border-left: 2px solid var(--alfalead-primary);
    background: rgba(234, 35, 35, 0.1);
    color: rgba(255, 255, 255, 0.84);
}

.alfalead-chat__message--user {
    align-self: flex-end;
    border-color: rgba(255, 255, 255, 0.16);
    border-bottom-right-radius: 5px;
    background: var(--alfalead-primary);
    box-shadow: 0 10px 24px rgba(234, 35, 35, 0.2);
}

.alfalead-chat__message--typing {
    display: flex;
    align-items: center;
    min-width: 68px;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 rgba(234, 35, 35, 0);
    animation: alfalead-typing-pulse 1.25s ease-in-out infinite;
}

.alfalead-chat__typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.alfalead-chat__typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    animation: alfalead-typing-dot 1.1s ease-in-out infinite;
}

.alfalead-chat__typing-dots span:nth-child(2) {
    animation-delay: 0.16s;
}

.alfalead-chat__typing-dots span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes alfalead-typing-pulse {
    0%,
    100% {
        border-color: rgba(255, 255, 255, 0.16);
        background: rgba(255, 255, 255, 0.09);
        box-shadow: 0 0 0 rgba(234, 35, 35, 0);
        opacity: 0.72;
    }

    50% {
        border-color: rgba(234, 35, 35, 0.58);
        background: rgba(255, 255, 255, 0.16);
        box-shadow: 0 0 22px rgba(234, 35, 35, 0.2);
        opacity: 1;
    }
}

@keyframes alfalead-typing-dot {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.42;
    }

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

@media (prefers-reduced-motion: reduce) {
    .alfalead-chat__message--typing,
    .alfalead-chat__typing-dots span {
        animation: none;
    }

    .alfalead-chat__message--typing {
        border-color: rgba(234, 35, 35, 0.48);
        opacity: 1;
    }
}

.alfalead-chat__form {
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.055);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.alfalead-chat__lead-summary {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    margin: 0 0 10px;
    padding: 7px 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.72);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.alfalead-chat__lead-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alfalead-chat__lead-summary .fa-pencil {
    color: var(--alfalead-primary);
}

.alfalead-chat__form.needs-lead-data .alfalead-chat__lead-summary {
    border-bottom-color: rgba(234, 35, 35, 0.7);
    color: rgba(255, 255, 255, 0.92);
}

.alfalead-chat__lead-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(234, 35, 35, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
}

.alfalead-chat__lead-fields[hidden] {
    display: none;
}

.alfalead-chat__lead-fields label {
    color: rgba(255, 255, 255, 0.66);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.alfalead-chat__lead-fields input,
.alfalead-chat__input-wrap textarea {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.065);
    text-transform: none;
}

.alfalead-chat__lead-fields input {
    height: 42px;
    margin: 5px 0 0;
    padding: 0 11px;
    font-size: 14px;
    text-transform: none;
}

.alfalead-chat__input-wrap {
    display: block;
}

.alfalead-chat__input-wrap textarea {
    min-height: 62px;
    height: 62px;
    margin-bottom: 0;
    padding: 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    resize: none;
    text-transform: none;
}

.alfalead-chat__input-wrap textarea::placeholder {
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}

.alfalead-chat__lead-fields input:focus,
.alfalead-chat__input-wrap textarea:focus {
    border-color: rgba(234, 35, 35, 0.62);
    box-shadow: 0 0 0 3px rgba(234, 35, 35, 0.1);
    outline: none;
}

.alfalead-chat__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.alfalead-chat__hint {
    max-width: 310px;
    margin: 0;
    color: rgba(255, 255, 255, 0.56);
    font-size: 13px;
    line-height: 1.5;
}

.alfalead-chat .button-border button {
    height: 100%;
    padding: 0 30px;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.alfalead-chat button:disabled {
    cursor: wait;
    opacity: 0.58;
}

.alfalead-chat__form.is-loading .button-border {
    opacity: 0.72;
}

.alfalead-chat__form.is-loading textarea {
    cursor: wait;
    opacity: 0.62;
}

.alfalead-chat__honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.alfalead-floating {
    position: fixed;
    right: 28px;
    bottom: 26px;
    z-index: 10020;
    text-align: left;
}

.alfalead-floating__launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 19px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 18px;
    background: var(--alfalead-primary);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.alfalead-floating__launcher i {
    font-size: 18px;
}

.alfalead-floating.is-open .alfalead-floating__launcher {
    display: none;
}

.alfalead-chat--floating {
    position: absolute;
    right: 0;
    bottom: 0;
    display: block;
    width: min(390px, calc(100vw - 32px));
    max-width: none;
}

.alfalead-chat--floating[hidden] {
    display: none;
}

.alfalead-chat--floating .alfalead-chat__panel {
    width: 100%;
}

.alfalead-chat--floating .alfalead-chat__messages {
    flex: 1 1 auto;
    min-height: 260px;
    max-height: min(390px, calc(100vh - 330px));
}

.alfalead-chat--floating .alfalead-chat__form,
.alfalead-chat--floating .alfalead-chat__brand {
    flex: 0 0 auto;
}

.alfalead-chat--floating .alfalead-chat__lead-fields {
    grid-template-columns: 1fr;
}

.alfalead-chat__close,
.alfalead-chat__finish,
.alfalead-chat__send {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    cursor: pointer;
}

.alfalead-chat__close {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    font-size: 13px;
}

.alfalead-chat__finish {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(57, 217, 138, 0.34);
    background: rgba(57, 217, 138, 0.1);
    color: #70e6aa;
    font-size: 12px;
}

.alfalead-chat__close:hover {
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.2);
}

.alfalead-chat__close:focus-visible,
.alfalead-chat__finish:focus-visible,
.alfalead-chat__send:focus-visible,
.alfalead-floating__launcher:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.alfalead-chat__send {
    background: var(--alfalead-primary);
    box-shadow: 0 8px 18px rgba(234, 35, 35, 0.24);
}

.alfalead-chat__product-link {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 600;
}

.alfalead-chat__product-link i {
    margin-left: 6px;
    color: var(--alfalead-primary);
}

.alfalead-chat__brand {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 20px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.58);
    font-size: 9px;
    font-weight: 400;
    text-transform: uppercase;
}

.alfalead-chat__brand img {
    display: block;
    width: 126px;
    max-height: 22px;
    opacity: 0.82;
    filter: grayscale(1);
}

.alfalead-chat__brand:hover {
    color: rgba(255, 255, 255, 0.68);
}

.alfalead-chat__brand:hover img {
    opacity: 0.96;
}

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

@media (max-width: 1024px) {
    .alfalead-chat--section {
        grid-template-columns: 1fr;
    }

    .alfalead-chat__title.primary-font-title {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .alfalead-chat {
        gap: 32px;
    }

    .alfalead-chat__title.primary-font-title {
        font-size: 32px;
    }

    .alfalead-chat__messages {
        min-height: 280px;
        padding: 18px;
    }

    .alfalead-chat__form,
    .alfalead-chat__header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .alfalead-chat__lead-fields {
        grid-template-columns: 1fr;
    }

    .alfalead-chat__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .alfalead-chat__hint {
        max-width: none;
    }

    .alfalead-floating {
        right: 16px;
        bottom: 16px;
    }

    .alfalead-floating__launcher span {
        display: none;
    }

    .alfalead-floating__launcher {
        justify-content: center;
        width: 56px;
        min-height: 56px;
        padding: 0;
        border-radius: 50%;
    }

    .alfalead-chat--floating {
        position: fixed;
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
    }

    .alfalead-chat--floating .alfalead-chat__panel {
        max-height: calc(100dvh - 20px);
        border-radius: 22px;
    }

    .alfalead-chat--floating .alfalead-chat__messages {
        min-height: 220px;
        max-height: calc(100vh - 360px);
    }

    .alfalead-chat--floating .alfalead-chat__actions {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-height: 760px) {
    .alfalead-chat--floating .alfalead-chat__panel {
        max-height: calc(100dvh - 20px);
    }

    .alfalead-chat--floating .alfalead-chat__header {
        min-height: 58px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .alfalead-chat--floating .alfalead-chat__messages {
        min-height: 120px;
        max-height: none;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .alfalead-chat--floating .alfalead-chat__input-wrap textarea {
        min-height: 52px;
        height: 52px;
        padding-top: 14px;
        padding-bottom: 10px;
    }

    .alfalead-chat--floating .alfalead-chat__actions {
        margin-top: 12px;
    }

    .alfalead-chat--floating .alfalead-chat__lead-fields {
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .alfalead-chat--floating .alfalead-chat__lead-fields input {
        height: 34px;
    }
}
