/* Assistant OFYI — widget de chat */
.ofc-launcher {
   position: fixed;
   right: 24px;
   bottom: 24px;
   z-index: 9998;
   width: 68px;
   height: 68px;
   padding: 0;
   border: 3px solid #94bd24;
   border-radius: 50%;
   background: #fff;
   cursor: pointer;
   box-shadow: 0 14px 30px -10px rgba(12, 46, 26, .55);
   display: flex;
   align-items: center;
   justify-content: center;
   transition: transform .2s, border-color .2s, background-color .2s;
}
/* halo discret pour attirer l'œil */
.ofc-launcher::before {
   content: "";
   position: absolute;
   inset: -3px;
   border-radius: 50%;
   border: 3px solid #94bd24;
   animation: ofcPulse 2.8s ease-out infinite;
   pointer-events: none;
}
@keyframes ofcPulse { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.45); opacity: 0; } }
.ofc-launcher:hover { transform: scale(1.06); }
.ofc-launcher:focus-visible { outline: 3px solid #144426; outline-offset: 4px; }
.ofc-launcher__tree { width: 46px; height: 46px; object-fit: contain; transition: opacity .2s, transform .2s; }
.ofc-launcher__badge {
   position: absolute;
   right: -4px;
   bottom: -2px;
   width: 26px;
   height: 26px;
   border-radius: 50%;
   background: #144426;
   border: 2px solid #fff;
   display: flex;
   align-items: center;
   justify-content: center;
}
.ofc-launcher__badge svg { width: 13px; height: 13px; fill: #fff; }
.ofc-launcher__close { position: absolute; display: none; }
.ofc-launcher__close svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.ofc-launcher.is-open { background: #144426; border-color: #144426; }
.ofc-launcher.is-open::before, .ofc-launcher.is-open .ofc-launcher__badge, .ofc-launcher.is-open .ofc-launcher__tree { display: none; }
.ofc-launcher.is-open .ofc-launcher__close { display: block; position: static; }
@media (prefers-reduced-motion: reduce) { .ofc-launcher::before { animation: none; opacity: 0; } }

/* bulle d'invitation */
.ofc-teaser {
   position: fixed;
   right: 104px;
   bottom: 38px;
   z-index: 9998;
   max-width: 240px;
   padding: 12px 16px;
   border: 0;
   border-radius: 16px 16px 4px 16px;
   background: #fff;
   color: #0c2e1a;
   font: 600 .9rem/1.4 "Poppins", "Roboto", sans-serif;
   text-align: left;
   cursor: pointer;
   box-shadow: 0 12px 30px -10px rgba(12, 46, 26, .45);
   border: 1px solid rgba(20, 68, 38, .12);
   animation: ofcIn .3s ease-out;
}
.ofc-teaser[hidden] { display: none; }
.ofc-teaser:hover { background: #f6f4ec; }

/* le bouton « retour en haut » se place au-dessus du chat */
#back-to-top { bottom: 100px !important; right: 30px !important; }

.ofc-panel {
   position: fixed;
   right: 24px;
   bottom: 100px;
   z-index: 9999;
   width: 380px;
   max-width: calc(100vw - 32px);
   height: min(600px, calc(100vh - 130px));
   display: flex;
   flex-direction: column;
   background: #fff;
   border-radius: 20px;
   overflow: hidden;
   box-shadow: 0 30px 60px -20px rgba(12, 46, 26, .45);
   border: 1px solid rgba(20, 68, 38, .12);
   font-family: "Roboto", Helvetica, Arial, sans-serif;
   animation: ofcIn .22s ease-out;
}
.ofc-panel[hidden] { display: none; }
@keyframes ofcIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.ofc-head {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 16px 14px 16px 18px;
   background: #0c2e1a;
   color: #fff;
}
.ofc-avatar {
   flex: 0 0 40px;
   width: 40px;
   height: 40px;
   border-radius: 50%;
   background: #fff;
   display: flex;
   align-items: center;
   justify-content: center;
   overflow: hidden;
}
.ofc-avatar img { width: 32px; height: 32px; object-fit: contain; }
.ofc-titles { flex: 1; min-width: 0; line-height: 1.25; }
.ofc-titles strong { display: block; font: 700 1rem "Poppins", "Roboto", sans-serif; color: #fff; }
.ofc-titles span { font-size: .78rem; color: #b9d98a; }
.ofc-titles span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #94bd24; margin-right: 6px; vertical-align: 1px; }
.ofc-icon {
   width: 34px;
   height: 34px;
   border: 0;
   border-radius: 50%;
   background: transparent;
   color: #cfe0d2;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
}
.ofc-icon:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ofc-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ofc-log {
   flex: 1;
   overflow-y: auto;
   padding: 18px 16px 8px;
   background: #f6f4ec;
   display: flex;
   flex-direction: column;
   gap: 10px;
}
.ofc-msg {
   max-width: 86%;
   padding: 11px 14px;
   border-radius: 16px;
   font-size: .94rem;
   line-height: 1.55;
   word-wrap: break-word;
   overflow-wrap: anywhere;
}
.ofc-msg p { margin: 0 0 6px; }
.ofc-msg p:last-child { margin: 0; }
.ofc-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.ofc-msg li { margin-bottom: 3px; }
.ofc-msg a { color: #1d5c34; font-weight: 600; text-decoration: underline; }
.ofc-assistant { align-self: flex-start; background: #fff; color: #1b1f1c; border: 1px solid rgba(20, 68, 38, .1); border-bottom-left-radius: 4px; }
.ofc-user { align-self: flex-end; background: #144426; color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }

.ofc-typing { display: flex; gap: 5px; padding: 14px 16px; }
.ofc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #7aa01a; animation: ofcDot 1.2s infinite ease-in-out; }
.ofc-typing span:nth-child(2) { animation-delay: .15s; }
.ofc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ofcDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.ofc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 12px; background: #f6f4ec; }
.ofc-chips[hidden] { display: none; }
.ofc-chip {
   border: 1px solid #94bd24;
   background: #fff;
   color: #144426;
   border-radius: 999px;
   padding: 7px 12px;
   font: 500 .82rem "Poppins", "Roboto", sans-serif;
   cursor: pointer;
}
.ofc-chip:hover { background: #94bd24; color: #0c2e1a; }

.ofc-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid rgba(20, 68, 38, .1); background: #fff; }
.ofc-form textarea {
   flex: 1;
   resize: none;
   border: 1px solid #d5dcd6;
   border-radius: 14px;
   padding: 11px 14px;
   font: .95rem/1.4 "Roboto", Helvetica, Arial, sans-serif;
   max-height: 120px;
   background: #fbfbf8;
   color: #1b1f1c;
}
.ofc-form textarea:focus { outline: none; border-color: #94bd24; box-shadow: 0 0 0 3px rgba(148, 189, 36, .25); background: #fff; }
.ofc-send {
   flex: 0 0 44px;
   width: 44px;
   height: 44px;
   border: 0;
   border-radius: 50%;
   background: #144426;
   color: #fff;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
}
.ofc-send:hover { background: #1d5c34; }
.ofc-send:disabled { opacity: .5; cursor: wait; }
.ofc-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.ofc-note { margin: 0; padding: 0 14px 10px; font-size: .7rem; color: #7b857f; background: #fff; text-align: center; }

@media (max-width: 520px) {
   .ofc-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; border-radius: 0; }
   body.ofc-open .ofc-launcher { display: none; }
   .ofc-launcher { right: 16px; bottom: 16px; width: 56px; height: 56px; }
   #back-to-top { bottom: 86px !important; right: 20px !important; }
}

/* le logo reste toujours dans le cercle (image détourée + découpe ronde) */
.ofc-launcher__tree { border-radius: 50%; }
@media (max-width: 520px) { .ofc-launcher__tree { width: 38px; height: 38px; } }
