/* Frames for visitors (v3.198, ADR 0066): the floating chat on the home page, /cbt-for-schools and /try.
   Self-contained: the public pages each have their own stylesheet, so everything here sits under .fv. */

.fv {
  --fv-navy: #0b1530; --fv-ink: #0b1530; --fv-ink-2: #34406a; --fv-muted: #67718f; --fv-line: #e3e8f3; --fv-mist: #f4f7fd;
  --fv-blue: #1668ff; --fv-blue-2: #0a55e0; --fv-violet: #7a5cff; --fv-sun: #ff9500; --fv-green: #12b76a; --fv-wa: #1fae54;
  --fv-ease: cubic-bezier(.2, .8, .2, 1); --fv-lift: 0px;
  --navy: var(--fv-navy);
  font: 400 15px/1.5 var(--body, "Lexend", system-ui, "Segoe UI", sans-serif); color: var(--fv-ink);
}
.fv *, .fv *::before, .fv *::after { box-sizing: border-box; }
.fv [hidden] { display: none !important; }

/* ── The face (as in css/frames.css) ─────────────────────── */
.fv .frames-face { display: block; flex: none; overflow: visible; }
.fv .frames-face .ff-body { transform-origin: 32px 40px; animation: ff-breathe 4.2s ease-in-out infinite; }
.fv .frames-face .ff-e ellipse, .fv .frames-face .ff-m-big, .fv .frames-face .ff-m-talk { fill: var(--fv-navy); }
.fv .frames-face .ff-shine { fill: #fff; }
.fv .frames-face .ff-e path, .fv .frames-face .ff-brows path, .fv .frames-face .ff-m:not(.ff-m-big):not(.ff-m-talk) { fill: none; stroke: var(--fv-navy); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.fv .frames-face .ff-e, .fv .frames-face .ff-m, .fv .frames-face .ff-brows, .fv .frames-face .ff-spark, .fv .frames-face .ff-dots { display: none; }
.fv .frames-face .ff-e-open { transform-origin: 32px 29px; animation: ff-blink 5.5s infinite; }
.fv .frames-face .ff-dots circle { fill: #c9d5f0; }
.fv .frames-face .ff-spark { transform-origin: 51px 14px; animation: ff-twinkle 1.8s ease-in-out infinite; }
.fv .frames-face[data-mood="warm"] .ff-e-open, .fv .frames-face[data-mood="warm"] .ff-m-smile { display: inline; }
.fv .frames-face[data-mood="cheer"] .ff-e-happy, .fv .frames-face[data-mood="cheer"] .ff-m-big { display: inline; }
.fv .frames-face[data-mood="proud"] .ff-e-happy, .fv .frames-face[data-mood="proud"] .ff-m-smile, .fv .frames-face[data-mood="proud"] .ff-spark { display: inline; }
.fv .frames-face[data-mood="calm"] .ff-e-calm, .fv .frames-face[data-mood="calm"] .ff-m-small { display: inline; }
.fv .frames-face[data-mood="think"] .ff-e-up, .fv .frames-face[data-mood="think"] .ff-m-think, .fv .frames-face[data-mood="think"] .ff-dots { display: inline; }
.fv .frames-face[data-mood="encourage"] .ff-e-open, .fv .frames-face[data-mood="encourage"] .ff-brows, .fv .frames-face[data-mood="encourage"] .ff-m-big { display: inline; }
.fv .frames-face[data-mood="think"] .ff-dots circle { animation: ff-dot 1.2s ease-in-out infinite; }
.fv .frames-face[data-mood="think"] .ff-dots circle + circle { animation-delay: .25s; }
.fv .frames-face.talking .ff-m { display: none !important; }
.fv .frames-face.talking .ff-m-talk { display: inline !important; transform-origin: 32px 41px; animation: ff-talk .22s ease-in-out infinite alternate; }
@keyframes ff-breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-1.2px) scale(1.015); } }
@keyframes ff-blink { 0%, 94%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(.1); } }
@keyframes ff-twinkle { 0%, 100% { transform: scale(.7) rotate(0); opacity: .7; } 50% { transform: scale(1.1) rotate(20deg); opacity: 1; } }
@keyframes ff-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes ff-talk { from { transform: scaleY(.35); } to { transform: scaleY(1.1); } }

/* ── The button in the corner ─────────────────────────────── */
.fv-launch {
  position: fixed; z-index: 70; right: 20px; bottom: calc(20px + var(--fv-lift) + env(safe-area-inset-bottom, 0px));
  width: 70px; height: 70px; padding: 6px; border: 0; border-radius: 24px; cursor: pointer;
  background: #fff; box-shadow: 0 18px 40px -14px rgba(22, 104, 255, .65), 0 0 0 1px rgba(11, 21, 48, .06);
  transition: transform .25s var(--fv-ease), box-shadow .25s, opacity .25s; animation: fv-arrive .6s var(--fv-ease) both .4s;
}
.fv-launch:hover { transform: translateY(-3px) rotate(-3deg); box-shadow: 0 24px 46px -14px rgba(22, 104, 255, .75), 0 0 0 1px rgba(11, 21, 48, .06); }
.fv-launch:focus-visible { outline: 3px solid var(--fv-sun); outline-offset: 3px; }
.fv.open .fv-launch { transform: scale(.6); opacity: 0; pointer-events: none; }
.fv-ping { position: absolute; top: -3px; right: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--fv-sun); box-shadow: 0 0 0 3px #fff; }
.fv-ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--fv-sun); animation: fv-ping 1.8s ease-out infinite; }
.fv.seen .fv-ping { display: none; }
@keyframes fv-ping { from { transform: scale(1); opacity: .7; } to { transform: scale(2.6); opacity: 0; } }
@keyframes fv-arrive { from { transform: translateY(30px) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

.fv-teaser {
  position: fixed; z-index: 70; right: 100px; bottom: calc(34px + var(--fv-lift) + env(safe-area-inset-bottom, 0px)); max-width: min(270px, calc(100vw - 132px));
  display: flex; align-items: flex-start; gap: .2rem; padding: .7rem .5rem .7rem .95rem; border-radius: 18px 18px 6px 18px;
  background: #fff; box-shadow: 0 16px 40px -16px rgba(7, 14, 36, .55), 0 0 0 1px rgba(11, 21, 48, .06); animation: fv-pop .45s var(--fv-ease) both;
}
.fv-teaser-text { border: 0; background: none; padding: 0; font-family: inherit; font-weight: 500; font-size: .92rem; line-height: 1.4; color: var(--fv-ink); text-align: left; cursor: pointer; }
.fv-teaser-x { border: 0; background: none; color: var(--fv-muted); font-size: 1.15rem; line-height: 1; padding: 0 .3rem; cursor: pointer; }
.fv.open .fv-teaser { display: none; }
@keyframes fv-pop { from { transform: translateY(10px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── The panel ────────────────────────────────────────────── */
.fv-panel {
  position: fixed; z-index: 71; right: 20px; bottom: calc(20px + var(--fv-lift) + env(safe-area-inset-bottom, 0px));
  width: 390px; height: min(640px, calc(100vh - 40px - var(--fv-lift))); height: min(640px, calc(100dvh - 40px - var(--fv-lift)));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; background: #fff;
  box-shadow: 0 30px 80px -24px rgba(7, 14, 36, .6), 0 0 0 1px rgba(11, 21, 48, .07);
  transform-origin: bottom right; transform: translateY(16px) scale(.94); opacity: 0; transition: transform .32s var(--fv-ease), opacity .25s;
}
.fv.open .fv-panel { transform: none; opacity: 1; }
.fv-head { display: flex; align-items: center; gap: .75rem; padding: .85rem .9rem .85rem 1rem; color: #fff; background: linear-gradient(120deg, #0b1530 0%, #1a2c63 55%, #3b3fd8 100%); }
.fv-head .frames-face { background: #fff; border-radius: 15px; padding: 2px; }
.fv-who { flex: 1; min-width: 0; display: grid; }
.fv-who b { font: 800 1.08rem/1.15 var(--display, "Bricolage", "Lexend", system-ui, sans-serif); letter-spacing: -.01em; }
.fv-who span { font-size: .78rem; color: rgba(233, 238, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; margin-right: .4rem; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(61, 220, 132, .2); }
.fv-x { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; transition: background .2s; }
.fv-x:hover { background: rgba(255, 255, 255, .2); }

.fv-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1rem .9rem .6rem; background: var(--fv-mist); display: flex; flex-direction: column; gap: .65rem; scroll-behavior: smooth; }
.fv-msg { max-width: 88%; animation: fv-in .35s var(--fv-ease) both; }
.fv-msg.me { align-self: flex-end; }
.fv-bubble { padding: .65rem .85rem; border-radius: 18px 18px 18px 6px; background: #fff; box-shadow: 0 1px 0 rgba(11, 21, 48, .05), 0 0 0 1px var(--fv-line); color: var(--fv-ink); overflow-wrap: anywhere; }
.fv-msg.me .fv-bubble { border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, var(--fv-blue), var(--fv-violet)); color: #fff; box-shadow: none; }
.fv-bubble p { margin: 0 0 .45rem; }
.fv-bubble p:last-child { margin-bottom: 0; }
.fv-bubble ul { margin: .2rem 0 .45rem; padding-left: 1.15rem; }
.fv-bubble li { margin: .12rem 0; }
.fv-bubble a { color: var(--fv-blue-2); font-weight: 600; }
.fv-msg.me .fv-bubble a { color: #fff; }
.fv-bubble b { font-weight: 700; }
@keyframes fv-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.fv-typing { display: inline-flex; gap: 5px; padding: .85rem 1rem; }
.fv-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa8cc; animation: fv-bounce 1.1s infinite ease-in-out; }
.fv-typing i:nth-child(2) { animation-delay: .15s; }
.fv-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes fv-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

.fv-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .1rem; }
.fv-chip { border: 1px solid #cfdaf5; background: #fff; color: var(--fv-blue-2); border-radius: 999px; padding: .42rem .8rem; font-family: inherit; font-weight: 600; font-size: .84rem; line-height: 1.2; cursor: pointer; transition: background .2s, transform .2s var(--fv-ease); }
.fv-chip:hover { background: #eef3ff; transform: translateY(-1px); }

/* Cards: what Frames shows */
.fv-cards { display: grid; gap: .5rem; margin-top: .5rem; }
.fv-card { border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--fv-line); }
.fv-card video, .fv-card img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #0b1530; }
.fv-card img { cursor: zoom-in; background: #eef2fa; }
.fv-card .fv-cap { padding: .5rem .75rem; font-size: .82rem; font-weight: 600; color: var(--fv-ink-2); }
.fv-doc { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; color: var(--fv-ink); text-decoration: none; }
.fv-doc .fv-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #fff1e4; color: #d4560b; font-weight: 800; font-size: .72rem; line-height: 1; }
.fv-doc b { display: block; font-size: .88rem; line-height: 1.3; }
.fv-doc span { font-size: .78rem; color: var(--fv-blue-2); font-weight: 600; }
.fv-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .72rem 1rem; border-radius: 14px; font-weight: 700; font-size: .92rem; text-decoration: none; color: #fff; background: linear-gradient(135deg, var(--fv-blue), var(--fv-blue-2)); box-shadow: 0 10px 22px -12px rgba(22, 104, 255, .8); transition: transform .2s var(--fv-ease); }
.fv-btn:hover { transform: translateY(-1px); }
.fv-btn.wa { background: linear-gradient(135deg, #25d366, var(--fv-wa)); box-shadow: 0 10px 22px -12px rgba(31, 174, 84, .8); }
.fv-call { display: block; text-align: center; margin-top: .35rem; font-size: .82rem; color: var(--fv-ink-2); }
.fv-call a { color: var(--fv-ink); font-weight: 700; }
.fv-booked { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem .85rem; border-radius: 16px; background: #eafbf1; box-shadow: 0 0 0 1px #b8ecd0; }
.fv-booked .fv-tick { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--fv-green); color: #fff; }
.fv-booked b { display: block; font-size: .92rem; }
.fv-booked span { display: block; font-size: .8rem; color: var(--fv-ink-2); }

/* The box to type in */
.fv-form { display: flex; align-items: flex-end; gap: .5rem; padding: .6rem .7rem .4rem; border-top: 1px solid var(--fv-line); background: #fff; }
.fv-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; padding: .65rem .85rem; border: 1px solid var(--fv-line); border-radius: 16px; font-family: inherit; font-weight: 400; font-size: .95rem; line-height: 1.4; color: var(--fv-ink); background: var(--fv-mist); outline: none; transition: border-color .2s, background .2s; }
.fv-form textarea:focus { border-color: #9db9ff; background: #fff; }
.fv-send { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--fv-blue), var(--fv-violet)); cursor: pointer; transition: transform .2s var(--fv-ease), opacity .2s; }
.fv-send:hover { transform: translateY(-1px); }
.fv-send:disabled { opacity: .45; cursor: default; transform: none; }
.fv-note { margin: 0; padding: 0 .9rem .6rem; background: #fff; font-size: .7rem; line-height: 1.4; color: var(--fv-muted); }
.fv-note a { color: var(--fv-ink-2); font-weight: 600; }

/* Full screen: for those who came to talk. The conversation sits in a column that reads easily. */
.fv-grow .fv-to-small, .fv.big .fv-grow .fv-to-big { display: none; }
.fv.big .fv-grow .fv-to-small { display: block; }
.fv.big .fv-panel { inset: 0; width: auto; height: auto; border-radius: 0; transform-origin: center; box-shadow: none; padding-bottom: env(safe-area-inset-bottom, 0px); }
.fv-panel.fv-morph { animation: fv-morph .34s var(--fv-ease) both; }
@keyframes fv-morph { from { opacity: .35; transform: scale(.975); } to { opacity: 1; transform: none; } }
.fv.big .fv-head { padding: calc(1rem + env(safe-area-inset-top, 0px)) max(1rem, calc((100% - 820px) / 2)) 1rem; }
.fv.big .fv-head .frames-face { width: 52px; height: 52px; }
.fv.big .fv-who b { font-size: 1.25rem; }
.fv.big .fv-who span { font-size: .84rem; }
.fv.big .fv-list { padding: 1.6rem max(1rem, calc((100% - 780px) / 2)) 1rem; gap: .85rem; }
.fv.big .fv-msg { max-width: min(82%, 620px); }
.fv.big .fv-bubble { padding: .8rem 1.05rem; font-size: 1rem; line-height: 1.6; }
.fv.big .fv-chip { font-size: .9rem; padding: .55rem .95rem; }
.fv.big .fv-card video, .fv.big .fv-card img { max-height: 440px; }
.fv.big .fv-form { padding: .8rem max(1rem, calc((100% - 780px) / 2)) .5rem; }
.fv.big .fv-form textarea { font-size: 1rem; min-height: 50px; max-height: 180px; padding: .8rem 1rem; }
.fv.big .fv-send { width: 50px; height: 50px; }
.fv.big .fv-note { padding: 0 max(1rem, calc((100% - 780px) / 2)) .8rem; font-size: .74rem; }
html.fv-locked, html.fv-locked body { overflow: hidden; }

/* A picture made big */
.fv-zoom { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(7, 14, 36, .82); cursor: zoom-out; animation: fv-in .25s ease both; }
.fv-zoom img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }

@media (max-width: 560px) {
  .fv-launch { right: 16px; width: 62px; height: 62px; border-radius: 21px; }
  .fv-teaser { right: 88px; }
  .fv-panel { inset: 0; right: 0; bottom: 0; width: auto; height: auto; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .fv-head { padding-top: calc(.85rem + env(safe-area-inset-top, 0px)); }
  .fv-form textarea { font-size: 16px; } /* no zoom on focus in iOS */
  .fv-grow { display: none; } /* a phone's panel is already the whole screen */
}
@media (prefers-reduced-motion: reduce) {
  .fv *, .fv *::before, .fv *::after { animation: none !important; transition: none !important; }
}
