/* =========================================================================
   Varsity floating contact widget — shared by landing + all program pages.
   Icon-only conversion cluster pinned bottom-right: Request a callback
   (primary) + WhatsApp. Desktop shows the icon buttons; mobile collapses to
   one FAB that expands them. No dismiss/close button.
   Self-contained: built by varsity-widget.js, styled only with site tokens
   (no external colours). Sits below the modal/chat overlay, above content.
   ========================================================================= */

  /* root cluster ---------------------------------------------------------- */
  .vfw{
    position:fixed; right:20px;
    bottom:calc(var(--vfw-bar, 0px) + 20px);
    z-index:980;                         /* below .vmodal(1000)/.vchat(1001), above topbar(60)/mbar(70) */
    display:flex; flex-direction:column; align-items:flex-end; gap:10px;
    font-family:'DM Sans',sans-serif;
    opacity:0; transform:translateY(12px); visibility:hidden; pointer-events:none;
    transition:opacity .3s ease, transform .3s cubic-bezier(.2,.7,.3,1);
  }
  .vfw.is-shown{ opacity:1; transform:none; visibility:visible; pointer-events:auto; }
  /* auto-hide while a modal/chat is open or a lead form is focused */
  .vfw.is-suppressed{ opacity:0 !important; transform:translateY(12px) !important; visibility:hidden !important; pointer-events:none !important; }

  /* action cluster — icon-only circular buttons --------------------------- */
  .vfw-panel{ display:flex; flex-direction:column; align-items:flex-end; gap:12px; }
  .vfw-act{
    display:inline-flex; align-items:center; justify-content:center;
    width:52px; height:52px; border-radius:50%;
    cursor:pointer; text-decoration:none; border:1.5px solid transparent;
    box-shadow:0 14px 40px rgba(124,29,43,.18);
    transition:background .15s, border-color .15s, transform .12s;
  }
  .vfw-act svg{ width:24px; height:24px; flex:0 0 auto; }
  .vfw-act:active{ transform:translateY(1px); }
  .vfw-act:focus-visible{ outline:3px solid var(--coral); outline-offset:2px; }

  /* Request a callback — PRIMARY (solid maroon) */
  .vfw-rcb{ background:var(--maroon); color:#fff; }
  .vfw-rcb:hover{ background:var(--maroon-dk); }
  .vfw-rcb svg{ fill:#fff; }

  /* WhatsApp — recognisable via glyph; colour stays in-palette (cream) */
  .vfw-wa{ background:var(--cream); color:var(--maroon); border-color:var(--cream-2); }
  .vfw-wa:hover{ background:var(--cream-2); border-color:var(--maroon); }
  .vfw-wa svg{ fill:var(--maroon); }

  /* AI-chat nudge (sparkle button + tooltip) — appears after 10s ---------- */
  .vfw-chatwrap{
    display:none; align-items:center; gap:8px;
    opacity:0; transform:translateY(8px);
    transition:opacity .3s ease, transform .3s cubic-bezier(.2,.7,.3,1);
  }
  .vfw.is-chat .vfw-chatwrap{ display:flex; opacity:1; transform:none; }
  .vfw-tip{
    background:#fff; color:var(--ink); border:1px solid var(--line);
    font-family:inherit; font-size:var(--fs-2xs); font-weight:600; line-height:1.2;
    padding:8px 12px; border-radius:6px; white-space:nowrap; position:relative;
    box-shadow:0 8px 24px rgba(36,30,31,.14);
  }
  .vfw-tip::after{                       /* caret pointing right at the button */
    content:""; position:absolute; right:-5px; top:50%;
    width:9px; height:9px; background:#fff; border-top:1px solid var(--line); border-right:1px solid var(--line);
    transform:translateY(-50%) rotate(45deg);
  }
  .vfw-chatwrap.tip-hidden .vfw-tip{ display:none; }
  .vfw-chat{
    display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
    width:52px; height:52px; border-radius:50%;
    background:#fff; border:1.5px solid var(--line); cursor:pointer;
    box-shadow:0 14px 40px rgba(124,29,43,.18);
    transition:background .15s, border-color .15s, transform .12s;
  }
  .vfw-chat:hover{ background:var(--cream); border-color:var(--coral); }
  .vfw-chat:active{ transform:translateY(1px); }
  .vfw-chat:focus-visible{ outline:3px solid var(--coral); outline-offset:2px; }
  .vfw-chat svg{ width:24px; height:24px; fill:var(--coral); flex:0 0 auto; }
  /* gentle attention pulse (coral ring), runs twice then settles */
  .vfw.is-chat .vfw-chat{ animation:vfwPulse 2.4s ease-out 2; }
  @keyframes vfwPulse{
    0%  { box-shadow:0 14px 40px rgba(124,29,43,.18), 0 0 0 0 rgba(226,79,53,.5); }
    70% { box-shadow:0 14px 40px rgba(124,29,43,.18), 0 0 0 12px rgba(226,79,53,0); }
    100%{ box-shadow:0 14px 40px rgba(124,29,43,.18), 0 0 0 0 rgba(226,79,53,0); }
  }

  /* mobile FAB launcher --------------------------------------------------- */
  .vfw-fab{
    display:none; width:56px; height:56px; border-radius:50%; border:0; cursor:pointer;
    background:var(--maroon); color:#fff; align-items:center; justify-content:center;
    box-shadow:0 14px 40px rgba(124,29,43,.18); transition:background .15s, transform .2s;
  }
  .vfw-fab:hover{ background:var(--maroon-dk); }
  .vfw-fab:focus-visible{ outline:3px solid var(--coral); outline-offset:2px; }
  .vfw-fab svg{ width:26px; height:26px; fill:#fff; }
  .vfw-fab .vfw-ic-close{ display:none; }
  .vfw.is-open .vfw-fab .vfw-ic-open{ display:none; }
  .vfw.is-open .vfw-fab .vfw-ic-close{ display:block; }

  /* desktop (>920): icon buttons always shown, no FAB ------------------- */
  @media(min-width:921px){
    .vfw-fab{ display:none !important; }
    .vfw-panel{ display:flex !important; }
  }

  /* mobile (<=920): the FAB is the only control — tap to reveal the icon
     actions, tap again (x icon) to collapse. Panel sits above the .mbar. -- */
  @media(max-width:920px){
    .vfw{ right:16px; }
    .vfw-fab{ display:inline-flex; }
    .vfw-panel{ display:none; margin-bottom:2px; }
    .vfw.is-open .vfw-panel{ display:flex; }
  }

  /* respect reduced motion ----------------------------------------------- */
  @media(prefers-reduced-motion:reduce){
    .vfw{ transition:none; transform:none; }
    .vfw.is-shown{ transform:none; }
    .vfw-act, .vfw-fab, .vfw-chat, .vfw-chatwrap{ transition:none; }
    .vfw-chatwrap{ transform:none; }
    .vfw.is-chat .vfw-chat{ animation:none; }
  }
