/* ════════════════════════════════════════════════════════════
   Tensly — Cookie consent (RGPD / CNIL)
   ──────────────────────────────────────────────────────────── */

#tly-cc, #tly-cc-modal{
  --r:#fe4444; --ink:#0d0d0f; --carbon:#121212;
  font-family:'Inter','Helvetica Neue',Arial,sans-serif;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  box-sizing:border-box;
}
#tly-cc *,#tly-cc-modal *{box-sizing:border-box}

/* ─── Banner (bottom-right glass card) ──────────────────────── */
#tly-cc{
  position:fixed;
  left:24px;right:24px;bottom:24px;
  max-width:440px;
  margin-left:auto;
  z-index:99990;
  background:rgba(13,13,15,.92);
  -webkit-backdrop-filter:blur(24px) saturate(140%);
  backdrop-filter:blur(24px) saturate(140%);
  border:1px solid rgba(255,255,255,.08);
  border-radius:20px;
  box-shadow:0 24px 72px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
  padding:22px 22px 18px;
  color:#fff;
  opacity:0;
  transform:translateY(24px);
  transition:opacity .55s cubic-bezier(.16,1,.3,1), transform .55s cubic-bezier(.16,1,.3,1);
  pointer-events:none;
}
#tly-cc.in{opacity:1;transform:translateY(0);pointer-events:auto}
#tly-cc.out{opacity:0;transform:translateY(24px);pointer-events:none}

#tly-cc .tly-cc-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
#tly-cc .tly-cc-dot{
  width:8px;height:8px;border-radius:50%;background:var(--r);
  box-shadow:0 0 0 4px rgba(254,68,68,.18);
  animation:tly-cc-pulse 3s ease-in-out infinite;
  flex-shrink:0;
}
@keyframes tly-cc-pulse{0%,100%{opacity:.7;transform:scale(1)}50%{opacity:1;transform:scale(1.18)}}
#tly-cc .tly-cc-title{
  font-family:'Space Grotesk','Inter',sans-serif;
  font-weight:700;font-size:15px;letter-spacing:-.01em;color:#fff;
}
#tly-cc .tly-cc-text{
  font-size:13px;line-height:1.55;color:rgba(255,255,255,.62);
  margin:0 0 16px;
}
#tly-cc .tly-cc-text a{color:rgba(255,255,255,.85);text-decoration:underline;text-decoration-color:rgba(254,68,68,.55);text-underline-offset:2px}
#tly-cc .tly-cc-text a:hover{color:#fff}

#tly-cc .tly-cc-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}

#tly-cc .tly-cc-btn{
  appearance:none;border:0;cursor:pointer;
  font-family:'Inter','Helvetica Neue',Arial,sans-serif;
  font-weight:600;font-size:13px;letter-spacing:.01em;
  padding:11px 18px;border-radius:11px;
  transition:transform .22s cubic-bezier(.16,1,.3,1), background .22s ease, box-shadow .22s ease, color .22s ease, border-color .22s ease;
  will-change:transform,background,box-shadow;
  line-height:1;
}
#tly-cc .tly-cc-btn:focus-visible{outline:2px solid rgba(254,68,68,.6);outline-offset:2px}

#tly-cc .tly-cc-accept{
  background:var(--r);color:#fff;
  box-shadow:0 8px 24px rgba(254,68,68,.32), inset 0 1px 0 rgba(255,255,255,.18);
}
#tly-cc .tly-cc-accept:hover{transform:translateY(-1px);box-shadow:0 12px 30px rgba(254,68,68,.42), inset 0 1px 0 rgba(255,255,255,.22)}
#tly-cc .tly-cc-accept:active{transform:translateY(0)}

#tly-cc .tly-cc-refuse{
  background:rgba(255,255,255,.06);color:#fff;
  border:1px solid rgba(255,255,255,.1);
}
#tly-cc .tly-cc-refuse:hover{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.18)}

#tly-cc .tly-cc-custom{
  background:transparent;color:rgba(255,255,255,.55);
  padding:11px 10px;
}
#tly-cc .tly-cc-custom:hover{color:#fff}
#tly-cc .tly-cc-custom u{text-decoration:underline;text-decoration-color:rgba(254,68,68,.55);text-underline-offset:3px}

@media(max-width:520px){
  #tly-cc{left:12px;right:12px;bottom:12px;max-width:none;padding:18px 18px 14px;border-radius:18px}
  #tly-cc .tly-cc-actions{gap:6px}
  #tly-cc .tly-cc-btn{flex:1 1 auto;padding:12px 14px;font-size:13px}
  #tly-cc .tly-cc-accept{order:1;flex-basis:100%}
  #tly-cc .tly-cc-refuse{order:2}
  #tly-cc .tly-cc-custom{order:3;flex:0 0 auto;padding:12px 6px}
}

/* ─── Modal (préférences détaillées) ────────────────────────── */
#tly-cc-modal{
  position:fixed;inset:0;z-index:99991;
  display:none;align-items:center;justify-content:center;
  padding:24px;
  background:rgba(8,8,10,.62);
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  opacity:0;transition:opacity .35s ease;
}
#tly-cc-modal.in{display:flex;opacity:1}

#tly-cc-modal .tly-cc-card{
  width:100%;max-width:560px;max-height:calc(100vh - 48px);
  overflow:auto;
  background:#0d0d0f;
  border:1px solid rgba(255,255,255,.07);
  border-radius:22px;
  box-shadow:0 32px 80px rgba(0,0,0,.6);
  color:#fff;
  transform:translateY(16px) scale(.98);
  transition:transform .45s cubic-bezier(.16,1,.3,1);
}
#tly-cc-modal.in .tly-cc-card{transform:translateY(0) scale(1)}

#tly-cc-modal .tly-cc-mhead{
  padding:24px 26px 18px;
  border-bottom:1px solid rgba(255,255,255,.06);
  display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
}
#tly-cc-modal .tly-cc-mhead h2{
  font-family:'Space Grotesk','Inter',sans-serif;
  font-size:20px;font-weight:700;letter-spacing:-.02em;margin:0 0 6px;
}
#tly-cc-modal .tly-cc-mhead p{
  margin:0;font-size:13px;line-height:1.55;color:rgba(255,255,255,.55);
}
#tly-cc-modal .tly-cc-close{
  appearance:none;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);
  width:34px;height:34px;border-radius:10px;color:rgba(255,255,255,.7);
  display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;
  transition:background .2s ease,color .2s ease,transform .2s ease;
}
#tly-cc-modal .tly-cc-close:hover{background:rgba(255,255,255,.1);color:#fff;transform:rotate(90deg)}
#tly-cc-modal .tly-cc-close svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round}

#tly-cc-modal .tly-cc-mbody{padding:8px 26px 8px}

#tly-cc-modal .tly-cc-row{
  display:flex;align-items:flex-start;gap:16px;
  padding:18px 0;
  border-bottom:1px solid rgba(255,255,255,.05);
}
#tly-cc-modal .tly-cc-row:last-child{border-bottom:0}
#tly-cc-modal .tly-cc-rtext{flex:1;min-width:0}
#tly-cc-modal .tly-cc-rtitle{
  font-family:'Space Grotesk','Inter',sans-serif;
  font-size:14.5px;font-weight:600;letter-spacing:-.01em;color:#fff;
  display:flex;align-items:center;gap:10px;margin-bottom:6px;
}
#tly-cc-modal .tly-cc-badge{
  font-family:'Inter',sans-serif;font-weight:500;
  font-size:10px;letter-spacing:.06em;text-transform:uppercase;
  padding:3px 8px;border-radius:6px;
  background:rgba(254,68,68,.12);color:#fe7676;
  border:1px solid rgba(254,68,68,.18);
}
#tly-cc-modal .tly-cc-rdesc{
  font-size:12.5px;line-height:1.55;color:rgba(255,255,255,.5);margin:0;
}

/* Toggle */
#tly-cc-modal .tly-cc-toggle{
  position:relative;flex-shrink:0;
  width:42px;height:24px;border-radius:100px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.08);
  cursor:pointer;
  transition:background .25s ease,border-color .25s ease;
}
#tly-cc-modal .tly-cc-toggle::after{
  content:'';position:absolute;top:2px;left:2px;
  width:18px;height:18px;border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.4);
  transition:transform .28s cubic-bezier(.16,1,.3,1), background .25s ease;
}
#tly-cc-modal .tly-cc-toggle[aria-checked="true"]{
  background:var(--r);border-color:rgba(254,68,68,.6);
  box-shadow:0 0 0 4px rgba(254,68,68,.12);
}
#tly-cc-modal .tly-cc-toggle[aria-checked="true"]::after{transform:translateX(18px)}
#tly-cc-modal .tly-cc-toggle[aria-disabled="true"]{
  cursor:not-allowed;opacity:.85;
  background:rgba(254,68,68,.5);border-color:rgba(254,68,68,.3);
}
#tly-cc-modal .tly-cc-toggle[aria-disabled="true"]::after{transform:translateX(18px);background:#fff}
#tly-cc-modal .tly-cc-toggle:focus-visible{outline:2px solid rgba(254,68,68,.6);outline-offset:3px}

#tly-cc-modal .tly-cc-mfoot{
  display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;
  padding:18px 26px 22px;
  border-top:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.015);
  border-radius:0 0 22px 22px;
}
#tly-cc-modal .tly-cc-btn{
  appearance:none;border:0;cursor:pointer;
  font-family:'Inter','Helvetica Neue',Arial,sans-serif;
  font-weight:600;font-size:13px;letter-spacing:.01em;
  padding:11px 18px;border-radius:11px;line-height:1;
  transition:transform .22s cubic-bezier(.16,1,.3,1), background .22s ease, box-shadow .22s ease, color .22s ease, border-color .22s ease;
}
#tly-cc-modal .tly-cc-btn:focus-visible{outline:2px solid rgba(254,68,68,.6);outline-offset:2px}
#tly-cc-modal .tly-cc-save{
  background:var(--r);color:#fff;
  box-shadow:0 8px 24px rgba(254,68,68,.32), inset 0 1px 0 rgba(255,255,255,.18);
}
#tly-cc-modal .tly-cc-save:hover{transform:translateY(-1px);box-shadow:0 12px 30px rgba(254,68,68,.42), inset 0 1px 0 rgba(255,255,255,.22)}
#tly-cc-modal .tly-cc-ghost{
  background:rgba(255,255,255,.06);color:#fff;
  border:1px solid rgba(255,255,255,.1);
}
#tly-cc-modal .tly-cc-ghost:hover{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.18)}

@media(max-width:520px){
  #tly-cc-modal{padding:0;align-items:flex-end}
  #tly-cc-modal .tly-cc-card{
    max-width:none;max-height:92vh;
    border-radius:22px 22px 0 0;
    transform:translateY(40px);
  }
  #tly-cc-modal.in .tly-cc-card{transform:translateY(0)}
  #tly-cc-modal .tly-cc-mhead{padding:20px 20px 14px}
  #tly-cc-modal .tly-cc-mbody{padding:4px 20px}
  #tly-cc-modal .tly-cc-mfoot{padding:14px 20px 18px}
  #tly-cc-modal .tly-cc-mfoot .tly-cc-btn{flex:1 1 auto}
}

@media(prefers-reduced-motion:reduce){
  #tly-cc, #tly-cc.in, #tly-cc.out,
  #tly-cc-modal, #tly-cc-modal.in,
  #tly-cc-modal .tly-cc-card,
  #tly-cc-modal .tly-cc-toggle::after,
  #tly-cc .tly-cc-dot,
  #tly-cc .tly-cc-btn,
  #tly-cc-modal .tly-cc-btn,
  #tly-cc-modal .tly-cc-close{
    transition:none !important;animation:none !important;
  }
}
