/* Chatbot devis — layout 2 colonnes desktop, 1 colonne mobile */
.chatbot-wrap {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    padding: 40px 0 48px;
    border-bottom: 1px solid var(--line);
}
.chatbot-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}
@media (max-width: 900px) {
    .chatbot-grid { grid-template-columns: 1fr; gap: 24px; }
    /* Sur mobile : chatbot en premier, pitch en dessous */
    .chatbot-grid .chatbot { order: -1; }
}

/* -------- Pitch (colonne gauche) -------- */
.chatbot-pitch h1 {
    font-size: clamp(1.7rem, 1rem + 2.5vw, 2.4rem);
    line-height: 1.15; font-weight: 800; letter-spacing: -.02em;
    color: var(--ink); margin: 0 0 14px;
}
.chatbot-pitch .lead { font-size: 1.1rem; color: var(--ink-soft); margin-bottom: 20px; }
.chatbot-pitch .usps { list-style: none; padding: 0; margin: 0 0 20px; }
.chatbot-pitch .usps li { padding: 6px 0; font-size: 1rem; color: var(--ink); }
.chatbot-pitch .usps li::before { content: '✓'; color: #16a34a; font-weight: 800; margin-right: 8px; }
.chatbot-pitch .trust {
    display: inline-flex; gap: 6px; align-items: center;
    background: #fef3c7; color: #92400e; padding: 6px 14px;
    border-radius: 999px; font-size: .88rem; font-weight: 700;
}

/* -------- Chatbot (colonne droite) -------- */
.chatbot {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15,23,42,.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 560px;
    margin-left: auto;
}
@media (max-width: 900px) {
    .chatbot { margin: 0 auto; max-width: 560px; width: 100%; }
}

.chatbot-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; gap: 10px;
    background: #fff; border-bottom: 1px solid var(--line);
}
.chatbot-agent { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.chatbot-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    overflow: hidden; background: #eff6ff;
    border: 2px solid #dbeafe;
    flex-shrink: 0;
}
.chatbot-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chatbot-agent-info .name { font-weight: 700; color: var(--ink); font-size: 1rem; line-height: 1.1; }
.chatbot-agent-info .status { color: #16a34a; font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.chatbot-agent-info .status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.chatbot-header-actions { display: flex; gap: 6px; flex-shrink: 0; }
.chatbot-header-actions .btn-mini {
    background: #f1f5f9; color: var(--ink-soft);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 6px 12px; font-size: .82rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    white-space: nowrap;
}
.chatbot-header-actions .btn-mini:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }

.chatbot-window {
    padding: 20px; min-height: 320px; max-height: 420px;
    overflow-y: auto;
    background: #f8fafc;
    scroll-behavior: smooth;
}
.msg-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-start; }
.msg-row.user { flex-direction: row-reverse; }
.msg-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    overflow: hidden; background: #eff6ff; border: 1px solid #dbeafe;
    flex-shrink: 0;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-row.user .msg-avatar {
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 700;
    border: 0;
}
.msg-bubble {
    background: #fff; border: 1px solid var(--line);
    padding: 10px 14px; border-radius: 14px;
    font-size: .95rem; color: var(--ink);
    max-width: 80%; line-height: 1.45;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.msg-row.user .msg-bubble { background: var(--brand); color: #fff; border-color: var(--brand); }
.msg-bubble.typing { display: inline-flex; gap: 4px; padding: 12px 16px; }
.msg-bubble.typing span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
    animation: typing 1.4s infinite both;
}
.msg-bubble.typing span:nth-child(2) { animation-delay: .2s; }
.msg-bubble.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chatbot-quickreplies {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 0 0 10px 36px;
}
.chatbot-quickreplies .chip {
    background: #fff; color: var(--brand-dark);
    border: 1.5px solid var(--brand);
    padding: 8px 14px; border-radius: 999px;
    font-size: .9rem; font-weight: 600;
    cursor: pointer; transition: .1s;
    font-family: inherit;
}
.chatbot-quickreplies .chip:hover { background: var(--brand); color: #fff; }

/* CTA final (lien affiliation) */
.chatbot-final-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    margin: 8px 0 0 36px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff !important;
    padding: 14px 24px; border-radius: 12px;
    font-weight: 800; font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(217,119,6,.35);
    transition: .1s;
}
.chatbot-final-cta:hover {
    transform: translateY(-1px); box-shadow: 0 6px 20px rgba(217,119,6,.5);
    text-decoration: none; color: #fff !important;
}

.chatbot-input {
    display: flex; gap: 8px; padding: 14px 18px;
    background: #fff; border-top: 1px solid var(--line);
}
.chatbot-input input {
    flex: 1; padding: 11px 14px;
    border: 1.5px solid var(--line); border-radius: 10px;
    font-size: .95rem; color: var(--ink);
    background: #f8fafc;
    font-family: inherit;
}
.chatbot-input input:focus { outline: none; border-color: var(--brand); background: #fff; }
.chatbot-input button {
    background: var(--brand); color: #fff;
    border: 0; border-radius: 10px;
    padding: 0 20px; font-weight: 700; font-size: .95rem;
    cursor: pointer; transition: .1s;
    font-family: inherit;
}
.chatbot-input button:hover { background: var(--brand-dark); }
.chatbot-input button:disabled { background: #cbd5e1; cursor: not-allowed; }

.chatbot-privacy {
    font-size: .78rem; color: var(--muted);
    padding: 8px 18px 14px; background: #fff; border-top: 1px solid var(--line);
}
.chatbot-privacy a { color: var(--brand); }

@media (max-width: 600px) {
    .chatbot-window { min-height: 260px; max-height: 360px; padding: 14px; }
    .msg-bubble { max-width: 82%; font-size: .92rem; }
    .chatbot-quickreplies { margin-left: 0; }
    .chatbot-final-cta { margin-left: 0; width: 100%; }
}
