/* ══════════════════════════════════════
   CHAT IA — FASTBOT (widget partagé)
   ══════════════════════════════════════ */
.ai-chat-mount {
    min-height: 480px;
    display: block;
}
.ai-chat-widget {
    background: #fff;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 8px 40px rgba(6,187,204,.13);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 480px;
    font-family: 'Heebo', sans-serif;
}
.chat-header {
    background: linear-gradient(135deg, #181d38 0%, #0e2a4a 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.chat-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #06BBCC;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    position: relative;
}
.chat-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px; right: 2px;
    width: 10px; height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #181d38;
}
.chat-header-info h4 { margin: 0; color: #fff; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .95rem; }
.chat-header-info span { font-size: .75rem; color: rgba(255,255,255,.6); }
.chat-badge {
    margin-left: auto;
    background: rgba(6,187,204,.2);
    color: #06BBCC;
    font-size: .7rem; font-weight: 700;
    padding: 3px 10px; border-radius: 50px;
    border: 1px solid rgba(6,187,204,.3);
    text-transform: uppercase; letter-spacing: .06em;
}
.chat-messages {
    flex: 1; overflow-y: auto;
    padding: 20px 16px;
    display: flex; flex-direction: column; gap: 12px;
    background: #f8fafc;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.msg { display: flex; gap: 8px; align-items: flex-end; animation: msgIn .3s ease; }
@keyframes msgIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }
.msg.bot { flex-direction: row; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: #06BBCC;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; flex-shrink: 0; color: #fff;
}
.msg-bubble {
    max-width: 75%; padding: 10px 14px; border-radius: 16px;
    font-size: .85rem; line-height: 1.5; position: relative;
}
.msg.bot .msg-bubble {
    background: #fff; color: #181d38;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.msg.user .msg-bubble {
    background: #06BBCC; color: #fff;
    border-bottom-right-radius: 4px;
}
.quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-reply {
    background: #F0FBFC; border: 1.5px solid #06BBCC; color: #06BBCC;
    font-size: .78rem; font-weight: 700; padding: 5px 12px; border-radius: 50px;
    cursor: pointer; transition: background .2s, color .2s;
    font-family: 'Nunito', sans-serif;
}
.quick-reply:hover { background: #06BBCC; color: #fff; }
.typing {
    display: flex; align-items: center; gap: 4px; padding: 10px 14px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
    border-bottom-left-radius: 4px; width: fit-content;
}
.typing span { width: 7px; height: 7px; background: #06BBCC; border-radius: 50%; animation: bounce .9s infinite; opacity: .4; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,80%,100% { transform: translateY(0); opacity:.4; } 40% { transform: translateY(-6px); opacity:1; } }
.chat-input-area {
    padding: 14px 16px; border-top: 1px solid #e2e8f0;
    display: flex; gap: 8px; background: #fff; flex-shrink: 0;
}
.chat-input {
    flex: 1; border: 1.5px solid #e2e8f0; border-radius: 24px;
    padding: 10px 18px; font-family: 'Heebo', sans-serif; font-size: .88rem;
    color: #181d38; outline: none; transition: border-color .3s; background: #f8fafc;
}
.chat-input:focus { border-color: #06BBCC; background: #fff; }
.chat-send {
    width: 42px; height: 42px; border-radius: 50%; background: #06BBCC;
    border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; transition: background .3s, transform .2s; flex-shrink: 0;
}
.chat-send:hover { background: #059aaa; transform: scale(1.08); }

/* ══════════════════════════════════════════════════════════════
   BULLE DE CHAT FLOTTANTE (pour les pages sans section contact dédiée)
   ══════════════════════════════════════════════════════════════ */
.ai-chat-bubble-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #06BBCC;
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(6,187,204,.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 9998;
    transition: transform .25s, box-shadow .25s;
}
.ai-chat-bubble-btn:hover { transform: scale(1.08); box-shadow: 0 12px 32px rgba(6,187,204,.5); }
.ai-chat-bubble-btn .bubble-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 12px; height: 12px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #fff;
}

.ai-chat-bubble-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 32px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.97);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.ai-chat-bubble-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.ai-chat-bubble-panel .ai-chat-widget { height: 460px; }
@media (max-width: 480px) {
    .ai-chat-bubble-panel { right: 16px; bottom: 88px; }
    .ai-chat-bubble-btn { right: 16px; bottom: 16px; }
}

/* ══════════════════════════════════════════════════════════════
   ZONES D'UPLOAD DE DOCUMENTS (pièce d'identité, justificatif de domicile)
   Style partagé, utilisé dans le formulaire de demande de crédit
   (index.html, courses.html) — cohérent avec register.html.
   ══════════════════════════════════════════════════════════════ */
.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .3s, background .3s;
    background: #fdfdfd;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-zone:hover { border-color: #06BBCC; background: rgba(6,187,204,0.04); }
.upload-zone.has-file { border-color: #1abc9c; background: rgba(26,188,156,0.05); }
.upload-placeholder { pointer-events: none; }
.file-preview {
    display: flex; align-items: center; gap: 10px;
    pointer-events: none;
}
.file-preview i { font-size: 1.5rem; color: #1abc9c; }
.file-preview .file-name { font-size: 0.82rem; color: #181d38; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview .file-size { font-size: 0.75rem; color: #888; }

/* ══════════════════════════════════════════════════════════════
   FORMULAIRE DE DEMANDE DE CRÉDIT
   Style partagé, utilisé sur index.html et courses.html.
   Les variables CSS (--light, --border, --dark, etc.) sont définies
   dans le <style> propre à chaque page.
   ══════════════════════════════════════════════════════════════ */
#credit-form-section { background: #fff; }
.credit-form-card {
    max-width: 900px;
    margin: 0 auto;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 44px;
}
@media (max-width: 576px) { .credit-form-card { padding: 28px 20px; } }
.credit-form-card .form-label {
    font-weight: 700;
    font-size: .82rem;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
}
.credit-form-card .form-control,
.credit-form-card .form-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    font-family: 'Heebo', sans-serif;
    font-size: .92rem;
    background: #fff;
}
.credit-form-card .form-control:focus,
.credit-form-card .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6,187,204,.12);
}
.credit-form-card textarea.form-control { resize: vertical; min-height: 100px; }
.credit-form-note {
    font-size: .8rem;
    color: var(--gray);
    background: #fff;
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 8px;
}
.credit-form-success {
    display: none;
    text-align: center;
    padding: 50px 20px;
}
.credit-form-success.show { display: block; }
.credit-form-success .icon-check {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(6,187,204,.12);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}
