/* ═══════════════════════════════════════════════════
   BORIOLA AI CHAT — Widget CSS v2.0
═══════════════════════════════════════════════════ */
:root {
  --bac-ink:      #0d0d0d;
  --bac-ink2:     #1c1a14;
  --bac-ink3:     #2e2b1f;
  --bac-gold:     #b8972e;
  --bac-gold-lt:  #d4af50;
  --bac-gold-dim: rgba(184,151,46,0.12);
  --bac-gold-brd: rgba(184,151,46,0.28);
  --bac-paper:    #faf8f4;
  --bac-paper2:   #f3f0e8;
  --bac-cream:    #e8e2d0;
  --bac-muted:    #7a7260;
  --bac-muted2:   #a09880;
  --bac-radius:   18px;
  --bac-shadow:   0 24px 80px rgba(13,13,13,0.16), 0 4px 16px rgba(184,151,46,0.08);
}

/* ── FLOATING BUTTON ── */
#bac-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--bac-ink), var(--bac-ink3));
  border: 2px solid var(--bac-gold);
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: bacFabPulse 4s ease-in-out infinite;
}
#bac-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 28px rgba(0,0,0,0.36), 0 0 0 8px rgba(184,151,46,0.1);
}
#bac-fab.active { animation: none; }
#bac-fab svg { width: 26px; height: 26px; transition: transform .3s ease; }
#bac-fab.active svg { transform: rotate(90deg); }

@keyframes bacFabPulse {
  0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,0.28), 0 0 0 0 rgba(184,151,46,0.35); }
  60%      { box-shadow: 0 4px 20px rgba(0,0,0,0.28), 0 0 0 12px rgba(184,151,46,0); }
}

/* ── TOOLTIP ── */
#bac-tooltip {
  position: fixed;
  bottom: 100px;
  right: 28px;
  background: var(--bac-ink);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--bac-gold-brd);
  white-space: nowrap;
  z-index: 8999;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: bacTooltipIn .4s ease 2s both, bacTooltipOut .4s ease 7s both;
}
#bac-tooltip::after {
  content: '';
  position: absolute;
  top: 100%; right: 22px;
  border: 6px solid transparent;
  border-top-color: var(--bac-ink);
}
@keyframes bacTooltipIn  { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
@keyframes bacTooltipOut { from{opacity:1;transform:none} to{opacity:0;transform:translateY(8px)} }

/* ── CHAT WINDOW ── */
#bac-window {
  position: fixed;
  bottom: 102px;
  right: 28px;
  width: 420px;
  max-width: calc(100vw - 40px);
  height: 620px;
  max-height: calc(100vh - 130px);
  background: var(--bac-paper);
  border: 1px solid var(--bac-gold-brd);
  border-radius: var(--bac-radius);
  box-shadow: var(--bac-shadow);
  display: flex;
  flex-direction: column;
  z-index: 8998;
  overflow: hidden;
  transform: scale(.9) translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .2s ease;
  font-family: 'Outfit', sans-serif;
}
#bac-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── HEADER ── */
.bac-header {
  background: linear-gradient(135deg, var(--bac-ink) 0%, var(--bac-ink3) 100%);
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--bac-gold-brd);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.bac-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184,151,46,0.12), transparent 70%);
  pointer-events: none;
}
.bac-hrow { display: flex; align-items: center; justify-content: space-between; }
.bac-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bac-gold), var(--bac-gold-lt));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-weight: 600;
  color: var(--bac-ink);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(184,151,46,0.3);
}
.bac-hinfo { margin-left: 12px; flex: 1; }
.bac-hname {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem; font-weight: 600;
  color: #fff; letter-spacing: 0.02em;
}
.bac-hstatus {
  font-size: 0.7rem; color: var(--bac-gold-lt);
  display: flex; align-items: center; gap: 5px;
  margin-top: 3px;
}
.bac-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80;
  animation: bacBlink 2s ease-in-out infinite;
}
@keyframes bacBlink { 0%,100%{opacity:1} 50%{opacity:.4} }

.bac-close {
  background: rgba(255,255,255,.08); border: none;
  color: rgba(255,255,255,.7);
  width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; font-size: 1rem; line-height: 1;
}
.bac-close:hover { background: rgba(255,255,255,.18); color: #fff; }

.bac-disclaimer {
  font-size: 0.66rem; color: rgba(255,255,255,.38);
  margin-top: 10px; line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 8px;
}
.bac-disclaimer strong { color: rgba(184,151,46,.8); }

/* ── PROGRESS ── */
.bac-progress {
  height: 2px;
  background: rgba(0,0,0,.06);
  flex-shrink: 0;
}
.bac-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--bac-gold), var(--bac-gold-lt));
  width: 0%;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.bac-progress-label {
  text-align: center;
  font-size: 0.65rem; color: var(--bac-muted);
  padding: 5px 0 2px;
  letter-spacing: 0.06em; text-transform: uppercase;
  flex-shrink: 0;
  background: var(--bac-paper2);
  border-bottom: 1px solid rgba(184,151,46,.1);
}

/* ── MESSAGES ── */
.bac-msgs {
  flex: 1; overflow-y: auto;
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bac-paper);
  scroll-behavior: smooth;
}
.bac-msgs::-webkit-scrollbar { width: 3px; }
.bac-msgs::-webkit-scrollbar-track { background: transparent; }
.bac-msgs::-webkit-scrollbar-thumb { background: var(--bac-cream); border-radius: 3px; }

.bac-msg { max-width: 87%; animation: bacMsgIn .22s ease-out both; }
@keyframes bacMsgIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.bac-msg.bot { align-self: flex-start; }
.bac-msg.usr { align-self: flex-end; }

.bac-lbl {
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 4px;
}
.bac-msg.bot .bac-lbl { color: var(--bac-gold); }
.bac-msg.usr .bac-lbl { color: var(--bac-muted); text-align: right; }

.bac-bubble {
  padding: 11px 15px; border-radius: 14px;
  font-size: 0.855rem; line-height: 1.65;
}
.bac-msg.bot .bac-bubble {
  background: #fff; color: var(--bac-ink);
  border: 1px solid rgba(184,151,46,.15);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.bac-msg.usr .bac-bubble {
  background: linear-gradient(135deg, var(--bac-ink), var(--bac-ink3));
  color: #fff; border-bottom-right-radius: 4px;
}

/* Sugestões */
.bac-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bac-sug {
  background: #fff; border: 1px solid var(--bac-gold-brd);
  color: var(--bac-ink);
  font-family: 'Outfit', sans-serif; font-size: 0.78rem;
  padding: 6px 13px; border-radius: 20px; cursor: pointer;
  transition: all .15s; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.bac-sug:hover {
  background: var(--bac-gold-dim); border-color: var(--bac-gold);
  color: var(--bac-gold); transform: translateY(-1px);
}

/* Typing */
.bac-typing {
  display: flex; gap: 4px; align-items: center;
  padding: 12px 15px; background: #fff;
  border: 1px solid rgba(184,151,46,.15);
  border-radius: 14px; border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.bac-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bac-gold);
  animation: bacTypeDot 1.2s ease-in-out infinite;
}
.bac-typing span:nth-child(2) { animation-delay: .2s; }
.bac-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bacTypeDot { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-5px);opacity:1} }

/* Status cards */
.bac-status-card {
  padding: 12px 15px; border-radius: 12px;
  font-size: 0.82rem; line-height: 1.6; margin-top: 6px;
}
.bac-status-card.qualified  { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; }
.bac-status-card.disqualified { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }

/* WhatsApp CTA */
.bac-wa {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg,#f0fdf4,#dcfce7);
  border: 1px solid #86efac; border-radius: 12px;
  padding: 13px 16px; margin-top: 10px;
  cursor: pointer; text-decoration: none;
  transition: all .2s;
  box-shadow: 0 2px 12px rgba(37,211,102,.1);
}
.bac-wa:hover {
  background: linear-gradient(135deg,#dcfce7,#bbf7d0);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(37,211,102,.18);
}
.bac-wa-icon { width: 36px; height: 36px; flex-shrink: 0; }
.bac-wa-txt  { font-size: 0.82rem; color: #14532d; line-height: 1.5; }
.bac-wa-txt strong { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 1px; }

/* End card */
.bac-end-card {
  background: var(--bac-paper2); border: 1px solid var(--bac-gold-brd);
  border-radius: 12px; padding: 14px 16px;
  font-size: 0.82rem; color: var(--bac-muted);
  line-height: 1.6; margin-top: 6px; text-align: center;
}

/* ── INPUT AREA ── */
.bac-input-area {
  padding: 14px 16px; background: #fff;
  border-top: 1px solid rgba(184,151,46,.1);
  flex-shrink: 0;
}
.bac-input-row { display: flex; gap: 8px; align-items: flex-end; }
.bac-input {
  flex: 1; border: 1px solid var(--bac-gold-brd);
  background: var(--bac-paper); border-radius: 12px;
  padding: 10px 14px;
  font-family: 'Outfit', sans-serif; font-size: 0.855rem; color: var(--bac-ink);
  resize: none; outline: none;
  min-height: 42px; max-height: 96px;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}
.bac-input:focus { border-color: var(--bac-gold); box-shadow: 0 0 0 3px rgba(184,151,46,.1); }
.bac-input::placeholder { color: var(--bac-muted2); }
.bac-input:disabled { opacity: .5; cursor: not-allowed; }

.bac-send {
  background: linear-gradient(135deg, var(--bac-ink), var(--bac-ink3));
  border: 1px solid var(--bac-gold-brd); color: var(--bac-gold);
  width: 42px; height: 42px; border-radius: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .15s; flex-shrink: 0;
}
.bac-send:hover:not(:disabled) { opacity: .85; transform: scale(1.05); }
.bac-send:disabled { opacity: .35; cursor: not-allowed; }
.bac-send svg { width: 17px; height: 17px; }

.bac-foot {
  text-align: center; font-size: 0.63rem;
  color: var(--bac-muted2); margin-top: 8px; letter-spacing: 0.02em;
}
.bac-foot a { color: var(--bac-gold); text-decoration: none; }

/* ── MOBILE ── */
@media (max-width: 480px) {
  #bac-window {
    bottom: 0; right: 0; left: 0;
    width: 100%; max-width: 100%;
    height: 75vh; max-height: 75vh;
    border-radius: 20px 20px 0 0;
  }
}
