/* Frogman — Tara chat widget. Scoped under .frt- to avoid theme collisions.
 * Two views (Home + Chat) toggled by a bottom tab bar. Frogman identity:
 * deep navy (#0f172a) + brand teal (#00CED1), clean/solid. Anchored BOTTOM-LEFT. */

.frt-root {
  --frt-teal: #00CED1;
  --frt-teal-dark: #00A8AB;
  --frt-navy: #041634;
  --frt-blue: #095CA3;
  --frt-blue-dark: #074a83;
  --frt-ink: #0f2430;
  --frt-muted: #64748b;
  --frt-line: #e6edf2;
  --frt-bot: #f1f6f8;
  --frt-head: #041634;
  position: fixed;
  left: 24px;
  bottom: 36px;
  z-index: 2147483000;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.frt-root *, .frt-root *::before, .frt-root *::after { box-sizing: border-box; }
/* Use the site's Font Awesome (loaded by the theme) for all widget icons. */
.frt-root .fa { font-family: FontAwesome, "Font Awesome 5 Free", "Font Awesome 6 Free", sans-serif; font-style: normal; line-height: 1; }

/* Launcher — compact circular avatar with a label that slides out on hover */
.frt-launcher {
  display: flex; align-items: center;
  padding: 0; border: 0; background: transparent;
  cursor: pointer; transition: transform .18s ease;
}
.frt-launcher:hover { transform: translateY(-2px); }
.frt-launcher:focus-visible { outline: 3px solid var(--frt-teal); outline-offset: 3px; border-radius: 999px; }
.frt-launcher-avatar {
  position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--frt-teal), var(--frt-teal-dark));
  display: grid; place-items: center; flex: 0 0 auto; font-size: 30px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .35), 0 0 0 3px rgba(0, 206, 209, .55);
  transition: box-shadow .18s ease;
}
.frt-launcher:hover .frt-launcher-avatar { box-shadow: 0 14px 32px rgba(15, 23, 42, .45), 0 0 0 4px rgba(0, 206, 209, .8); }
.frt-launcher-avatar img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.frt-dot {
  position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #22c55e; border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: frt-pulse 2s infinite;
}
@keyframes frt-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6);} 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0);} 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0);} }
.frt-launcher-label {
  position: relative; z-index: 0; white-space: nowrap;
  max-width: 0; opacity: 0; padding: 0; margin-left: -22px;
  background: var(--frt-navy); color: #fff; font-weight: 700; font-size: 14px;
  border-radius: 999px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .3);
  transition: max-width .28s ease, opacity .2s ease, padding .28s ease;
}
.frt-launcher:hover .frt-launcher-label, .frt-launcher:focus-visible .frt-launcher-label {
  max-width: 220px; opacity: 1; padding: 12px 18px 12px 28px;
}

/* Panel shell */
.frt-panel {
  position: absolute; left: 0; bottom: 0;
  width: 388px; max-width: calc(100vw - 24px);
  height: 600px; max-height: calc(100vh - 40px);
  display: none; flex-direction: column;
  background: #fff; border: 1px solid var(--frt-line); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .38);
  overflow: hidden; transform-origin: bottom left;
}
.frt-root.frt-open .frt-panel { display: flex; animation: frt-in .22s cubic-bezier(.2,.8,.2,1); }
.frt-root.frt-open .frt-launcher { display: none; }
@keyframes frt-in { from { opacity: 0; transform: translateY(12px) scale(.98);} to { opacity: 1; transform: none;} }

/* View toggling */
.frt-home, .frt-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.frt-root.frt-view-home .frt-chat { display: none; }
.frt-root.frt-view-chat .frt-home { display: none; }

/* ── HOME VIEW ── */
.frt-home { overflow: hidden; }
.frt-hero {
  position: relative; padding: 26px 20px 22px; background: var(--frt-head); color: #fff;
  border-bottom: 2px solid var(--frt-teal); text-align: left;
}
.frt-hero-av { display: inline-block; }
.frt-hero-av img {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--frt-teal); box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.frt-hero-h { margin-top: 12px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.frt-hero-sub { margin-top: 4px; font-size: 13px; color: rgba(255, 255, 255, .72); }
.frt-hero-sub, .frt-hero-h { max-width: 90%; }
.frt-close-home { position: absolute; top: 12px; right: 12px; }

.frt-home-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 14px; display: flex; flex-direction: column; gap: 12px; background: #fbfdfe; }

.frt-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; border: 0; border-radius: 14px;
  background: var(--frt-blue); color: #fff;
  box-shadow: 0 8px 20px rgba(9, 92, 163, .3); transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.frt-cta:hover { transform: translateY(-1px); background: var(--frt-blue-dark); box-shadow: 0 12px 26px rgba(9,92,163,.42); }
.frt-cta b { display: block; font-size: 15px; font-weight: 700; color: #fff; }
.frt-cta small { display: block; font-size: 12px; opacity: .85; color: #fff; }
.frt-cta-arrow { font-size: 18px; color: #fff; }

.frt-home-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--frt-muted); margin: 2px 2px -2px; }

.frt-starters { display: flex; flex-direction: column; gap: 8px; }
.frt-starter {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--frt-line); border-radius: 12px;
  background: #fff; color: var(--frt-ink); font-size: 14px; transition: border-color .15s, background .15s, transform .1s;
}
.frt-starter:hover { border-color: var(--frt-teal); background: rgba(0,206,209,.06); transform: translateX(2px); }
.frt-starter-arrow { color: var(--frt-teal-dark); font-size: 18px; font-weight: 700; }

.frt-continue-card {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--frt-teal); border-radius: 12px;
  background: rgba(0,206,209,.07); color: var(--frt-ink);
}
.frt-continue-ic { font-size: 18px; }
.frt-continue-tx { flex: 1; min-width: 0; }
.frt-continue-tx b { display: block; font-size: 14px; }
.frt-continue-tx small { display: block; font-size: 12px; color: var(--frt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.frt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.frt-action {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 8px; border: 1px solid var(--frt-line); border-radius: 12px;
  background: #fff; color: var(--frt-ink); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.frt-action:hover { border-color: var(--frt-teal); background: rgba(0,206,209,.06); }
.frt-action[data-act="wa"] .frt-action-ic { color: #25D366; }
.frt-action-ic { font-size: 16px; }

/* ── CHAT VIEW ── */
.frt-header {
  display: flex; align-items: center; gap: 10px; padding: 13px 12px;
  background: var(--frt-head); color: #fff; border-bottom: 2px solid var(--frt-teal);
}
.frt-back { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; flex: 0 0 auto; }
.frt-back:hover { background: rgba(0,206,209,.45); }
.frt-head-av img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--frt-teal); }
.frt-header-meta { flex: 1; min-width: 0; }
.frt-header-meta b { font-size: 15px; font-weight: 700; color: #fff; }
.frt-header-meta span { display: block; font-size: 12px; color: rgba(255, 255, 255, .72); }
.frt-header-meta span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; margin-right: 6px; vertical-align: middle; }
.frt-close, .frt-reset { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; flex: 0 0 auto; }
.frt-close:hover, .frt-reset:hover { background: rgba(0,206,209,.45); }
.frt-reset { font-size: 16px; }

.frt-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; background: #fbfdfe; }
.frt-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.frt-msg.bot { align-self: flex-start; background: var(--frt-bot); color: var(--frt-ink); border: 1px solid var(--frt-line); border-bottom-left-radius: 5px; }
.frt-msg.user { align-self: flex-end; background: var(--frt-teal); color: #06363a; font-weight: 500; border-bottom-right-radius: 5px; }
.frt-msg a { color: var(--frt-teal-dark); font-weight: 600; text-decoration: underline; }
.frt-msg.user a { color: #06363a; }
.frt-msg p { margin: 0 0 8px; } .frt-msg p:last-child { margin: 0; }
.frt-msg ul { margin: 6px 0; padding-left: 18px; } .frt-msg li { margin: 2px 0; }
.frt-msg code { background: rgba(15,36,48,.07); padding: 1px 5px; border-radius: 5px; font-size: 13px; }

.frt-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--frt-bot); border: 1px solid var(--frt-line); border-radius: 16px; border-bottom-left-radius: 5px; }
.frt-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--frt-teal-dark); opacity: .5; animation: frt-bounce 1.2s infinite; }
.frt-typing span:nth-child(2) { animation-delay: .15s; } .frt-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes frt-bounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

.frt-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--frt-line); background: #fff; }
.frt-composer textarea {
  flex: 1; resize: none; max-height: 110px; min-height: 22px;
  border: 1px solid var(--frt-line); border-radius: 12px; padding: 10px 12px;
  font: inherit; color: var(--frt-ink); background: #fff; outline: none;
}
.frt-composer textarea:focus { border-color: var(--frt-teal); box-shadow: 0 0 0 3px rgba(0,206,209,.15); }
.frt-send { flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--frt-teal), var(--frt-teal-dark)); color: #fff; cursor: pointer; display: grid; place-items: center; }
.frt-send:disabled { opacity: .45; cursor: default; }
.frt-send svg { width: 18px; height: 18px; }
.frt-footnote { text-align: center; font-size: 11px; color: var(--frt-muted); padding: 0 12px 8px; background: #fff; }

/* ── TAB BAR ── */
.frt-tabs { display: flex; flex: 0 0 auto; border-top: 1px solid var(--frt-line); background: #fff; }
.frt-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px 8px; border: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--frt-muted); transition: color .15s;
  border-top: 2px solid transparent; margin-top: -1px;
}
.frt-tab i { font-size: 16px; }
.frt-tab.frt-tab-on { color: var(--frt-blue); border-top-color: var(--frt-blue); }

/* ── Icon sizing ── */
.frt-send i { font-size: 16px; }
.frt-back i, .frt-reset i, .frt-close i { font-size: 16px; }
.frt-starter-arrow i, .frt-cta-arrow i { font-size: 18px; }
.frt-action-ic i { font-size: 16px; }
.frt-continue-ic i { font-size: 17px; color: var(--frt-blue); }
.frt-launcher-avatar .fa, .frt-hero-av .fa, .frt-head-av .fa { color: #fff; font-size: 26px; }

@media (max-width: 480px) {
  .frt-root { left: 16px; bottom: 20px; }
  .frt-panel {
    position: fixed; left: 0; top: 0; right: auto; bottom: auto;
    width: 100vw; height: 100vh; height: 100dvh;
    max-width: none; max-height: none; border-radius: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .frt-root *, .frt-dot { animation: none !important; transition: none !important; }
}
