/* Chat de soporte — panel lateral derecho */
.firststeps-chat {
    position: fixed;
    inset: 0;
    z-index: 11900;
    pointer-events: none;
}

.firststeps-chat.is-open {
    pointer-events: auto;
}

.firststeps-chat-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.35);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.firststeps-chat.is-open .firststeps-chat-backdrop {
    opacity: 1;
}

.firststeps-chat-shell {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(400px, 100vw);
    background: #FFFFFF;
    color: #111827;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), width 0.25s ease;
    overflow: hidden;
}

.firststeps-chat-shell.is-expanded {
    width: min(760px, 100vw);
}

.firststeps-chat.is-open .firststeps-chat-shell {
    transform: translateX(0);
}

.firststeps-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    flex-shrink: 0;
    background: #fff;
    z-index: 2;
}

.firststeps-chat-brand {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.firststeps-chat-agents {
    margin-left: auto;
    display: inline-flex;
    gap: 6px;
}

.firststeps-chat-agent-dot {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #FF5A1F;
    color: #FFFFFF;
    font-weight: 900;
    font-size: 12px;
    display: grid;
    place-items: center;
}

.firststeps-chat-x,
.firststeps-chat-iconbtn {
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
}

.firststeps-chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 20px;
    gap: 18px;
    min-height: 0;
}

.firststeps-chat-welcome[hidden],
.firststeps-chat-active[hidden],
.firststeps-chat-lead[hidden],
.firststeps-chat-dropzone[hidden],
.firststeps-chat-file-hint[hidden],
.firststeps-chat-iconbtn[hidden] {
    display: none !important;
}

.firststeps-chat-lead {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 16px;
    gap: 10px;
    min-height: 0;
    overflow: auto;
}

.firststeps-chat-lead-desc {
    font-size: 13px;
    font-weight: 600;
    color: rgba(17, 24, 39, 0.65);
    margin: 0;
}

.firststeps-chat-lead-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.firststeps-chat-lead-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
}

.firststeps-chat-lead-form input {
    border: 1px solid rgba(17, 24, 39, 0.14);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #111827;
    background: #fff;
}

.firststeps-chat-lead-error {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
    margin: 0;
}

.firststeps-chat-greet {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
}

.firststeps-chat-cta {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    border-radius: 12px;
    background: #FF5A1F;
    color: #FFFFFF;
    font-weight: 800;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
}

.firststeps-chat-cta-ico {
    font-size: 12px;
}

.firststeps-chat-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.firststeps-chat-thread {
    flex: 1;
    overflow: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fafafa;
    min-height: 0;
}

.firststeps-chat-bubble {
    max-width: 88%;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: pre-wrap;
}

.firststeps-chat-bubble-agent {
    align-self: flex-start;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.firststeps-chat-bubble-user {
    align-self: flex-end;
    background: rgba(255, 90, 31, 0.12);
    border: 1px solid rgba(255, 90, 31, 0.2);
}

.firststeps-chat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    flex-shrink: 0;
    background: #fff;
}

.firststeps-chat-tag {
    border: 1px solid rgba(17, 24, 39, 0.14);
    background: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #111827;
}

.firststeps-chat-compose {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 14px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    flex-shrink: 0;
    background: #fff;
}

.firststeps-chat-compose textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(17, 24, 39, 0.14);
    padding: 8px 10px;
    font-family: inherit;
    resize: vertical;
    color: #111827;
    background: #fff;
}

.firststeps-chat-compose-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.firststeps-chat-send {
    border: 0;
    border-radius: 10px;
    background: #FF5A1F;
    color: #FFFFFF;
    font-weight: 900;
    padding: 8px 14px;
    cursor: pointer;
}

.firststeps-chat-clip {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(17, 24, 39, 0.14);
    background: #fff;
    color: #111827;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.firststeps-chat-clip:hover {
    background: rgba(255, 90, 31, 0.08);
    color: #FF5A1F;
    border-color: rgba(255, 90, 31, 0.35);
}

.firststeps-chat-file-hint {
    font-size: 11px;
    font-weight: 700;
    color: rgba(17, 24, 39, 0.65);
}

.firststeps-chat-link {
    color: #c2410c;
    text-decoration: underline;
    word-break: break-all;
    font-weight: 800;
}

.firststeps-chat-attach {
    margin-top: 8px;
    display: block;
}

.firststeps-chat-attach img,
.firststeps-chat-attach video {
    display: block;
    max-width: 100%;
    max-height: 220px;
    border-radius: 10px;
    margin-top: 6px;
}

.firststeps-chat-attach audio {
    width: 100%;
    margin-top: 6px;
}

.firststeps-chat-attach-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: rgba(17, 24, 39, 0.03);
    color: #111827;
    text-decoration: none;
    font-weight: 800;
    font-size: 12px;
    word-break: break-all;
}

.firststeps-chat-attach-file:hover {
    background: rgba(255, 90, 31, 0.08);
}

.firststeps-chat-dropzone {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(255, 90, 31, 0.12);
    display: grid;
    place-items: center;
    pointer-events: none;
}

.firststeps-chat-dropzone-inner {
    border: 2px dashed #FF5A1F;
    border-radius: 16px;
    padding: 28px 22px;
    background: rgba(255, 255, 255, 0.92);
    font-weight: 900;
    color: #FF5A1F;
}

.firststeps-chat-shell.is-dragging .firststeps-chat-dropzone {
    display: grid !important;
}

/* Botón flotante páginas públicas */
.erp-public-chat-float {
    position: fixed;
    left: 18px;
    bottom: 22px;
    z-index: 85;
    border: 0;
    cursor: pointer;
    padding: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
}

.erp-public-chat-float-glow {
    position: absolute;
    inset: -8px;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 50%, rgba(255, 183, 0, 0.75), rgba(255, 90, 31, 0.35) 55%, transparent 72%);
    filter: blur(10px);
    opacity: 0.9;
    animation: erp-public-chat-glow 2.4s ease-in-out infinite;
    pointer-events: none;
}

.erp-public-chat-float-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 10px;
    font-family: Montserrat, 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 800;
    font-size: 14px;
    color: #1a1208;
    background: linear-gradient(135deg, #FF5A1F 0%, #FF8A00 45%, #FFD100 100%);
    box-shadow: 0 10px 28px rgba(255, 90, 31, 0.45);
    white-space: nowrap;
}

.erp-public-chat-float:hover .erp-public-chat-float-label {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

@keyframes erp-public-chat-glow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}

@media (max-width: 640px) {
    .erp-public-chat-float {
        left: 12px;
        bottom: 16px;
    }
    .erp-public-chat-float-label {
        font-size: 13px;
        padding: 0 14px;
        min-height: 44px;
    }
}
