/* =====================================
CONDO TECH - ASSISTENTE VIRTUAL
===================================== */
.ct-assistant,
.ct-assistant * {
    box-sizing: border-box;
}

/* Robô fixo acima do botão do WhatsApp */
.ct-assistant {
    position: fixed !important;
    bottom: 92px !important;
    right: 12px !important;
    left: 12px !important;
    top: auto !important;
    z-index: 2460 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    animation: ctEnter 0.45s ease both;
}

/* =====================================
ROBÔ (ROSTO MAIOR E MAIS VISÍVEL)
===================================== */
.ct-assistant .ct-robot {
    position: relative;
    align-self: flex-end !important;
    flex: 0 0 74px;
    width: 74px !important;
    min-width: 74px !important;
    height: 60px !important;
    margin-right: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer;
    animation: ctFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s ease;
}

.ct-assistant .ct-robot:hover {
    transform: scale(1.06);
}

.ct-assistant .robot-svg {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    pointer-events: none;
}

/* =====================================
OLHOS
===================================== */
.ct-assistant .ct-blink {
    animation: ctBlink 0.15s ease-in-out;
}

.ct-assistant #ct-eye-left {
    transform-origin: 205px 218px;
}

.ct-assistant #ct-eye-right {
    transform-origin: 295px 218px;
}

@keyframes ctBlink {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0);
    }
}

/* =====================================
MOVIMENTO
===================================== */
@keyframes ctFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes ctEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ctDialogEnter {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ctModalIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =====================================
CAIXA DE DIÁLOGO (LARGURA 100% E FORA DA ÁREA DE CONTEÚDO)
===================================== */
.ct-assistant .ct-dialog {
    display: none;
    position: relative;
    flex: 1 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 11px 14px 9px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.35) !important;
    color: #1e293b;
}

.ct-assistant.ct-dialog-open .ct-dialog {
    display: block !important;
    animation: ctDialogEnter 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ct-assistant .ct-dialog::after {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 34px;
    width: 13px;
    height: 13px;
    background: rgba(255, 255, 255, 0.98);
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    transform: rotate(45deg);
}

/* =====================================
BOTÃO FECHAR DIÁLOGO
===================================== */
.ct-assistant .ct-close {
    position: absolute;
    top: 5px;
    right: 7px;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #64748b !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer;
}

/* =====================================
MENSAGEM
===================================== */
.ct-assistant .ct-label {
    margin-bottom: 3px;
    color: #047857;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ct-assistant .ct-message strong {
    display: block;
    padding-right: 20px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 5px;
}

.ct-assistant .ct-message p {
    margin: 0 0 8px 0 !important;
    color: #475569;
    font-size: 11px;
    line-height: 1.35;
}

/* =====================================
BOTÃO DE DOAÇÃO
===================================== */
.ct-assistant .ct-donation {
    width: 100% !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    padding: 7px 10px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 9px !important;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: 0.2s;
}

.ct-assistant .ct-donation:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

/* =====================================
RODAPÉ
===================================== */
.ct-assistant .ct-footer {
    margin-top: 5px;
    color: #64748b;
    font-size: 9px;
    text-align: center;
}

/* =====================================
MODAL DE DOAÇÃO PIX (SEMPRE CENTRALIZADO)
===================================== */
.ct-modal-backdrop,
.ct-modal-backdrop * {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

.ct-modal-backdrop {
    display: none;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1000000 !important;
    background: rgba(15, 23, 42, 0.72) !important;
    padding: 12px !important;
    overflow: hidden !important;
}

.ct-modal-backdrop.is-open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ct-modal-card {
    position: relative;
    width: 100% !important;
    max-width: 420px !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
    background: #ffffff;
    color: #1e293b;
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    border: 1px solid #e2e8f0;
    animation: ctModalIn 0.2s ease-out;
}

.ct-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ct-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ct-modal-badge {
    display: inline-block;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
    max-width: calc(100% - 36px);
}

.ct-modal-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.ct-modal-subtitle {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #475569;
}

.ct-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.ct-amount-btn {
    padding: 9px 6px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    min-width: 0;
}

.ct-amount-btn:hover {
    border-color: #10b981;
    background: #ecfdf5;
}

.ct-amount-btn.active {
    border-color: #059669;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.ct-field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.ct-field {
    margin-bottom: 10px;
    min-width: 0;
}

.ct-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}

.ct-field input,
.ct-field textarea {
    width: 100%;
    max-width: 100%;
    padding: 9px 11px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
}

.ct-field input:focus,
.ct-field textarea:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.ct-field textarea {
    resize: none;
    font-family: monospace;
    font-size: 11px;
    line-height: 1.4;
    background: #f8fafc;
}

.ct-modal-submit {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ct-modal-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.ct-modal-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ct-qr-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.ct-qr-box img {
    width: 170px;
    height: 170px;
    max-width: 100%;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    background: #ffffff;
    padding: 6px;
}

.ct-pix-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.ct-copy-btn,
.ct-check-btn {
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid #059669;
}

.ct-copy-btn {
    background: #059669;
    color: #ffffff;
}

.ct-copy-btn:hover {
    background: #047857;
}

.ct-check-btn {
    background: #ecfdf5;
    color: #047857;
}

.ct-check-btn:hover {
    background: #d1fae5;
}

.ct-modal-alert {
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.ct-alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ct-alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.ct-alert-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.ct-back-link {
    width: 100%;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px;
    text-align: center;
}

.ct-back-link:hover {
    color: #0f172a;
}

/* =====================================
CELULARES
===================================== */
@media (max-width: 480px) {
    .ct-assistant {
        bottom: 90px !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .ct-assistant .ct-robot {
        flex: 0 0 68px;
        width: 68px !important;
        min-width: 68px !important;
        height: 55px !important;
    }

    .ct-assistant .ct-dialog {
        flex: 1 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        padding: 10px 12px 8px !important;
        border-radius: 13px !important;
    }

    .ct-assistant .ct-dialog::after {
        right: 30px;
    }

    .ct-assistant .ct-message strong {
        font-size: 12.5px;
        line-height: 1.28;
        margin-bottom: 5px;
    }

    .ct-assistant .ct-message p {
        font-size: 10.5px;
        line-height: 1.32;
        margin-bottom: 8px !important;
    }

    .ct-assistant .ct-donation {
        font-size: 11.5px !important;
        min-height: 34px !important;
        padding: 6px 8px !important;
    }

    .ct-modal-backdrop {
        padding: 10px !important;
    }

    .ct-modal-card {
        padding: 15px 13px;
        border-radius: 15px;
    }

    .ct-pix-actions {
        grid-template-columns: 1fr;
    }
}

/* =====================================
ACESSIBILIDADE
===================================== */
@media (prefers-reduced-motion: reduce) {
    .ct-assistant,
    .ct-assistant .ct-robot,
    .ct-assistant .ct-dialog,
    .ct-modal-card {
        animation: none !important;
    }

    .ct-assistant .ct-blink {
        animation: none !important;
    }
}
