/* F.Robin chat widget v1.1 — matches frobintech.com (charcoal + raspberry)
 * Change the brand colours here only. Everything is scoped under #frc-root
 * with resets, so the WordPress theme can't restyle the buttons or input. */
#frc-root {
  --frc-accent: #c83264;        /* site raspberry (buttons / highlights) */
  --frc-accent-deep: #9e2150;   /* hover / pressed */
  --frc-accent-soft: #fbe9f0;   /* tints */
  --frc-ink: #141313;           /* site charcoal (header, launcher ring) */
  --frc-ink-2: #221f21;
  --frc-paper: #ffffff;
  --frc-mist: #f4f1f3;          /* bot bubble */
  --frc-text: #1c1a1b;
  --frc-muted: #6e676b;
  --frc-line: #e7e1e4;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#frc-root *, #frc-root *::before, #frc-root *::after { box-sizing: border-box; }

/* Hard reset of anything the theme styles globally */
#frc-root button, #frc-root textarea {
  all: unset; box-sizing: border-box; font: inherit; color: inherit;
  -webkit-appearance: none; appearance: none;
}
#frc-root button, #frc-root textarea {
  border: 0 !important; box-shadow: none !important; text-transform: none !important;
  letter-spacing: normal !important; min-width: 0 !important; margin: 0 !important;
}
#frc-root a { box-shadow: none; }

/* ---------- Launcher ---------- */
#frc-root .frc-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 99998;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--frc-accent); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 0 0 4px rgba(255,255,255,.08), 0 10px 28px rgba(200,50,100,.45);
  transition: transform .2s ease, background-color .2s ease;
}
#frc-root .frc-launcher:hover { background: var(--frc-accent-deep); transform: translateY(-2px); }
#frc-root .frc-launcher svg { width: 26px; height: 26px; transition: transform .25s ease, opacity .2s ease; }
#frc-root .frc-launcher .frc-ic-close { position: absolute; opacity: 0; transform: rotate(-90deg); }
#frc-root .frc-launcher[aria-expanded="true"] .frc-ic-chat { opacity: 0; transform: rotate(90deg); }
#frc-root .frc-launcher[aria-expanded="true"] .frc-ic-close { opacity: 1; transform: none; }

/* ---------- Panel ---------- */
#frc-root .frc-panel {
  position: fixed; right: 22px; bottom: 96px; z-index: 99999;
  width: 380px; max-width: calc(100vw - 24px);
  height: 600px; max-height: calc(100vh - 124px);
  display: flex; flex-direction: column;
  background: var(--frc-paper); color: var(--frc-text);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(20,19,19,.35), 0 0 0 1px rgba(20,19,19,.06);
  transform-origin: bottom right;
}
#frc-root .frc-panel[hidden] { display: none; }

/* Header: charcoal with a faint circuit-trace pattern */
#frc-root .frc-head {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 18px 16px 18px 18px;
  background-color: var(--frc-ink);
  background-image:
    radial-gradient(120% 140% at 100% 0%, rgba(200,50,100,.35), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80' viewBox='0 0 160 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M0 20h40l10 10h40l10-10h60'/%3E%3Cpath d='M0 60h25l12-12h38l8 8h77'/%3E%3Cpath d='M110 0v14l8 8v58'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.12'%3E%3Ccircle cx='50' cy='30' r='2.5'/%3E%3Ccircle cx='90' cy='30' r='2.5'/%3E%3Ccircle cx='37' cy='48' r='2.5'/%3E%3Ccircle cx='118' cy='22' r='2.5'/%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
}
#frc-root .frc-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--frc-accent), rgba(200,50,100,0) 85%);
}
#frc-root .frc-avatar {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--frc-accent); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
}
#frc-root .frc-avatar::after {
  content: ""; position: absolute; right: -3px; bottom: -3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #35c47a; border: 2px solid var(--frc-ink);
}
#frc-root .frc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#frc-root .frc-title strong { font-size: 16.5px; font-weight: 700; line-height: 1.25; color: #fff; }
#frc-root .frc-title span { font-size: 12.5px; color: rgba(255,255,255,.7); }
#frc-root .frc-close {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; cursor: pointer; color: rgba(255,255,255,.8);
  transition: background-color .15s ease, color .15s ease;
}
#frc-root .frc-close:hover { background: rgba(255,255,255,.1); color: #fff; }
#frc-root .frc-close svg { width: 18px; height: 18px; }

/* ---------- Messages ---------- */
#frc-root .frc-log {
  flex: 1; overflow-y: auto; padding: 18px 16px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--frc-paper);
  scrollbar-width: thin; scrollbar-color: #d9d2d6 transparent;
}
#frc-root .frc-log::-webkit-scrollbar { width: 6px; }
#frc-root .frc-log::-webkit-scrollbar-thumb { background: #d9d2d6; border-radius: 3px; }

#frc-root .frc-msg {
  max-width: 84%; padding: 10px 14px; border-radius: 16px;
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px;
}
#frc-root .frc-bot { align-self: flex-start; background: var(--frc-mist); border-bottom-left-radius: 5px; }
#frc-root .frc-user {
  align-self: flex-end; background: var(--frc-ink); color: #fff; border-bottom-right-radius: 5px;
}
#frc-root .frc-bot a { color: var(--frc-accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
#frc-root .frc-bot a:hover { color: var(--frc-accent-deep); }
#frc-root .frc-new { animation: frc-pop .22s ease-out; }

/* Typing dots */
#frc-root .frc-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
#frc-root .frc-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: #b3aab0;
  animation: frc-dot 1.1s infinite ease-in-out;
}
#frc-root .frc-typing i:nth-child(2) { animation-delay: .15s; }
#frc-root .frc-typing i:nth-child(3) { animation-delay: .3s; }

/* Quick questions */
#frc-root .frc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
#frc-root .frc-chip {
  cursor: pointer; padding: 7px 13px; border-radius: 999px;
  border: 1px solid #efc3d3 !important; background: var(--frc-accent-soft);
  color: var(--frc-accent-deep); font-size: 13px; font-weight: 600; line-height: 1.2;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
#frc-root .frc-chip:hover { background: var(--frc-accent); border-color: var(--frc-accent) !important; color: #fff; }

/* ---------- Composer ---------- */
#frc-root .frc-foot { padding: 10px 14px 12px; border-top: 1px solid var(--frc-line); background: #fff; }
#frc-root .frc-form {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 6px 6px 6px 14px; border-radius: 16px;
  background: var(--frc-mist); border: 1px solid transparent;
  transition: border-color .15s ease, background-color .15s ease;
}
#frc-root .frc-form:focus-within { border-color: var(--frc-accent); background: #fff; }
#frc-root .frc-input {
  flex: 1; display: block; min-height: 24px; max-height: 110px; overflow-y: auto;
  padding: 7px 0; resize: none; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--frc-text); font-size: 14.5px; line-height: 1.45;
}
#frc-root .frc-input::placeholder { color: #968d92; opacity: 1; }
#frc-root .frc-send {
  flex: none; width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; background: var(--frc-accent); color: #fff;
  transition: background-color .15s ease, opacity .15s ease;
}
#frc-root .frc-send:hover { background: var(--frc-accent-deep); }
#frc-root .frc-send:disabled { opacity: .4; cursor: default; background: var(--frc-accent); }
#frc-root .frc-send svg { width: 18px; height: 18px; }

/* Focus rings (keyboard only) */
#frc-root .frc-launcher:focus-visible,
#frc-root .frc-close:focus-visible,
#frc-root .frc-send:focus-visible,
#frc-root .frc-chip:focus-visible { outline: 3px solid var(--frc-accent); outline-offset: 2px; }
#frc-root .frc-close:focus-visible { outline-color: #fff; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  #frc-root .frc-panel {
    right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%;
    height: 100%; max-height: 100%; border-radius: 0;
  }
  #frc-root .frc-launcher { right: 16px; bottom: 16px; }
  #frc-root .frc-launcher[aria-expanded="true"] { display: none; }
}

/* ---------- Motion ---------- */
@keyframes frc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes frc-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes frc-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  #frc-root .frc-panel:not([hidden]) { animation: frc-in .22s cubic-bezier(.2,.8,.3,1); }
}
@media (prefers-reduced-motion: reduce) {
  #frc-root *, #frc-root *::before, #frc-root *::after { animation: none !important; transition: none !important; }
}
