/* ---- WIDGET DE CHAT DE SUPORTE ----------- */
.chat-support-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1035;
    font-family: 'Ubuntu', sans-serif;
}

.chat-support-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid #ffffff;
    background-color: #ffc107;
    color: #212529;
    font-size: 24px;
    box-shadow: rgb(25 31 40 / 20%) 0px 20px 36px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.chat-support-toggle:hover {
    transform: translateY(-3px);
    background-color: #e0a800;
}

.chat-support-toggle .fa-xmark {
    display: none;
}

.chat-support-widget.open .chat-support-toggle .fa-comment-dots {
    display: none;
}

.chat-support-widget.open .chat-support-toggle .fa-xmark {
    display: block;
}

.chat-support-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 400px;
    max-width: calc(100vw - 48px);
    max-height: min(640px, calc(100vh - 120px));
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: rgb(25 31 40 / 20%) 0px 20px 36px 0px;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.chat-support-widget.open .chat-support-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-support-header {
    background-color: #2C507D;
    color: #ffffff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-support-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-support-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.chat-support-subtitle {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.2;
}

.chat-support-close {
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
    opacity: 0.85;
    cursor: pointer;
}

.chat-support-close:hover {
    opacity: 1;
}

.chat-support-body {
    padding: 16px;
    overflow-y: auto;
    background-color: #F6F6F6;
    flex: 1;
}

.chat-support-message {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: #212529;
    margin-bottom: 12px;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, 0.06);
    white-space: pre-line;
}

.chat-support-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 1px solid #eeeeee;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-support-card:last-child {
    margin-bottom: 0;
}

.chat-support-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.07);
    border-color: #2C507D;
}

.chat-support-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #2C507D;
    color: #ffffff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-support-card-label {
    font-size: 14px;
    color: #212529;
    flex: 1;
}

.chat-support-card-arrow {
    color: #aaaaaa;
    font-size: 12px;
}

.chat-support-card-back {
    background-color: transparent;
    border: 1px dashed #cccccc;
    box-shadow: none;
}

.chat-support-card-back:hover {
    border-color: #aaaaaa;
    box-shadow: none;
}

.chat-support-card-back .chat-support-card-icon {
    background-color: transparent;
    color: #777777;
}

.chat-support-card-back .chat-support-card-label {
    color: #777777;
}

@media (max-width: 480px) {
    .chat-support-widget {
        right: 16px;
        bottom: 16px;
    }

    .chat-support-toggle {
        animation: chat-support-attention 1.6s ease-in-out infinite;
    }

    .chat-support-widget.open .chat-support-toggle {
        animation: none;
    }

    .chat-support-widget.open .chat-support-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .chat-support-widget.open .chat-support-panel .chat-support-header {
        border-radius: 0;
    }
}

@keyframes chat-support-attention {
    0%, 15%, 100% {
        transform: scale(1) rotate(0deg);
    }
    3% {
        transform: scale(1.1) rotate(-10deg);
    }
    6% {
        transform: scale(1.1) rotate(10deg);
    }
    9% {
        transform: scale(1.1) rotate(-8deg);
    }
    12% {
        transform: scale(1.1) rotate(8deg);
    }
}

/* ---- TECLADO NUMERICO DE CPF ----------- */
.chat-support-cpf-display {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #2C507D;
    border: 1px solid #eeeeee;
}

.chat-support-cpf-error {
    min-height: 18px;
    margin: -4px 0 8px;
    padding: 0 4px;
    text-align: center;
    font-size: 12px;
    color: #dc3545;
}

.chat-support-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.chat-support-key {
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    padding: 12px 0;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-support-key:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.07);
    border-color: #2C507D;
}

.chat-support-key-action {
    color: #2C507D;
}

.chat-support-key-confirm {
    background-color: #78C350;
    border-color: #78C350;
    color: #ffffff;
}

.chat-support-key-confirm:hover {
    border-color: #78C350;
}

/* ---- LOADING E MENSAGEM DE SUCESSO ----------- */
.chat-support-loading {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, 0.06);
}

.chat-support-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e3e8ee;
    border-top-color: #2C507D;
    border-radius: 50%;
    animation: chat-support-spin 0.8s linear infinite;
}

.chat-support-loading-text {
    font-size: 14px;
    color: #212529;
    text-align: center;
}

@keyframes chat-support-spin {
    to {
        transform: rotate(360deg);
    }
}

.chat-support-message-success {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 16px 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, 0.06);
    border: 1px solid #78C350;
}

.chat-support-message-success-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #78C350;
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: chat-support-pop 0.3s ease;
}

.chat-support-message-success-text {
    font-size: 14px;
    color: #212529;
}

@keyframes chat-support-pop {
    0% {
        transform: scale(0);
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}
