/* =========================================================
   CFIT INT — Shared Backend Interface
   Creative Fitness NYC
========================================================= */

#cfitIntLauncher{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:99998;

  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;

  border:0;
  border-radius:999px;
  padding:14px 20px;

  background:#0F1133;
  color:#fff;

  font:800 14px/1 Arial,sans-serif;
  letter-spacing:.04em;

  cursor:grab;

  box-shadow:0 12px 30px rgba(15,17,51,0.28);

  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}

#cfitIntLauncher span{
  color:#F2BE50;
}

#cfitIntLauncher.cfit-int-dragging{
  cursor:grabbing;
}

#cfitIntPanel{
  position:fixed;
  right:22px;
  bottom:84px;

  width:min(390px,calc(100vw - 28px));
  height:min(620px,calc(100vh - 120px));

  z-index:99999;

  display:none;
  flex-direction:column;

  background:#fff;
  border:1px solid #DCE1EA;
  border-radius:20px;
  overflow:hidden;

  box-shadow:0 22px 60px rgba(15,17,51,0.24);
}

#cfitIntPanel.open{
  display:flex;
}

#cfitIntHeader{
  background:#0F1133;
  color:#fff;

  padding:17px 18px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;

  cursor:grab;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}

#cfitIntPanel.cfit-int-panel-dragging #cfitIntHeader{
  cursor:grabbing;
}

#cfitIntClose{
  touch-action:auto;
}

#cfitIntHeader strong{
  display:block;
  font-size:17px;
}

#cfitIntHeader small{
  display:block;
  margin-top:3px;

  color:#F2BE50;

  font-size:11px;
  letter-spacing:.07em;
}

#cfitIntClose{
  border:0;
  background:transparent;
  color:#fff;

  font-size:24px;
  cursor:pointer;
  line-height:1;
}

#cfitIntMessages{
  flex:1;
  overflow:auto;

  padding:16px;

  background:#F7F8FB;
}

.cfit-int-msg{
  max-width:88%;

  margin:0 0 12px;
  padding:11px 13px;

  border-radius:14px;

  white-space:pre-wrap;

  font:500 14px/1.45 Arial,sans-serif;
}

.cfit-int-user{
  margin-left:auto;

  background:#0F1133;
  color:#fff;

  border-bottom-right-radius:5px;
}

.cfit-int-ai{
  margin-right:auto;

  background:#fff;
  color:#0F1133;

  border:1px solid #E0E4EC;
  border-bottom-left-radius:5px;
}

#cfitIntComposer{
  display:flex;
  gap:8px;

  padding:12px;

  border-top:1px solid #E4E7ED;
  background:#fff;
}

#cfitIntInput{
  flex:1;
  min-width:0;

  border:1px solid #CDD3DE;
  border-radius:12px;

  padding:11px 12px;

  font:500 14px Arial,sans-serif;

  outline:none;
}

#cfitIntInput:focus{
  border-color:#F2BE50;
}

#cfitIntSend{
  border:0;
  border-radius:12px;

  padding:0 15px;

  background:#F2BE50;
  color:#0F1133;

  font-weight:900;
  cursor:pointer;
}

#cfitIntVoiceBar{
  display:flex;
  gap:8px;

  padding:10px 12px;

  background:#fff;
  border-top:1px solid #E4E7ED;
}

#cfitIntVoiceStart,
#cfitIntVoiceEnd{
  min-height:40px;

  border-radius:11px;

  padding:8px 12px;

  font-weight:800;
  cursor:pointer;
}

#cfitIntVoiceStart{
  flex:1;

  border:0;

  background:#0F1133;
  color:#fff;
}

#cfitIntVoiceEnd{
  border:1px solid #CDD3DE;

  background:#fff;
  color:#0F1133;
}

#cfitIntVoiceEnd:disabled{
  opacity:.45;
  cursor:not-allowed;
}

#cfitIntVoiceStart.cfit-int-voice-live{
  background:#F2BE50;
  color:#0F1133;
}

#cfitIntStatus{
  padding:0 14px 10px;

  background:#fff;
  color:#6D6E8D;

  font:600 11px Arial,sans-serif;
}

@media(max-width:600px){

  #cfitIntLauncher{
    right:14px;
    bottom:14px;
  }

  #cfitIntPanel{
    right:14px;
    bottom:72px;

    width:calc(100vw - 28px);
    height:calc(100vh - 100px);
  }
}
/* CFIT backend page transition */
body{
  animation:cfitBackendPageIn .12s ease-out both;
}

@keyframes cfitBackendPageIn{
  from{
    opacity:.72;
  }
  to{
    opacity:1;
  }
}
/* Match CFIT backend sidebar branding across departments */
.brand small,
.cfit-unified-brand small{
  font-size:11px!important;
  letter-spacing:.13em!important;
}

.brand strong,
.cfit-unified-brand strong{
  font-size:23px!important;
  line-height:1.08!important;
}


/* CFIT INT mobile dialog visibility: override saved dragged inline coordinates. */
@media (max-width: 600px) {
  #cfitIntPanel {
    position: fixed !important;
    left: 14px !important;
    right: 14px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: calc(100% - 28px) !important;
    height: min(620px, calc(100dvh - 100px)) !important;
    max-height: calc(100dvh - 72px) !important;
  }
}

/* 2026-10-26 CFIT INT button: small solid gold circle with a navy sparkle, fixed bottom-right, not draggable
   (matches the public site's round sparkle button). Overrides any saved dragged position. */
#cfitIntLauncher{
  position:fixed!important;
  left:auto!important;
  top:auto!important;
  right:22px!important;
  bottom:calc(22px + env(safe-area-inset-bottom))!important;
  width:48px!important;
  height:48px!important;
  min-width:48px!important;
  min-height:48px!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:#F2BE50!important;
  color:#0F1133!important;
  font-size:0!important;
  line-height:0!important;
  letter-spacing:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
  transform:none!important;
  box-shadow:0 10px 24px rgba(15,17,51,0.28)!important;
}
#cfitIntLauncher span{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  white-space:nowrap!important;
}
#cfitIntLauncher::after{
  content:"\2726";
  color:#0F1133;
  font-size:22px;
  line-height:1;
}
#cfitIntLauncher.cfit-int-dragging{
  cursor:pointer!important;
}
@media(max-width:600px){
  #cfitIntLauncher{
    right:12px!important;
    bottom:calc(12px + env(safe-area-inset-bottom))!important;
  }
}

/* 2026-10-26 CFIT INT button: navy ring and slowly moving gold, matching the public site's
   Ask Coach Nick button (same 8s gradient flow). Gold circle and navy star stay; still draggable.
   The moving gold sits on its own layer because the button's own background is locked above. */
#cfitIntLauncher{
  box-sizing:border-box!important;
  border:2px solid #0F1133!important;
  overflow:hidden!important;
  isolation:isolate;
  box-shadow:0 10px 24px rgba(15,17,51,0.28),0 0 0 1px rgba(15,17,51,0.08)!important;
}
#cfitIntLauncher::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  border-radius:50%;
  background:#F2BE50;
  background-size:240% 240%;
  animation:cfitIntGoldFlow 8s ease-in-out infinite;
  pointer-events:none;
}
@keyframes cfitIntGoldFlow{
  0%,100%{background-position:0% 50%}
  50%{background-position:100% 50%}
}
@media (prefers-reduced-motion:reduce){
  #cfitIntLauncher::before{animation:none}
}
