/* Assistente Virtual — Elizandra Freitas Advocacia */
.efc {
  --efc-ink: #0c0e12;
  --efc-ink-2: #1a1e26;
  --efc-paper: #faf8f4;
  --efc-gold: #c3a063;
  --efc-gold-2: #e6cf9c;
  --efc-gold-3: #9a7a42;
  --efc-line: rgba(22, 24, 29, .1);
  --efc-muted: #6c6e76;
  --efc-wa: #1faa59;
  --efc-ease: cubic-bezier(.22, 1, .36, 1);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: #16181d;
}
.efc *, .efc *::before, .efc *::after { box-sizing: border-box; }
:where(.efc) svg { width: 18px; height: 18px; flex: none; display: block; }
:where(.efc) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.efc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botão flutuante ---------- */
.efc-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 150;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  color: #1b150a !important;
  background: linear-gradient(135deg, var(--efc-gold-2), var(--efc-gold) 50%, var(--efc-gold-3)) !important;
  box-shadow: 0 16px 40px -12px rgba(195, 160, 99, .7), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .5s var(--efc-ease), box-shadow .4s;
}
.efc-launcher::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--efc-gold);
  animation: efc-ring 2.8s var(--efc-ease) infinite;
}
.efc.is-seen .efc-launcher::before, .efc.is-open .efc-launcher::before { animation: none; opacity: 0; }
@keyframes efc-ring { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.efc-launcher:hover { transform: translateY(-3px) scale(1.04); }
.efc-launcher svg { width: 26px; height: 26px; }
.efc-launcher__ico { position: absolute; display: grid; place-items: center; transition: transform .5s var(--efc-ease), opacity .3s; }
.efc-launcher__ico--close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.efc.is-open .efc-launcher__ico--chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.efc.is-open .efc-launcher__ico--close { opacity: 1; transform: none; }
.efc-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: #d64545;
  border: 2px solid #fff;
  transition: transform .3s var(--efc-ease);
}
.efc.is-seen .efc-badge, .efc.is-open .efc-badge { transform: scale(0); }

/* ---------- Mensagem de boas-vindas ---------- */
.efc-teaser {
  position: fixed; right: 24px; bottom: 100px; z-index: 149;
  width: min(300px, calc(100vw - 48px));
  opacity: 0; transform: translateY(12px) scale(.96); transform-origin: bottom right;
  transition: opacity .4s, transform .6s var(--efc-ease);
}
.efc-teaser.is-visible { opacity: 1; transform: none; }
.efc-teaser__body {
  display: grid; gap: 4px; width: 100%; text-align: left;
  padding: 16px 38px 16px 18px; border-radius: 18px 18px 4px 18px;
  background: #fff; color: #464952 !important; font-size: 13.5px;
  border: 1px solid var(--efc-line);
  box-shadow: 0 24px 60px -24px rgba(12, 14, 18, .45);
}
.efc-teaser__title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 19px; font-weight: 600; color: #16181d; }
.efc-teaser__close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--efc-muted) !important; z-index: 1; }
.efc-teaser__close:hover { background: #f2ede3 !important; }
.efc-teaser__close svg { width: 15px; height: 15px; }

/* ---------- Painel ---------- */
.efc-panel {
  position: fixed; right: 24px; bottom: 100px; z-index: 151;
  width: 400px; height: min(680px, calc(100vh - 130px)); height: min(680px, calc(100dvh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 24px; background: var(--efc-paper);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 40px 100px -30px rgba(12, 14, 18, .55), 0 0 0 1px rgba(12, 14, 18, .06);
  transform-origin: bottom right;
  animation: efc-in .55s var(--efc-ease);
}
.efc-panel[hidden] { display: none; }
@keyframes efc-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }

.efc-head {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 16px 12px 16px 18px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(195, 160, 99, .22), transparent 55%), var(--efc-ink);
  color: #f4efe6;
}
.efc-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--efc-gold), transparent); opacity: .6; }
.efc-avatar { position: relative; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); flex: none; }
.efc-avatar img { width: 30px; height: auto; }
.efc-online { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; background: #3ecf7a; border: 2.5px solid var(--efc-ink); }
.efc-id { flex: 1; min-width: 0; }
.efc-id h2 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px; font-weight: 600; line-height: 1.1; color: #f4efe6; }
.efc-id p { margin: 3px 0 0; font-size: 11px; letter-spacing: .08em; color: #b9b3a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.efc-iconbtn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #b9b3a8 !important; transition: background-color .3s, color .3s; }
.efc-iconbtn:hover { background: rgba(255, 255, 255, .08) !important; color: #fff !important; }

.efc-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 8px; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .15) transparent; }
.efc-notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; background: #f2ede3; color: #5b5d65; font-size: 12px; line-height: 1.45; }
.efc-notice svg { width: 16px; height: 16px; color: var(--efc-gold-3); margin-top: 1px; }

.efc-msg { display: flex; flex-direction: column; margin-bottom: 12px; }
.efc-msg--user { align-items: flex-end; }
.efc-msg--bot { align-items: flex-start; }
.efc-msg.is-new { animation: efc-msg .5s var(--efc-ease); }
@keyframes efc-msg { from { opacity: 0; transform: translateY(8px); } }
.efc-bubble { max-width: 88%; padding: 11px 14px 7px; border-radius: 18px; overflow-wrap: anywhere; }
.efc-msg--bot .efc-bubble { background: #fff; border: 1px solid var(--efc-line); border-top-left-radius: 6px; box-shadow: 0 6px 18px -14px rgba(0, 0, 0, .3); }
.efc-msg--user .efc-bubble { background: var(--efc-ink); color: #f4efe6; border-top-right-radius: 6px; }
.efc-bubble strong { color: inherit; font-weight: 700; }
.efc-bubble time { display: block; margin-top: 3px; font-size: 10px; opacity: .5; text-align: right; }

.efc-options { display: grid; gap: 6px; width: 88%; margin-top: 8px; }
.efc-options button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px 10px 14px; border-radius: 14px; text-align: left;
  font-size: 13.5px; font-weight: 500; color: #16181d !important;
  background: #fff !important; border: 1px solid var(--efc-line) !important;
  transition: border-color .25s, background-color .25s, transform .35s var(--efc-ease);
}
.efc-options button svg { width: 15px; height: 15px; color: var(--efc-gold-3); transition: transform .35s var(--efc-ease); }
.efc-options button:hover:not(:disabled) { border-color: var(--efc-gold) !important; background: #fdf9f1 !important; transform: translateX(3px); }
.efc-options button:hover:not(:disabled) svg { transform: translateX(3px); }
.efc-options.is-used { display: none; }

.efc-cta, .efc-card { width: 88%; margin-top: 8px; }
.efc-cta { display: grid; gap: 6px; }
.efc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 14px; border-radius: 12px;
  font-size: 13px; font-weight: 600; text-decoration: none !important;
  transition: filter .25s, background-color .25s, border-color .25s, transform .35s var(--efc-ease);
}
.efc-btn svg { width: 16px; height: 16px; }
.efc-btn--wa { background: var(--efc-wa); color: #fff !important; box-shadow: 0 10px 24px -12px rgba(31, 170, 89, .8); }
.efc-btn--wa:hover { filter: brightness(1.06); transform: translateY(-1px); }
.efc-btn--ghost { background: #fff !important; color: #16181d !important; border: 1px solid var(--efc-line) !important; }
.efc-btn--ghost:hover { border-color: var(--efc-gold) !important; }

.efc-card { padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--efc-line); box-shadow: 0 10px 30px -20px rgba(0, 0, 0, .35); }
.efc-card dl { margin: 0 0 12px; display: grid; gap: 8px; }
.efc-card dl div { display: grid; gap: 1px; padding-bottom: 8px; border-bottom: 1px dashed var(--efc-line); }
.efc-card dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.efc-card dt { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--efc-gold-3); }
.efc-card dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.efc-card .efc-btn--wa { width: 100%; }
.efc-card__row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.efc-card__row .efc-btn { font-size: 12px; padding: 0 8px; }

.efc-typing { display: inline-flex; gap: 4px; padding: 13px 16px; margin-bottom: 12px; border-radius: 18px; border-top-left-radius: 6px; background: #fff; border: 1px solid var(--efc-line); }
.efc-typing[hidden] { display: none; }
.efc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--efc-gold); animation: efc-dot 1.2s infinite ease-in-out; }
.efc-typing span:nth-child(2) { animation-delay: .15s; }
.efc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes efc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }

/* ---------- Rodapé do painel ---------- */
.efc-foot { padding: 8px 12px 12px; background: #fff; border-top: 1px solid var(--efc-line); }
.efc-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.efc-chips::-webkit-scrollbar { display: none; }
.efc-chips button { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #464952 !important; background: #f2ede3 !important; border: 1px solid transparent !important; transition: border-color .25s, color .25s; }
.efc-chips button:hover { border-color: var(--efc-gold) !important; color: #16181d !important; }
.efc-form { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 16px; background: var(--efc-paper); border: 1px solid var(--efc-line); transition: border-color .25s, box-shadow .25s; }
.efc-form:focus-within { border-color: var(--efc-gold); box-shadow: 0 0 0 4px rgba(195, 160, 99, .15); }
.efc-form textarea { flex: 1; min-height: 24px; max-height: 120px; padding: 7px 0; margin: 0; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 14.5px; color: #16181d; line-height: 1.45; }
.efc-form textarea::placeholder { color: #9a9ca3; }
.efc-send { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--efc-gold-2) !important; background: var(--efc-ink) !important; transition: opacity .25s, transform .35s var(--efc-ease); }
.efc-send:disabled { opacity: .35; cursor: default; }
.efc-send:not(:disabled):hover { transform: scale(1.05); }
.efc-send svg { width: 17px; height: 17px; }
.efc-wa { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--efc-wa) !important; text-decoration: none !important; }
.efc-wa svg { width: 15px; height: 15px; }
.efc-wa:hover { text-decoration: underline !important; }

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .efc-launcher { right: 16px; bottom: 16px; width: 58px; height: 58px; }
  .efc-teaser { right: 16px; bottom: 86px; width: auto; }
  .efc-teaser__body { padding: 10px 40px 10px 16px; }
  .efc-teaser__body span:not(.efc-teaser__title) { display: none; }
  .efc-teaser__title { font-size: 17px; }
  .efc-teaser__close { top: 50%; margin-top: -14px; }
  .efc-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
  .efc-head { padding-top: max(16px, env(safe-area-inset-top)); }
  .efc.is-open .efc-launcher { opacity: 0; pointer-events: none; }
  .efc-options, .efc-cta, .efc-card { width: 94%; }
  .efc-bubble { max-width: 92%; }
  .efc-form textarea { font-size: 16px; }
}
html.efc-lock, html.efc-lock body { overflow: hidden; }
body.menu-open .efc-launcher, body.menu-open .efc-teaser { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .efc *, .efc *::before, .efc::after { animation: none !important; transition: none !important; }
}
@media print { .efc { display: none !important; } }
