/* ── Inzerty FAQ Chatbot — Widget Front-end ── */
:root {
    --ifaq-teal:   #68C0B5;
    --ifaq-navy:   #053D5D;
    --ifaq-navy2:  #053D5D;
    --ifaq-white:  #ffffff;
    --ifaq-bg:     #f5f8fb;
    --ifaq-border: #e2e8f0;
    --ifaq-text:   #2c3e50;
    --ifaq-muted:  #7f8c9a;
    --ifaq-shadow: 0 8px 40px rgba(0,0,0,.18);
    --ifaq-r:      16px;
}

/* ── Bouton flottant ───────────────────────────────────────────────── */
#ifaq-chatbot { position: fixed; bottom: 28px; left: 28px; z-index: 99999; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

#ifaq-toggle-btn {
    width: 64px; height: 64px; border-radius: 50%;
    background: #ffffff;
    border: 3px solid #053D5D;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(5,61,93,.25);
    display: flex; align-items: center; justify-content: center;
    transition: transform .25s, box-shadow .25s;
    position: relative;
    padding: 0;
}
#ifaq-toggle-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(5,61,93,.35); }

/* Icône chat SVG */
#ifaq-toggle-btn .ifaq-icon-open {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
#ifaq-toggle-btn .ifaq-icon-open svg { width: 34px; height: 34px; }

#ifaq-toggle-btn .ifaq-icon-close {
    display: none;
    width: 28px; height: 28px; border-radius: 50%;
    background: #053D5D; color: #fff;
    font-size: 14px; font-weight: 700; line-height: 1;
    align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Badge ? */
#ifaq-toggle-btn .ifaq-badge {
    position: absolute; top: -5px; right: -5px;
    width: 22px; height: 22px; border-radius: 50%;
    background: #053D5D; color: #fff;
    font-size: 12px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
    animation: ifaq-pulse 2.5s infinite;
}
@keyframes ifaq-pulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}

/* État ouvert */
#ifaq-chatbot.ifaq-open #ifaq-toggle-btn .ifaq-icon-open  { display: none; }
#ifaq-chatbot.ifaq-open #ifaq-toggle-btn .ifaq-icon-close { display: flex; }
#ifaq-chatbot.ifaq-open #ifaq-toggle-btn .ifaq-badge      { display: none; }

/* ── Fenêtre ────────────────────────────────────────────────────────── */
#ifaq-window {
    position: absolute; bottom: 76px; left: 0;
    width: 360px; max-height: 540px;
    background: var(--ifaq-white); border-radius: var(--ifaq-r);
    box-shadow: var(--ifaq-shadow);
    display: flex; flex-direction: column;
    overflow: hidden;
    transform: scale(.85) translateY(20px);
    opacity: 0; pointer-events: none;
    transform-origin: bottom left;
    transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
}
#ifaq-chatbot.ifaq-open #ifaq-window {
    transform: scale(1) translateY(0);
    opacity: 1; pointer-events: all;
}

/* Header */
#ifaq-header {
    background: #053D5D;
    color: #fff; padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
#ifaq-header-info { display: flex; align-items: center; gap: 12px; }
#ifaq-avatar { font-size: 26px; width: 42px; height: 42px; background: rgba(255,255,255,.12); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#ifaq-header strong { display: block; font-size: 15px; font-weight: 700; }
#ifaq-header span { font-size: 11px; opacity: .75; }
#ifaq-close-btn { background: rgba(255,255,255,.15); border: none; color: #fff; width: 30px; height: 30px; min-width: 30px; min-height: 30px; max-width: 30px; max-height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: background .15s; flex-shrink: 0; padding: 0; line-height: 1; box-sizing: content-box; }
#ifaq-close-btn:hover { background: rgba(255,255,255,.3); }

/* Messages area */
#ifaq-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--ifaq-bg); scroll-behavior: smooth; }
#ifaq-messages::-webkit-scrollbar { width: 5px; }
#ifaq-messages::-webkit-scrollbar-thumb { background: var(--ifaq-border); border-radius: 3px; }

/* Bulles */
.ifaq-bubble {
    background: var(--ifaq-white); border-radius: 4px 14px 14px 14px;
    padding: 12px 16px; font-size: 13.5px; line-height: 1.55;
    color: var(--ifaq-text); border: 1px solid var(--ifaq-border);
    box-shadow: 0 1px 4px rgba(0,0,0,.06); max-width: 90%; align-self: flex-start;
    animation: ifaq-fadein .25s ease;
}
.ifaq-msg-answer {
    background: var(--ifaq-white); border-left: 3px solid var(--ifaq-teal);
    border-radius: 4px 14px 14px 14px;
    padding: 14px 16px; font-size: 13.5px; line-height: 1.6;
    color: var(--ifaq-text); box-shadow: 0 1px 6px rgba(0,0,0,.07);
    max-width: 92%; align-self: flex-start;
    animation: ifaq-fadein .25s ease;
}
@keyframes ifaq-fadein { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* Questions list */
#ifaq-questions-list { display: flex; flex-direction: column; gap: 8px; }
.ifaq-q-btn {
    background: var(--ifaq-white); border: 1.5px solid var(--ifaq-teal);
    color: var(--ifaq-teal); border-radius: 22px;
    padding: 9px 18px; font-size: 13px; font-weight: 600;
    cursor: pointer; text-align: left; transition: all .18s;
    animation: ifaq-fadein .25s ease;
}
.ifaq-q-btn:hover { background: var(--ifaq-teal); color: #fff; transform: translateX(4px); }

/* Bulle question utilisateur */
.ifaq-msg-user {
    background: var(--ifaq-teal); color: #fff;
    border-radius: 14px 14px 4px 14px;
    padding: 10px 16px; font-size: 13px; font-weight: 600;
    align-self: flex-end; max-width: 80%;
    animation: ifaq-fadein .2s ease;
    box-shadow: 0 2px 8px rgba(104,192,181,.35);
}

/* Loading */
.ifaq-loading { text-align: center; color: var(--ifaq-muted); font-size: 13px; padding: 20px; }
.ifaq-typing { display: flex; gap: 5px; padding: 12px 16px; align-self: flex-start; }
.ifaq-typing span { width: 8px; height: 8px; background: var(--ifaq-muted); border-radius: 50%; animation: ifaq-bounce .9s infinite; }
.ifaq-typing span:nth-child(2) { animation-delay: .15s; }
.ifaq-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes ifaq-bounce { 0%,80%,100% { transform:scale(1); opacity:.4; } 40% { transform:scale(1.4); opacity:1; } }

/* Footer */
#ifaq-footer { padding: 10px 16px; border-top: 1px solid var(--ifaq-border); display: flex; align-items: center; justify-content: space-between; background: var(--ifaq-white); flex-shrink: 0; }
#ifaq-footer span { font-size: 11px; color: var(--ifaq-muted); }
#ifaq-footer strong { color: var(--ifaq-navy); }
#ifaq-back-btn { background: none; border: none; color: var(--ifaq-teal); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background .15s; }
#ifaq-back-btn:hover { background: var(--ifaq-bg); }

/* Mobile */
@media (max-width: 480px) {
    #ifaq-chatbot { bottom: 16px; left: 16px; }
    #ifaq-window  { width: calc(100vw - 32px); }
}

/* ── Boutons de choix (Oui/Non, Candidat/Structure) ────────────────── */
.ifaq-choice-row { display: flex; gap: 8px; flex-wrap: wrap; animation: ifaq-fadein .25s ease; }
.ifaq-choice-btn {
    flex: 1; min-width: 110px; padding: 10px 14px; border-radius: 10px;
    border: 2px solid; cursor: pointer; font-size: 13px; font-weight: 700;
    transition: all .18s; background: #fff;
}
.ifaq-choice-yes      { border-color: #1e8449; color: #1e8449; }
.ifaq-choice-yes:hover { background: #1e8449; color: #fff; }
.ifaq-choice-no       { border-color: #c0392b; color: #c0392b; }
.ifaq-choice-no:hover  { background: #c0392b; color: #fff; }
.ifaq-choice-candidat  { border-color: #2980b9; color: #2980b9; }
.ifaq-choice-candidat:hover  { background: #2980b9; color: #fff; }
.ifaq-choice-structure { border-color: #d68910; color: #d68910; }
.ifaq-choice-structure:hover { background: #d68910; color: #fff; }
.ifaq-choice-more    { border-color: #68C0B5; color: #68C0B5; font-size: 12px; }
.ifaq-choice-more:hover { background: #68C0B5; color: #fff; }
.ifaq-choice-restart { border-color: #95a5a6; color: #7f8c8d; font-size: 12px; }
.ifaq-choice-restart:hover { background: #95a5a6; color: #fff; }
.ifaq-more-row { margin-top: 6px; }

/* Questions list */
.ifaq-q-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Couleurs Candidat / Structure ── */
.ifaq-choice-candidat         { border-color: #B297C7; color: #B297C7; }
.ifaq-choice-candidat:hover   { background: #B297C7; color: #fff; }
.ifaq-choice-structure        { border-color: #83D0F5; color: #3a8fb5; }
.ifaq-choice-structure:hover  { background: #83D0F5; color: #fff; }

/* Questions colorées selon profil */
.ifaq-q-btn--candidat  { border-color: #B297C7 !important; color: #B297C7 !important; }
.ifaq-q-btn--candidat:hover  { background: #B297C7 !important; color: #fff !important; }
.ifaq-q-btn--structure { border-color: #83D0F5 !important; color: #3a8fb5 !important; }
.ifaq-q-btn--structure:hover { background: #83D0F5 !important; color: #fff !important; }

/* Oui / Non */
.ifaq-choice-yes      { border-color: #68C0B5; color: #068C7C; }
.ifaq-choice-yes:hover { background: #68C0B5; color: #fff; }
.ifaq-choice-no       { border-color: #ccc; color: #777; }
.ifaq-choice-no:hover  { background: #ccc; color: #fff; }
