/* =========================================================
   CUPORA
   ASISTENTE VIRTUAL - CUPOTECH SOLUTIONS
========================================================= */

:root {
    --cupora-navy: #063a67;
    --cupora-blue: #0878b9;
    --cupora-cyan: #08a8d8;
    --cupora-orange: #f28c28;

    --cupora-text: #173e5c;
    --cupora-muted: #6e8799;

    --cupora-white: #ffffff;
    --cupora-light: #f4f9fc;
    --cupora-border: #d8e7f0;

    --cupora-shadow:
            0 18px 45px rgba(8, 61, 96, 0.18);

    --cupora-soft-shadow:
            0 10px 26px rgba(8, 61, 96, 0.12);
}


/* =========================================================
   CONTENEDOR GENERAL
========================================================= */

.cupora-widget {
    position: fixed;

    right: 28px;
    bottom: 28px;

    z-index: 1500;

    font-family: "Inter", sans-serif;
}


/* =========================================================
   BOTÓN FLOTANTE
========================================================= */

.cupora-launcher {
    width: 68px;
    height: 68px;

    padding: 0;

    display: grid;
    place-items: center;

    position: relative;

    color: white;

    background:
            linear-gradient(
                    135deg,
                    var(--cupora-navy),
                    var(--cupora-blue),
                    var(--cupora-cyan)
            );

    border: 0;
    border-radius: 50%;

    cursor: pointer;

    box-shadow:
            0 12px 30px rgba(6, 58, 103, 0.28);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}


.cupora-launcher:hover {
    transform: translateY(-3px);

    box-shadow:
            0 17px 36px rgba(6, 58, 103, 0.34);
}


.cupora-launcher i {
    font-size: 27px;
}


.cupora-launcher-badge {
    width: 20px;
    height: 20px;

    position: absolute;

    top: 0;
    right: 0;

    display: grid;
    place-items: center;

    background: #22c55e;

    border: 3px solid white;
    border-radius: 50%;
}


/* =========================================================
   PANEL
========================================================= */

.cupora-panel {
    width: min(440px, calc(100vw - 32px));
    height: 650px;

    position: absolute;

    right: 0;
    bottom: 84px;

    display: none;

    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;

    overflow: hidden;

    background: white;

    border: 1px solid var(--cupora-border);
    border-radius: 21px;

    box-shadow: var(--cupora-shadow);
}


.cupora-widget.active
.cupora-panel {
    display: grid;

    animation:
            cupora-open 0.22s ease;
}


@keyframes cupora-open {

    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* =========================================================
   HEADER
========================================================= */

.cupora-header {
    padding: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    color: white;

    background:
            linear-gradient(
                    135deg,
                    var(--cupora-navy),
                    var(--cupora-blue)
            );
}


.cupora-header-info {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 12px;
}


.cupora-avatar {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    color: var(--cupora-navy);

    background: white;

    border-radius: 13px;

    font-size: 21px;
}


.cupora-header-text {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 2px;
}


.cupora-header-text strong {
    font-size: 16px;
    font-weight: 800;
}


.cupora-header-text span {
    display: flex;
    align-items: center;

    gap: 6px;

    color: #d8f2fc;

    font-size: 10px;
    font-weight: 600;
}


.cupora-status-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    background: #45e28d;

    border-radius: 50%;
}


.cupora-close {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    color: white;

    background: rgba(255, 255, 255, 0.10);

    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;

    cursor: pointer;
}


.cupora-close:hover {
    background: rgba(255, 255, 255, 0.18);
}


/* =========================================================
   CONVERSACIÓN
========================================================= */

.cupora-conversation {
    padding: 20px;

    display: flex;
    flex-direction: column;

    gap: 15px;

    overflow-y: auto;

    background:
            linear-gradient(
                    180deg,
                    #f8fcfe,
                    #f3f8fb
            );

    scrollbar-width: thin;

    scrollbar-color:
            #c2dbe7
            transparent;
}


/* =========================================================
   MENSAJES
========================================================= */

.cupora-message {
    max-width: 88%;

    display: flex;
    flex-direction: column;

    gap: 7px;
}


.cupora-message-bot {
    align-self: flex-start;
}


.cupora-message-user {
    align-self: flex-end;
}


.cupora-message-bubble {
    padding: 13px 15px;

    border-radius: 15px;

    font-size: 13px;
    line-height: 1.55;

    overflow-wrap: anywhere;
}


.cupora-message-bot
.cupora-message-bubble {
    color: var(--cupora-text);

    background: white;

    border: 1px solid var(--cupora-border);

    border-bottom-left-radius: 5px;

    box-shadow:
            0 5px 12px rgba(17, 76, 108, 0.05);
}


.cupora-message-user
.cupora-message-bubble {
    color: white;

    background:
            linear-gradient(
                    135deg,
                    var(--cupora-blue),
                    var(--cupora-cyan)
            );

    border-bottom-right-radius: 5px;
}


/* =========================================================
   AUTOR
========================================================= */

.cupora-message-author {
    display: flex;
    align-items: center;

    gap: 6px;

    color: var(--cupora-muted);

    font-size: 9px;
    font-weight: 700;
}


.cupora-message-author i {
    color: var(--cupora-blue);
}


/* =========================================================
   BOTÓN RESPUESTA
========================================================= */

.cupora-response-action {
    width: fit-content;

    min-height: 40px;

    padding: 0 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    color: var(--cupora-blue);

    background: #eaf7fc;

    border: 1px solid #cce9f4;
    border-radius: 9px;

    cursor: pointer;

    font-family: "Inter", sans-serif;

    font-size: 10px;
    font-weight: 750;
}


.cupora-response-action:hover {
    background: #dff3fb;

    transform: translateY(-1px);
}


/* =========================================================
   OPCIONES RÁPIDAS
========================================================= */

.cupora-quick-options {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}


.cupora-quick-option {
    min-height: 37px;

    padding: 0 12px;

    display: inline-flex;
    align-items: center;

    gap: 6px;

    color: #41657b;

    background: white;

    border: 1px solid #d2e5ee;
    border-radius: 20px;

    cursor: pointer;

    font-family: "Inter", sans-serif;

    font-size: 9px;
    font-weight: 700;

    box-shadow:
            0 3px 8px rgba(15, 66, 98, 0.04);
}


.cupora-quick-option:hover {
    color: var(--cupora-blue);

    background: #f3fbfe;

    border-color: #a9dceb;
}


.cupora-quick-option i {
    color: var(--cupora-blue);
}


/* =========================================================
   ESCRIBIENDO
========================================================= */

.cupora-typing {
    width: fit-content;

    padding: 11px 14px;

    display: flex;
    align-items: center;

    gap: 4px;

    background: white;

    border: 1px solid var(--cupora-border);
    border-radius: 13px;

    border-bottom-left-radius: 5px;
}


.cupora-typing span {
    width: 7px;
    height: 7px;

    display: block;

    background: #8eabbc;

    border-radius: 50%;

    animation:
            cupora-typing-dot
            1.1s
            infinite ease-in-out;
}


.cupora-typing span:nth-child(2) {
    animation-delay: 0.15s;
}


.cupora-typing span:nth-child(3) {
    animation-delay: 0.30s;
}


@keyframes cupora-typing-dot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }

}


/* =========================================================
   FOOTER
========================================================= */

.cupora-footer {
    padding: 14px;

    background: white;

    border-top: 1px solid var(--cupora-border);
}


.cupora-form {
    display: flex;
    align-items: center;

    gap: 9px;
}


.cupora-input-wrapper {
    min-width: 0;

    flex: 1;

    height: 49px;

    display: flex;
    align-items: center;

    background: #f5f9fb;

    border: 1px solid #d3e4ec;
    border-radius: 11px;
}


.cupora-input-wrapper:focus-within {
    background: white;

    border-color: var(--cupora-cyan);

    box-shadow:
            0 0 0 3px rgba(8, 168, 216, 0.09);
}


.cupora-input-wrapper > i {
    margin-left: 14px;

    color: #8ba4b3;

    font-size: 13px;
}


.cupora-input {
    width: 100%;
    height: 47px;

    padding: 0 12px;

    color: var(--cupora-text);

    background: transparent;

    border: 0;
    outline: 0;

    font-family: "Inter", sans-serif;

    font-size: 12px;
}


.cupora-input::placeholder {
    color: #91a8b6;
}


.cupora-send {
    width: 49px;
    height: 49px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    color: white;

    background:
            linear-gradient(
                    135deg,
                    var(--cupora-blue),
                    var(--cupora-cyan)
            );

    border: 0;
    border-radius: 11px;

    cursor: pointer;

    font-size: 14px;
}


.cupora-send:disabled {
    opacity: 0.55;

    cursor: not-allowed;
}


/* =========================================================
   NOTA
========================================================= */

.cupora-footer-note {
    margin: 8px 0 0;

    color: #93a8b5;

    font-size: 8px;

    text-align: center;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 540px) {

    .cupora-widget {
        right: 14px;
        bottom: 14px;
    }


    .cupora-launcher {
        width: 60px;
        height: 60px;
    }


    .cupora-panel {
        width: calc(100vw - 28px);

        height: min(
                650px,
                calc(100vh - 100px)
        );

        right: 0;
        bottom: 74px;

        border-radius: 17px;
    }


    .cupora-message-bubble {
        font-size: 12px;
    }

}