/* CLIK.ma - the cookie window (orestbida CookieConsent 3.1.0, run in _js_files.tpl), drawn like the site's windows:
   "Vos cookies [cube]CLIK.ma", the cookie in the cube's colours that rolls in and takes a bite, one 8 px rhythm,
   solid green / red switches, day and night, right to left, the whole width above the bottom bar on phones.
   Nothing moves with "less motion". */

#cc-main {
  --cc-font-family: var(--body-font-family);
  --cc-bg: #fff;
  --cc-primary-color: #1c1e21;
  --cc-secondary-color: #65676b;
  --cc-modal-border-radius: 16px;
  --cc-btn-border-radius: 999px;
  --cc-modal-margin: 16px;
  --cc-btn-primary-bg: #0866FF;
  --cc-btn-primary-color: #fff;
  --cc-btn-primary-border-color: transparent;
  --cc-btn-primary-hover-bg: #0757d9;
  --cc-btn-primary-hover-color: #fff;
  --cc-btn-primary-hover-border-color: transparent;
  --cc-btn-secondary-bg: #e4e6eb;
  --cc-btn-secondary-color: #1c1e21;
  --cc-btn-secondary-border-color: transparent;
  --cc-btn-secondary-hover-bg: #d8dadf;
  --cc-btn-secondary-hover-color: #1c1e21;
  --cc-btn-secondary-hover-border-color: transparent;
  --cc-separator-border-color: #e4e6eb;
  --cc-toggle-on-bg: #16A34A;
  --cc-toggle-off-bg: #C5CBDB;
  --cc-toggle-on-knob-bg: #fff;
  --cc-toggle-off-knob-bg: #fff;
  --cc-toggle-enabled-icon-color: #fff;
  --cc-toggle-disabled-icon-color: #fff;
  --cc-toggle-readonly-bg: #16A34A;
  --cc-toggle-readonly-knob-bg: #fff;
  --cc-toggle-readonly-knob-icon-color: #16A34A;
  --cc-cookie-category-block-bg: #f0f2f5;
  --cc-cookie-category-block-border: transparent;
  --cc-cookie-category-block-hover-bg: #e9ebee;
  --cc-cookie-category-block-hover-border: transparent;
  --cc-cookie-category-expanded-block-bg: #f0f2f5;
  --cc-cookie-category-expanded-block-hover-bg: #e9ebee;
  --cc-overlay-bg: rgba(5, 10, 25, .55);
  --cc-link-color: #0866FF;
  --cc-footer-bg: #f7f8fa;
  --cc-footer-color: #65676b;
  --cc-footer-border-color: #e4e6eb;
  --ck-ink: #1c1e21;
  --ck-chip: #f0f2f5;
}
body.night-mode #cc-main,
.cc--darkmode #cc-main {
  --cc-bg: #242526;
  --cc-toggle-off-bg: #4A5068;
  --cc-primary-color: #e4e6eb;
  --cc-secondary-color: #b0b3b8;
  --cc-btn-secondary-bg: #3a3b3c;
  --cc-btn-secondary-color: #e4e6eb;
  --cc-btn-secondary-hover-bg: #4e4f50;
  --cc-btn-secondary-hover-color: #fff;
  --cc-separator-border-color: #3a3b3c;
  --cc-cookie-category-block-bg: #3a3b3c;
  --cc-cookie-category-block-hover-bg: #4e4f50;
  --cc-cookie-category-expanded-block-bg: #3a3b3c;
  --cc-cookie-category-expanded-block-hover-bg: #4e4f50;
  --cc-link-color: #4c9aff;
  --cc-footer-bg: #1c1d1e;
  --cc-footer-color: #b0b3b8;
  --cc-footer-border-color: #3a3b3c;
  --cc-overlay-bg: rgba(0, 0, 0, .65);
  --ck-ink: #e4e6eb;
  --ck-chip: #3a3b3c;
  color-scheme: dark;
}

/* ---------- the first window ---------- */
#cc-main .cm {
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(8, 20, 60, .22), 0 2px 6px rgba(8, 20, 60, .08);
  overflow: hidden;
  isolation: isolate;
}
body.night-mode #cc-main .cm,
.cc--darkmode #cc-main .cm { box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
/* a line in the cube's colours along its top, its light running */
#cc-main .cm::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #0A5CFF, #F5104F, #FFD200, #0A5CFF);
  background-size: 300% 100%;
  z-index: 2;
}
#cc-main .cm--box:not(.cm--wide) { width: 400px; max-width: calc(100vw - 32px); }
#cc-main .cm--box.cm--wide { width: 560px; max-width: calc(100vw - 32px); }
#cc-main .cm__body { padding: 0; }
#cc-main .cm__texts { padding: 16px 16px 0; gap: 8px; }
#cc-main .cm__title,
#cc-main .cm__desc { padding: 0 !important; }
#cc-main .cm__title + .cm__desc { margin-top: 0; }
#cc-main .cm__title { font-size: 18px; line-height: 1.25; font-weight: 700; color: var(--cc-primary-color); }
#cc-main .clik-ck-title {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
#cc-main .clik-ck-title > .clik-brand.is-inline {
  display: inline-flex !important;
  align-items: center;
  flex: none;
  gap: 6px;
  margin: 0 !important;
}
#cc-main .clik-brand.is-inline .clik-brand-cube { display: block; width: 20px !important; height: 22px !important; flex: none; }
#cc-main .clik-brand.is-inline .clik-brand-word { display: block; width: auto !important; height: 18px !important; max-width: none; background: none !important; }
#cc-main .clik-brand.is-inline .clik-brand-word.is-dark { display: none; }
body.night-mode #cc-main .clik-brand.is-inline .clik-brand-word.is-light { display: none; }
body.night-mode #cc-main .clik-brand.is-inline .clik-brand-word.is-dark { display: block; }
#cc-main .cm__desc {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-height: 40vh;
  padding-bottom: 0 !important;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cc-secondary-color);
}
#cc-main .clik-ck-desc { flex: 1; min-width: 0; }
#cc-main .clik-ck-more {
  color: var(--cc-link-color);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
#cc-main .clik-ck-more:hover { text-decoration: underline; }
#cc-main .cm__btns {
  padding: 16px !important;
  border-top: 0 !important;
  gap: 8px;
}
#cc-main .cm__btn-group { gap: 8px; }
#cc-main .cm__btn + .cm__btn,
#cc-main .cm__btn-group + .cm__btn-group { margin: 0 !important; }
#cc-main .cm__btn,
#cc-main .pm__btn {
  position: relative;
  overflow: hidden;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  border: 0;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
#cc-main .cm__btn:not(.cm__btn--secondary),
#cc-main .pm__btn:not(.pm__btn--secondary) {
  background: linear-gradient(135deg, #0A5CFF, #3b82ff);
  box-shadow: 0 4px 12px rgba(8, 102, 255, .28);
}
#cc-main .cm__btn:not(.cm__btn--secondary):hover,
#cc-main .pm__btn:not(.pm__btn--secondary):hover { background: linear-gradient(135deg, #0751e0, #2a72f5); }
#cc-main .cm__btn:focus-visible,
#cc-main .pm__btn:focus-visible,
#cc-main .pm__close-btn:focus-visible,
#cc-main .clik-ck-more:focus-visible { outline: 2px solid #0866FF; outline-offset: 2px; }
/* the art: the cookie, 56 px, before the words */
#cc-main .clik-ck-art {
  flex: none;
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
}
#cc-main .clik-ck-art svg { display: block; width: 56px; height: 56px; overflow: visible; filter: drop-shadow(0 4px 6px rgba(150, 90, 20, .25)); }
#cc-main .clik-ck-bitec { transform-box: fill-box; transform-origin: center; transform: scale(1); }
#cc-main .clik-ck-crumbs { opacity: 0; }

/* phones: the whole width, above the bottom bar, square sides */
@media (max-width: 668px) {
  #cc-main .cm,
  #cc-main .cm--box:not(.cm--wide),
  #cc-main .cm--box.cm--wide {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    bottom: calc(45px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 16px 16px 0 0;
  }
  #cc-main .cm--bar { bottom: calc(45px + env(safe-area-inset-bottom, 0px)) !important; }
  #cc-main .cm__title { font-size: clamp(16px, 4.6vw, 18px); }
  #cc-main .cm__texts { padding: 16px 16px 0; }
  #cc-main .cm__btns { padding: 16px !important; }
  #cc-main .clik-ck-art,
  #cc-main .clik-ck-art svg { width: 48px; height: 48px; }
}
/* beside the chat bar on a computer (a member's page keeps 94 px for it) */
@media (min-width: 1200px) {
  body:has(.chat-sidebar:not(.disabled)) #cc-main .cm--box.cm--right { right: 110px; }
  body:has(.chat-sidebar:not(.disabled)) #cc-main .cm--box.cm--left { left: 110px; }
}

/* ---------- the preferences ---------- */
#cc-main .pm {
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(8, 20, 60, .3);
}
#cc-main .pm__header { padding: 16px !important; gap: 8px; }
#cc-main .pm__title { margin: 0; font-size: 18px; font-weight: 700; min-width: 0; }
#cc-main .pm__title .clik-ck-title { flex-wrap: nowrap; }
#cc-main .pm__close-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #e4e6eb;
  transition: transform .2s ease, background-color .15s ease;
}
#cc-main .pm__close-btn svg { stroke: #606770; }
#cc-main .pm__close-btn:hover { background: #d8dadf; transform: rotate(90deg); }
body.night-mode #cc-main .pm__close-btn,
.cc--darkmode #cc-main .pm__close-btn { background: #3a3b3c; }
body.night-mode #cc-main .pm__close-btn svg,
.cc--darkmode #cc-main .pm__close-btn svg { stroke: #e4e6eb; }
#cc-main .pm__body { padding: 16px !important; }
#cc-main .pm__section { border-radius: 12px; padding: 12px; margin-bottom: 8px; }
#cc-main .pm__section--toggle { margin-bottom: 8px; background: transparent; }
#cc-main .pm__section--toggle .pm__section-title { border-radius: 12px; min-height: 52px; }
#cc-main .pm__section--toggle.is-expanded .pm__section-title { border-radius: 12px 12px 0 0; }
#cc-main .pm__section--toggle .pm__section-desc-wrapper { border-radius: 0 0 12px 12px; border-color: var(--cc-cookie-category-block-bg); }
#cc-main .pm__section-toggles + .pm__section { margin-top: 8px; }
#cc-main .pm__section-desc { font-size: 14px; color: var(--cc-secondary-color); }
#cc-main .pm__section-desc a { color: var(--cc-link-color); font-weight: 600; }
#cc-main .pm__footer { padding: 16px !important; gap: 8px; }
#cc-main .pm__btn-group { gap: 8px; }
#cc-main .pm__btn + .pm__btn,
#cc-main .pm__btn-group + .pm__btn-group { margin: 0 !important; }
/* the switches: solid green on, solid red off (the switch rule), the necessary one green, dimmed */
#cc-main .section__toggle:checked:disabled ~ .toggle__icon { opacity: .6; }
#cc-main .section__toggle:focus-visible ~ .toggle__icon { outline: 2px solid #0866FF; outline-offset: 2px; }
/* when the choice was last made */
#cc-main .clik-ck-last {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ck-chip);
  color: var(--cc-primary-color);
  font-size: 12px;
  font-weight: 600;
}
#cc-main .clik-ck-last::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #16A34A;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .2);
}
@media (max-width: 640px) {
  #cc-main .pm { border-radius: 0; }
  #cc-main .pm__header,
  #cc-main .pm__body,
  #cc-main .pm__footer { padding: 16px !important; }
  #cc-main .pm__title { font-size: clamp(16px, 4.6vw, 18px); }
}

/* ---------- the choice saved: the burst, then the toast ---------- */
.clik-ck-bit {
  position: fixed;
  z-index: 2147483647;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
}
.clik-ck-bit.is-crumb { border-radius: 50%; width: 6px; height: 6px; }
.clik-ck-toast {
  position: fixed;
  z-index: 2147483646;
  left: 50%;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  /* its own width (7 Nov): placed at 50 % with no width, the browser gave it only half the screen and « Vos choix sont
     enregistrés » was cut to « Vos choix sont en… » */
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: #1c1e21;
  color: #fff;
  font-family: var(--body-font-family);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.3), opacity .25s ease;
}
[dir="rtl"] .clik-ck-toast { padding: 8px 16px 8px 8px; }
.clik-ck-toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.clik-ck-toast-ic { font-size: 18px; line-height: 1; }
.clik-ck-toast > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clik-ck-toast button {
  flex: none;
  min-height: 32px;
  padding: 4px 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #1c1e21;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.clik-ck-toast button:focus-visible { outline: 2px solid #4c9aff; outline-offset: 2px; }
body.night-mode .clik-ck-toast { background: #e4e6eb; color: #1c1e21; }
body.night-mode .clik-ck-toast button { background: #1c1e21; color: #fff; }
@media (max-width: 668px) {
  .clik-ck-toast { bottom: calc(45px + 12px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 359px) {
  .clik-ck-toast { font-size: 13px; gap: 6px; }
  .clik-ck-toast button { padding: 4px 10px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .show--consent #cc-main .cm::before { animation: clik-ck-run 6s linear infinite; }
  .show--consent #cc-main .cm .clik-ck-title,
  .show--consent #cc-main .cm .clik-ck-desc,
  .show--consent #cc-main .cm .cm__btn {
    animation: clik-ck-up .5s cubic-bezier(.2, .8, .3, 1) both;
  }
  .show--consent #cc-main .cm .clik-ck-desc { animation-delay: .08s; }
  .show--consent #cc-main .cm .cm__btn { animation-delay: .16s; }
  .show--consent #cc-main .cm .cm__btn-group + .cm__btn-group .cm__btn,
  .show--consent #cc-main .cm .cm__btn + .cm__btn { animation-delay: .22s; }
  /* the cookie rolls in, takes two bites (crumbs fall), then rocks a little now and then */
  .show--consent #cc-main .clik-ck-art svg { animation: clik-ck-roll .8s cubic-bezier(.2, .9, .3, 1.2) both, clik-ck-rock 5s ease-in-out 2.2s infinite; }
  .show--consent #cc-main.cc--rtl .clik-ck-art svg { animation-name: clik-ck-roll-rtl, clik-ck-rock; }
  .show--consent #cc-main .clik-ck-bitec { animation: clik-ck-bite .28s cubic-bezier(.3, 1.4, .5, 1) 1s both; }
  .show--consent #cc-main .clik-ck-bitec.is-2 { animation-delay: 1.45s; }
  .show--consent #cc-main .clik-ck-crumbs { animation: clik-ck-crumbs 1.1s ease-in 1.1s both; }
  /* a light runs over "accept" every few seconds */
  .show--consent #cc-main .cm__btn:not(.cm__btn--secondary)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: clik-ck-shine 4.5s ease-in-out 2.4s infinite;
    pointer-events: none;
  }
  #cc-main .cm__btn:hover,
  #cc-main .pm__btn:hover { transform: translateY(-1px); }
  #cc-main .cm__btn:active,
  #cc-main .pm__btn:active { transform: scale(.97); }
  .clik-ck-bit { animation: clik-ck-fly .95s cubic-bezier(.15, .7, .3, 1) forwards; }
  .show--preferences #cc-main .pm__section { animation: clik-ck-up .45s cubic-bezier(.2, .8, .3, 1) both; }
  .show--preferences #cc-main .pm__section:nth-child(2) { animation-delay: .05s; }
  .show--preferences #cc-main .pm__section:nth-child(3) { animation-delay: .1s; }
  .show--preferences #cc-main .pm__section:nth-child(4) { animation-delay: .15s; }
  .show--preferences #cc-main .pm__section:nth-child(n+5) { animation-delay: .2s; }
}
@media (prefers-reduced-motion: reduce) {
  #cc-main .cm__btn,
  #cc-main .pm__btn,
  #cc-main .pm__close-btn,
  .clik-ck-toast { transition: none; }
  .clik-ck-bit { display: none; }
}
@keyframes clik-ck-run { to { background-position: 300% 0; } }
@keyframes clik-ck-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes clik-ck-roll { from { opacity: 0; transform: translateX(-48px) rotate(-240deg); } to { opacity: 1; transform: none; } }
@keyframes clik-ck-roll-rtl { from { opacity: 0; transform: translateX(48px) rotate(240deg); } to { opacity: 1; transform: none; } }
@keyframes clik-ck-rock { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-9deg); } 95% { transform: rotate(6deg); } }
@keyframes clik-ck-bite { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes clik-ck-crumbs { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(18px); } }
@keyframes clik-ck-shine { 0% { transform: translateX(-120%); } 30%, 100% { transform: translateX(120%); } }
@keyframes clik-ck-fly {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 40px)) rotate(var(--rot)) scale(.6); }
}

/* the cookie window steps aside while the sign-in window or a site window is open (on a phone it covered the sign-up form's
   lower half, above its « Recevoir le code » button) and comes back when it closes - its choice is still asked */
html body.clik-auth-open #cc-main, html body.modal-open #cc-main { opacity: 0 !important; pointer-events: none !important; }
html body.clik-auth-open #cc-main *, html body.modal-open #cc-main * { visibility: hidden !important; pointer-events: none !important; }
