/* ===== RESET BÁSICO ===== */

body.chat-aral,
body.chat-aral * {
    box-sizing: border-box;
}

body.chat-aral {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f6ff;
    color: #1f2943;
}

/* ===== LAYOUT GERAL ===== */

.chat-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-shell {
    max-width: 960px;
    margin: 32px auto 48px;
    padding: 0 16px;
}

/* ===== CABEÇALHO DO CHAT (FOTO + NOME + STATUS) ===== */

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-agent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: radial-gradient(circle at 30% 30%, #ffffff, #c7d2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #364152;
    text-transform: uppercase;
}

.chat-agent-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-agent-info {
    display: flex;
    flex-direction: column;
}

.chat-agent-name {
    font-size: 14px;
    font-weight: 600;
    color: #14213d;
}

.chat-agent-status {
    font-size: 12px;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-agent-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

/* ===== CARD PRINCIPAL (CAIXA DO CHAT) ===== */

.chat-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 20px 24px;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.14),
        0 0 0 1px rgba(148, 163, 184, 0.15);
    min-height: 280px;
}

/* ===== FAIXA SUPERIOR (TERMOS + MARCA) ===== */

.chat-top-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.chat-top-links {
    font-size: 14px;
}

.chat-top-links a {
    color: #1d4ed8;
    text-decoration: none;
}

.chat-top-links a:hover {
    text-decoration: underline;
}

.chat-top-brand {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.24em;
    color: #6b7280;
    text-transform: uppercase;
}

/* ===== ÁREA DAS MENSAGENS ===== */

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.4;
}

/* Linha da mensagem da atendente:
   .msg-line  => avatar + content (bolha + horário)
*/

.msg-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
}

/* avatar dentro da linha da mensagem (mesma foto do topo) */
.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    overflow: hidden;
    background: #dbe4ff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* bolha azul-claro da atendente */
.msg-bot {
    background: #e4efff;
    color: #111827;
    padding: 11px 14px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    max-width: 620px;
}

/* container que segura bolha + horário (lado da atendente) */
.msg-line > div:last-child {
    display: flex;
    flex-direction: column;
}

/* horário da atendente */
.msg-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ===== Mensagem do usuário (resposta escolhida) ===== */

.msg-user-line {
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 80%;
}

.msg-user {
    background: #251559; /* azul-escuro estilo Liberius */
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 18px;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 14px rgba(37, 21, 89, 0.35);
}

.msg-user-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ===== RODAPÉ (BOTÕES / OPÇÕES) ===== */

.chat-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 4px;
}

.chat-footer-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
}

/* container onde o JS coloca os botões / inputs */
#chat-footer-area {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* estilos dos botões de opção (button ou input[type=button]) */
#chat-footer-area button,
#chat-footer-area input[type="button"],
#chat-footer-area input[type="submit"],
#chat-footer-area .chat-option-btn {
    border-radius: 999px;
    border: 1px solid #d0d7ff;
    padding: 12px 22px;
    background: #f7f8ff;
    color: #111827;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background .18s ease,
        box-shadow .18s ease,
        transform .12s ease,
        border-color .18s ease;
    min-width: 180px;
}

#chat-footer-area button span,
#chat-footer-area input[type="button"] span {
    flex: 1 1 auto;
}

/* seta à direita, estilo Liberius */
#chat-footer-area button::after,
#chat-footer-area input[type="button"]::after {
    content: "›";
    font-size: 16px;
    color: #4b5563;
    margin-left: 10px;
}

#chat-footer-area button:hover,
#chat-footer-area input[type="button"]:hover {
    background: #eef1ff;
    border-color: #4f46e5;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.18);
    transform: translateY(-1px);
}

#chat-footer-area button:active,
#chat-footer-area input[type="button"]:active {
    transform: translateY(0px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.18);
}

/* ===== FORMULÁRIO GENÉRICO (chat-input-card) ===== */

.chat-input-card {
    margin-top: 4px;
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}

.chat-input-card .input-label {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
}

.chat-input-card .input-hint {
    font-size: 13px;
    color: #6b7280;
}

/* campos de texto (nome, e-mail, telefone etc.) dentro do card */
.chat-input-card input[type="text"],
.chat-input-card input[type="email"],
.chat-input-card input[type="tel"],
.chat-input-card input[type="number"],
.chat-input-card textarea {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    font-family: inherit;
}

.chat-input-card input::placeholder,
.chat-input-card textarea::placeholder {
    color: #9ca3af;
}

/* foco bonito, combinando com o azul dos botões */
.chat-input-card input[type="text"]:focus,
.chat-input-card input[type="email"]:focus,
.chat-input-card input[type="tel"]:focus,
.chat-input-card input[type="number"]:focus,
.chat-input-card textarea:focus {
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow:
        0 0 0 1px rgba(79, 70, 229, 0.4),
        0 0 0 4px rgba(129, 140, 248, 0.25);
}

/* o botão Enviar já pega o estilo de #chat-footer-area button
   porque tem class="input-submit" mas também é <button> dentro do footer */

/* ===== RESPONSIVO ===== */

@media (max-width: 768px) {
    .chat-shell {
        margin-top: 20px;
    }

    .chat-card {
        padding: 16px 14px 20px;
    }

    .msg-line {
        max-width: 100%;
    }

    .msg-user-line {
        max-width: 100%;
    }

    .chat-input-card {
        max-width: 100%;
    }
}
