/* Widget Festival Captain aux couleurs des Ardentes 2027 (piste B « tapis de jeu », visuel validé par le festival).
   Tout est rangé sous #fc-widget pour ne pas entrer en conflit avec les styles de lesardentes.be.
   Polices : usage web confirmé par Les Ardentes (27/11/2026). Cossette Texte est déjà chargée par leur site :
   la copie servie (deployer.sh) retire sa déclaration ci-dessous. */
@font-face { font-family: "Sketchimpact"; src: url("assets/SketchimpactSolid-Bold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Sienna"; src: url("assets/Sienna-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Sienna"; src: url("assets/Sienna-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Acki"; src: url("assets/AckiPreschool.ttf") format("truetype"); font-display: swap; }

#fc-widget {
  --cherry: #34141d; --raspberry: #a62948; --cream: #fbf5eb; --lime: #b1e065;
  --douce: rgba(251,245,235,.72);
  --titre: "Sketchimpact", Impact, sans-serif; --sous: "Sienna", Georgia, serif;
  --texte: "Cossette Texte", Georgia, serif; --main: "Acki", "Comic Sans MS", cursive;
  font-family: var(--texte); color: var(--cream); line-height: 1.4; text-align: left;
}
#fc-widget *, #fc-widget *::before, #fc-widget *::after { box-sizing: border-box; }
#fc-widget button { font: inherit; color: inherit; cursor: pointer; margin: 0; }
#fc-widget p, #fc-widget h3, #fc-widget form, #fc-widget label, #fc-widget ul, #fc-widget ol { margin: 0; }
/* Le site hôte met ses champs et ses liens en capitales, avec ses propres polices : on neutralise */
#fc-widget input, #fc-widget textarea, #fc-widget a, #fc-widget ::placeholder { text-transform: none; letter-spacing: normal; }
#fc-widget a { font-family: inherit; font-size: inherit; font-weight: inherit; }
/* Leur site impose aussi des angles droits aux champs (avec !important) : on force nos arrondis */
#fc-widget .prechat input:not([type=checkbox]), #fc-widget .barre input { border-radius: 999px !important; }
#fc-widget .prechat textarea { border-radius: 20px !important; }
#fc-widget .case input { border-radius: 50% !important; }

/* ---------- Bouton d'ouverture : le jeton pailleté ---------- */
#fc-widget .lanceur {
  position: fixed; right: 24px; bottom: 24px; z-index: 2147483000; width: 80px; height: 80px; padding: 0; border: 0; border-radius: 50%;
  background: url("assets/jeton.png") center / contain no-repeat; filter: drop-shadow(0 8px 12px rgba(52,20,29,.35));
  transition: transform .3s cubic-bezier(.3,1.5,.5,1);
}
#fc-widget .lanceur:hover { transform: translateY(-3px) rotate(-12deg); }
#fc-widget .lanceur:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
#fc-widget .lanceur .pastille { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--cherry); display: none; }
#fc-widget.nonlu .lanceur .pastille { display: block; }

/* ---------- Fenêtre ---------- */
#fc-widget .fen {
  position: fixed; right: 24px; bottom: 116px; z-index: 2147483001; width: 360px; height: min(690px, calc(100vh - 140px));
  display: flex; flex-direction: column; overflow: hidden; color: var(--cream);
  background: var(--cherry) url("assets/fond-cherry-9x16.jpg") center / cover; border-radius: 30px;
  box-shadow: 0 22px 50px rgba(52,20,29,.4);
  transform-origin: 90% 100%; transform: translateY(16px) scale(.95); opacity: 0; visibility: hidden;
  transition: transform .3s cubic-bezier(.3,1.3,.5,1), opacity .2s, visibility 0s .3s;
}
#fc-widget.ouvert .fen { transform: none; opacity: 1; visibility: visible; transition: transform .3s cubic-bezier(.3,1.3,.5,1), opacity .2s; }
#fc-widget .fermer {
  position: absolute; top: 18px; right: 18px; z-index: 3; width: 30px; height: 30px; padding: 0; border-radius: 50%;
  border: 1.5px solid currentColor; background: rgba(52,20,29,.85); color: var(--cream); display: grid; place-items: center;
}
#fc-widget .fermer:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
#fc-widget .fil { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 12px 22px 10px; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: rgba(251,245,235,.3) transparent; }

/* En-tête : le logo défile avec le contenu, seule la croix reste fixe */
#fc-widget .tete { padding: 14px 0 0; text-align: center; }
#fc-widget .logo { width: 140px; height: 54px; margin: 0 auto 8px; background: url("assets/logo-Cream.svg") center / contain no-repeat; }
#fc-widget .accueil { text-align: center; padding-top: 12px; }
#fc-widget .fil:not(.actif) .accueil { margin: auto 0; }
#fc-widget .ecrit { display: inline-block; font-family: var(--main); color: var(--lime); font-size: 21px; transform: rotate(-4deg); margin-bottom: 2px; }
#fc-widget .accueil h3 { font-family: var(--titre); font-weight: normal; text-transform: uppercase; font-size: 44px; line-height: .92; margin: 2px 0 8px; letter-spacing: .01em; color: var(--cream); }
#fc-widget .accueil h3 em { font-style: normal; color: var(--raspberry); }

/* Formulaire avant la discussion */
#fc-widget .prechat { text-align: left; margin-top: 16px; display: grid; gap: 9px; }
#fc-widget .prechat label.champ { display: grid; gap: 4px; }
#fc-widget .lib { font-family: var(--sous); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--douce); }
#fc-widget .lib b { color: var(--lime); }
#fc-widget .lib i { font-style: normal; font-weight: 500; letter-spacing: .02em; text-transform: none; }
#fc-widget .prechat input:not([type=checkbox]), #fc-widget .prechat textarea, #fc-widget .barre input {
  width: 100%; margin: 0; border: 0; background: rgba(0,0,0,.22); color: var(--cream); border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px rgba(251,245,235,.28); padding: 9px 13px; font: 15px/1.35 var(--texte);
}
#fc-widget .prechat input:not([type=checkbox]) { height: 40px; }
#fc-widget .prechat textarea { resize: none; min-height: 66px; border-radius: 20px; }
#fc-widget ::placeholder { color: rgba(251,245,235,.45) !important; opacity: 1; } /* lesardentes.be : ::placeholder { color: #171717 !important } */
#fc-widget .prechat :focus-visible, #fc-widget .barre :focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
#fc-widget .prechat .invalide { box-shadow: inset 0 0 0 2px var(--lime) !important; }
#fc-widget label { color: inherit; } /* lesardentes.be met tous les label en #171717 */
#fc-widget .case { display: flex; gap: 10px; align-items: center; font-family: var(--sous); font-weight: 500; font-size: 13px; line-height: 1.35; cursor: pointer; }
#fc-widget .case input { appearance: none; -webkit-appearance: none; flex: none; width: 19px; height: 19px; margin: 0; border: 1.5px solid var(--cream); border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; }
#fc-widget .case input:checked { background: var(--lime); border-color: var(--lime); }
#fc-widget .case input:checked::after { content: ""; width: 9px; height: 5px; border: solid var(--cherry); border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
#fc-widget .case input:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
#fc-widget .erreur { font-family: var(--sous); font-weight: 700; font-size: 12.5px; color: var(--lime); }
#fc-widget .erreur a { color: inherit; }
#fc-widget .demarrer { border: 0; height: 44px; margin-top: 3px; background: var(--raspberry); color: var(--cream); border-radius: 999px; font-family: var(--titre); font-size: 17px; letter-spacing: .03em; text-transform: uppercase; }
#fc-widget .demarrer:disabled { opacity: .6; cursor: wait; }
#fc-widget .confid { text-align: center; font-family: var(--sous); font-weight: 500; font-size: 11.5px; line-height: 1.4; color: var(--douce); }
#fc-widget .confid a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Messages */
#fc-widget .msg { display: flex; gap: 8px; align-items: flex-end; margin: 12px 0; animation: fc-arrive .3s ease-out; }
@keyframes fc-arrive { from { transform: translateY(10px); opacity: 0; } }
#fc-widget .msg.moi { justify-content: flex-end; }
#fc-widget .avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: repeating-conic-gradient(var(--raspberry) 0 22.5deg, var(--cream) 22.5deg 45deg); }
#fc-widget .avatar span { width: 20px; height: 20px; border-radius: 50%; background: var(--cherry) url("assets/fav-Cream.svg") center / 11px no-repeat; }
#fc-widget .bulle { max-width: 80%; font-size: 14.5px; line-height: 1.45; padding: 10px 13px; overflow-wrap: anywhere; }
#fc-widget .msg.agent .bulle { background: var(--cream); color: var(--cherry); border-radius: 20px 20px 20px 6px; }
#fc-widget .msg.moi .bulle { background: var(--raspberry); color: var(--cream); border-radius: 20px 20px 6px 20px; }
#fc-widget .msg.moi.echec .bulle { opacity: .55; }
#fc-widget .msg.systeme { justify-content: center; }
#fc-widget .msg.systeme .bulle { max-width: 100%; background: rgba(0,0,0,.25); color: var(--cream); border-radius: 14px; font-family: var(--sous); font-size: 13px; text-align: center; }
#fc-widget .bulle a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#fc-widget .bulle ul, #fc-widget .bulle ol { padding-left: 18px; margin: 4px 0; }
#fc-widget .bulle .piece { display: block; margin-top: 6px; }
#fc-widget .bulle .piece.image img { display: block; max-width: 100%; border-radius: 10px; }
#fc-widget .frappe .bulle { display: flex; gap: 6px; color: var(--raspberry); }
#fc-widget .frappe .bulle b { font-weight: normal; animation: fc-saute 1s infinite; }
#fc-widget .frappe .bulle b:nth-child(2) { animation-delay: .15s; }
#fc-widget .frappe .bulle b:nth-child(3) { animation-delay: .3s; }
#fc-widget .frappe .bulle b:nth-child(4) { animation-delay: .45s; }
@keyframes fc-saute { 30% { transform: translateY(-5px); } }

/* Barre de saisie et « Propulsé par » : en bas du formulaire, puis sous la barre pendant la discussion */
#fc-widget .pied { margin-top: auto; padding: 16px 0 8px; text-align: center; font-family: var(--sous); font-weight: 500; font-size: 11px; letter-spacing: .04em; color: var(--douce); }
#fc-widget .pied a { color: inherit; text-decoration: underline; text-decoration-color: rgba(251,245,235,.35); text-underline-offset: 2px; }
#fc-widget .pied a:hover { color: var(--cream); text-decoration-color: currentColor; }
#fc-widget.lance .fil > .pied { display: none; }
#fc-widget .saisie { position: relative; z-index: 1; padding: 8px 22px 12px; }
#fc-widget:not(.lance) .saisie { display: none; }
#fc-widget .saisie .pied { margin-top: 0; padding: 9px 0 0; }
#fc-widget .barre { display: flex; gap: 8px; }
#fc-widget .barre input { height: 44px; }
#fc-widget .envoyer { flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: var(--raspberry); color: var(--cream); border-radius: 50%; display: grid; place-items: center; }

/* Téléphone : fenêtre plein écran */
@media (max-width: 600px) {
  #fc-widget .lanceur { right: 14px; bottom: 14px; width: 70px; height: 70px; }
  #fc-widget .fen { inset: 0; width: auto; height: 100dvh; border-radius: 0; }
  #fc-widget.ouvert .lanceur { display: none; }
  #fc-widget .prechat input:not([type=checkbox]), #fc-widget .prechat textarea, #fc-widget .barre input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { #fc-widget *, #fc-widget *::before, #fc-widget *::after { animation: none !important; transition: none !important; } }

/* Cohabitation avec Complianz, l'outil de consentement de lesardentes.be : tant que le bandeau cookies est affiché,
   le widget s'efface (en bas à droite sur ordinateur, sur toute la largeur sur téléphone, le jeton couvrirait ses boutons).
   L'onglet « Cookies » n'est pas touché : Les Ardentes le passent à gauche (demande du 27/11/2026). */
body:has(.cmplz-cookiebanner.cmplz-show) #fc-widget { display: none; }
