/* "Ask FlexTee" chat assistant widget. Everything is prefixed .ftc- so it
   can't clash with the site's own styles. */
.ftc-root {
  --ftc-primary: #214d32;
  --ftc-primary-deep: #163823;
  --ftc-accent: #8db596;
  --ftc-accent-soft: #e3eee5;
  --ftc-white: #ffffff;
  --ftc-ink: #17231b;
  --ftc-muted: #55625a;
  --ftc-line: rgba(23, 35, 27, 0.14);
  --ftc-paper: #f6f5f1;
  font-family: var(--sans, "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ftc-ink);
}

.ftc-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- launcher ---------- */
.ftc-launcher {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 55;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.15rem 0.8rem 1rem; min-height: 48px;
  font: inherit; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  color: var(--ftc-white); background: var(--ftc-primary);
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; cursor: pointer;
  box-shadow: 0 14px 34px -14px rgba(15, 36, 24, 0.6);
  transition: background-color 200ms, transform 200ms, bottom 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ftc-launcher svg { width: 20px; height: 20px; color: var(--ftc-accent); }
.ftc-launcher:hover { background: var(--ftc-primary-deep); transform: translateY(-1px); }
.ftc-launcher:focus-visible,
.ftc-root button:focus-visible,
.ftc-root a:focus-visible,
.ftc-log:focus-visible {
  outline: 3px solid var(--ftc-accent); outline-offset: 2px;
}
.ftc-launcher.is-hidden { display: none; }

/* Sit above the site's mobile "Book a bay" bar when it is showing */
@media (max-width: 900px) {
  body:has(.book-bar.is-visible) .ftc-launcher { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

/* ---------- panel ---------- */
.ftc-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 61; /* above the cookie banner while open */
  width: min(400px, calc(100vw - 40px));
  height: min(620px, calc(100vh - 40px));
  height: min(620px, calc(100dvh - 40px));
  display: flex; flex-direction: column;
  background: var(--ftc-white); border: 1px solid var(--ftc-line); border-radius: 14px;
  box-shadow: 0 30px 70px -24px rgba(15, 36, 24, 0.55);
  overflow: hidden;
  animation: ftc-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ftc-panel[hidden] { display: none; }
@keyframes ftc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.ftc-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 0.75rem 0.9rem 1.1rem;
  background: var(--ftc-primary); color: var(--ftc-white);
}
.ftc-title { margin: 0; font: inherit; font-size: 1.05rem; font-weight: 600; letter-spacing: 0.01em; color: inherit; }
.ftc-sub { margin: 0.1rem 0 0; font-size: 0.8rem; color: rgba(255, 255, 255, 0.72); }
.ftc-close {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--ftc-white); background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.ftc-close:hover { background: rgba(255, 255, 255, 0.12); }
.ftc-close svg { width: 22px; height: 22px; }

.ftc-log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--ftc-paper);
}

.ftc-msg {
  position: relative; max-width: 88%;
  padding: 0.65rem 0.85rem; border-radius: 12px;
  overflow-wrap: anywhere;
}
.ftc-msg p { margin: 0; }
.ftc-msg p + p, .ftc-msg p + ul, .ftc-msg ul + p { margin-top: 0.5rem; }
.ftc-msg ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.ftc-msg li + li { margin-top: 0.2rem; }
.ftc-msg strong { font-weight: 600; }
.ftc-msg--bot {
  align-self: flex-start; background: var(--ftc-white); color: var(--ftc-ink);
  border: 1px solid var(--ftc-line); border-bottom-left-radius: 4px;
}
.ftc-msg--bot a { color: var(--ftc-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ftc-msg--bot a:hover { color: var(--ftc-primary-deep); }
.ftc-msg--user {
  align-self: flex-end; background: var(--ftc-primary); color: var(--ftc-white);
  border-bottom-right-radius: 4px; white-space: pre-wrap;
}
.ftc-msg--error { border-color: #d9b8b0; background: #fbf3f1; }

.ftc-quick { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.15rem 0 0.3rem; }
.ftc-chip {
  font: inherit; font-size: 0.86rem; text-align: left;
  padding: 0.5rem 0.8rem; min-height: 40px;
  color: var(--ftc-primary); background: var(--ftc-white);
  border: 1px solid var(--ftc-accent); border-radius: 999px; cursor: pointer;
  transition: background-color 150ms, color 150ms;
}
.ftc-chip:hover { background: var(--ftc-accent-soft); }

.ftc-typing { display: inline-flex; gap: 5px; align-items: center; padding: 0.8rem 0.95rem; }
.ftc-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ftc-accent);
  animation: ftc-dot 1.1s infinite ease-in-out;
}
.ftc-typing i:nth-of-type(2) { animation-delay: 0.15s; }
.ftc-typing i:nth-of-type(3) { animation-delay: 0.3s; }
@keyframes ftc-dot { 0%, 80%, 100% { opacity: 0.35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ftc-form {
  display: flex; align-items: flex-end; gap: 0.5rem;
  padding: 0.7rem 0.75rem 0.5rem; border-top: 1px solid var(--ftc-line); background: var(--ftc-white);
}
.ftc-input {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming in */
  line-height: 1.4; color: var(--ftc-ink);
  padding: 0.6rem 0.75rem; border: 1px solid var(--ftc-line); border-radius: 10px; background: var(--ftc-white);
}
.ftc-input:focus { outline: 2px solid var(--ftc-accent); outline-offset: 0; border-color: var(--ftc-accent); }
.ftc-send {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--ftc-white); background: var(--ftc-primary); border: 0; border-radius: 10px; cursor: pointer;
}
.ftc-send:hover { background: var(--ftc-primary-deep); }
.ftc-send:disabled { opacity: 0.55; cursor: progress; }
.ftc-send svg { width: 20px; height: 20px; }

.ftc-note {
  margin: 0; padding: 0 0.9rem 0.65rem; background: var(--ftc-white);
  font-size: 0.74rem; color: var(--ftc-muted); text-align: center;
}
.ftc-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- contact form inside the chat ---------- */
.ftc-contact {
  align-self: stretch; display: grid; gap: 0.55rem;
  padding: 0.85rem; background: var(--ftc-white);
  border: 1px solid var(--ftc-accent); border-radius: 12px;
}
.ftc-contact-lead { margin: 0; font-size: 0.9rem; }
.ftc-field { display: grid; gap: 0.2rem; }
.ftc-field label { font-size: 0.8rem; font-weight: 600; color: var(--ftc-muted); }
.ftc-field-input {
  font: inherit; font-size: 16px; /* 16px stops iOS zooming in */
  min-height: 42px; padding: 0.5rem 0.65rem; resize: vertical;
  color: var(--ftc-ink); background: var(--ftc-white);
  border: 1px solid var(--ftc-line); border-radius: 8px;
}
textarea.ftc-field-input { min-height: 60px; }
.ftc-field-input:focus { outline: 2px solid var(--ftc-accent); outline-offset: 0; border-color: var(--ftc-accent); }
.ftc-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ftc-contact-status { margin: 0; font-size: 0.82rem; color: var(--ftc-muted); }
.ftc-contact-status:empty { display: none; }
.ftc-contact-status.is-error { color: #9a3b26; }
.ftc-contact-send {
  font: inherit; font-weight: 600; min-height: 44px; padding: 0.55rem 1rem;
  color: var(--ftc-white); background: var(--ftc-primary); border: 0; border-radius: 10px; cursor: pointer;
}
.ftc-contact-send:hover { background: var(--ftc-primary-deep); }
.ftc-contact-send:disabled { opacity: 0.55; cursor: progress; }

/* ---------- phones: full screen ---------- */
@media (max-width: 640px) {
  .ftc-launcher { right: 16px; }
  .ftc-panel {
    inset: 0; width: 100%; height: 100%; max-height: none;
    border: 0; border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ftc-header { padding-top: calc(0.9rem + env(safe-area-inset-top)); }
  html.ftc-open, html.ftc-open body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .ftc-panel, .ftc-typing i { animation: none; }
  .ftc-launcher { transition: none; }
}
