/* Floow web voice widget -- Rev 7. Same file on every site; the site's
   colours arrive as --fw-* custom properties from config.php. Fonts are the
   site's own (inherit). Text colours measured >= 4.5:1 on their grounds. */

.fw, .fw-launcher, .fw-pop {
  --fw-accent: #1E2A78;      /* Talk button */
  --fw-on-accent: #FFFFFF;
  --fw-ink: #111827;         /* headings, Type button */
  --fw-on-ink: #FFFFFF;
  --fw-text: #3F4654;        /* body copy on white: 9:1 */
  --fw-line: #D8DCE3;
  box-sizing: border-box;
}
.fw *, .fw-pop *, .fw-launcher * { box-sizing: border-box; }
/* The hidden attribute always wins (site CSS and our own display rules). */
.fw [hidden], .fw-pop[hidden], .fw-launcher[hidden] { display: none !important; }
/* Site text rules (white hero copy, centred text, big paragraph margins) stop at the panel. */
.fw p, .fw h2, .fw h3, .fw label { color: inherit; text-align: left; letter-spacing: normal; text-transform: none; }
.fw span, .fw b { color: inherit; letter-spacing: normal; text-transform: none; }
.fw .fw__title { text-align: center; }
.fw .fw__title b { color: var(--fw-ink); }

/* ---------------------------------------------------------------- panel -- */
.fw {
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start;
  width: min(640px, 100%); margin: 24px auto; padding: 24px;
  text-align: left; color: var(--fw-text); font: inherit; line-height: 1.5;
  background: #FFFFFF; border: 2px solid var(--fw-accent); border-radius: 16px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--fw-accent) 16%, transparent), 0 20px 50px rgba(10, 14, 30, .28);
}
.fw .fw__who { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fw .fw__avatar {
  display: block; width: 96px; height: 96px; max-width: none; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--fw-accent);
}
.fw .fw__title { margin: 0; text-align: center; line-height: 1.25; color: var(--fw-ink); }
.fw .fw__title b { display: block; font-size: 17px; }
.fw .fw__title span { display: block; font-size: 13px; font-weight: 600; color: var(--fw-text); }
.fw .fw__h { margin: 0 0 6px; color: var(--fw-ink); font-size: clamp(22px, 1.2vw + 16px, 28px); line-height: 1.15; text-align: left; }
.fw .fw__sub { margin: 0 0 10px; color: var(--fw-text); font-size: 16px; text-align: left; }
.fw .fw__notice {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 8px;
  background: #F4F5F8; color: #3F4654; font-size: 13.5px; line-height: 1.45; text-align: left;
}
.fw .fw__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fw .fw__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 18px; border: 2px solid transparent; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.fw .fw__btn svg { flex: 0 0 auto; }
.fw .fw__btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(10, 14, 30, .18); }
.fw .fw__btn:focus-visible { outline: 3px solid var(--fw-ink); outline-offset: 2px; }
.fw .fw__btn--talk { background: var(--fw-accent); color: var(--fw-on-accent); }
.fw .fw__btn--type { background: var(--fw-ink); color: var(--fw-on-ink); }
.fw .fw__btn--call { background: #FFFFFF; color: var(--fw-ink); border-color: var(--fw-ink); }
.fw .fw__phone { margin: 10px 0 0; font-size: 14px; text-align: left; }
.fw .fw__phone a, .fw .fw__privacy a { color: var(--fw-ink); text-decoration: underline; text-underline-offset: 2px; }
.fw .fw__status {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; border-left: 4px solid var(--fw-accent);
  background: #F4F5F8; color: var(--fw-ink); font-weight: 600; font-size: 15px; text-align: left;
}
.fw .fw__privacy { margin: 12px 0 0; font-size: 13.5px; text-align: left; }
.fw .fw__credit { margin: 12px 0 0; font-size: 13px; text-align: left; }
.fw .fw__credit a { color: #4A5160; text-decoration: underline; text-underline-offset: 2px; }
.fw .fw__credit a:hover { color: var(--fw-ink); }

/* Fallback form (only when voice and chat both fail) */
.fw .fw__form { margin: 14px 0 0; padding: 14px; border: 1px solid var(--fw-line); border-radius: 12px; display: grid; gap: 10px; }
.fw .fw__form-h { margin: 0; color: var(--fw-ink); font-size: 17px; text-align: left; }
.fw .fw__field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; color: var(--fw-ink); text-align: left; }
.fw .fw__field input, .fw .fw__field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #8A92A3; border-radius: 8px;
  font: inherit; font-size: 16px; font-weight: 400; color: #111827; background: #FFFFFF;
}
.fw .fw__field input:focus, .fw .fw__field textarea:focus { outline: 3px solid color-mix(in srgb, var(--fw-accent) 45%, transparent); border-color: var(--fw-ink); }
.fw .fw__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fw .fw__form .fw__btn { justify-self: start; }

@media (max-width: 640px) {
  .fw { grid-template-columns: 1fr; gap: 14px; padding: 18px 16px; }
  .fw .fw__who { flex-direction: row; gap: 12px; }
  .fw .fw__avatar { width: 64px; height: 64px; }
  .fw .fw__title { text-align: left; }
  .fw .fw__actions { flex-direction: column; }
  .fw .fw__btn { width: 100%; }
  .fw .fw__form .fw__btn { justify-self: stretch; }
}

/* ------------------------------------------------- corner launcher + pop -- */
.fw-launcher {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 2147483000;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 18px 6px 6px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--fw-accent); color: var(--fw-on-accent);
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1;
  box-shadow: 0 10px 28px rgba(10, 14, 30, .3);
}
.fw-launcher[hidden] { display: none; }
.fw-launcher img { width: 36px; height: 36px; max-width: none; border-radius: 50%; object-fit: cover; border: 2px solid var(--fw-on-accent); }
.fw-launcher:focus-visible { outline: 3px solid var(--fw-ink); outline-offset: 3px; }

.fw-pop {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 2147483001;
  width: min(440px, calc(100vw - 36px)); max-height: calc(100vh - 36px); overflow: auto;
  border-radius: 16px;
}
.fw-pop[hidden] { display: none; }
.fw-pop .fw { margin: 0; width: 100%; grid-template-columns: 1fr; gap: 12px; padding: 20px 18px; box-shadow: 0 24px 60px rgba(10, 14, 30, .4); }
.fw-pop .fw__who { flex-direction: row; gap: 12px; padding-right: 36px; }
.fw-pop .fw__avatar { width: 64px; height: 64px; }
.fw-pop .fw__title { text-align: left; }
.fw-pop .fw__actions { flex-direction: column; }
.fw-pop .fw__btn { width: 100%; }
.fw-pop__close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  background: #F1F3F6; color: #111827; font-size: 24px; line-height: 1;
}
.fw-pop__close:focus-visible { outline: 3px solid #111827; outline-offset: 2px; }

@media (max-width: 480px) {
  .fw-launcher { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .fw-pop { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; }
}
@media (prefers-reduced-motion: reduce) { .fw__btn { transition: none; } .fw__btn:hover { transform: none; } }

/* Site link rules (e.g. a light link colour inside a dark hero) must not
   recolour the widget's buttons and links. */
.fw a.fw__btn--call { color: var(--fw-ink) !important; background: #FFFFFF !important; }
.fw button.fw__btn--talk { color: var(--fw-on-accent) !important; background: var(--fw-accent) !important; }
.fw button.fw__btn--type { color: var(--fw-on-ink) !important; background: var(--fw-ink) !important; }
.fw .fw__phone a, .fw .fw__privacy a { color: var(--fw-ink) !important; }
.fw .fw__credit a { color: #4A5160 !important; }

/* The Privacy Policy link inside the consent line. */
.fw .fw__notice a { color: var(--fw-ink) !important; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
