:root {
  --w-bg: #0A1219;
  --w-panel: #0E1A24;
  --w-card: #142534;
  --w-text: #ECE8DC;
  --w-muted: #8FA0AC;
  --w-gold: #C9A227;
  --w-teal: #4FA69C;
  --w-red: #C1502E;
  --w-z: 9000;
}

/* ---- Suporte chat ---- */
.sim-chat-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: var(--w-z);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--w-teal), #067A5B);
  color: #0A1219;
  font: 600 14px/1 system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.sim-chat-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); }
.sim-chat-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

.sim-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: calc(var(--w-z) + 1);
  width: min(380px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 100px));
  background: var(--w-panel);
  border: 1px solid rgba(79, 166, 156, 0.35);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: simSlideUp 0.22s ease;
}
.sim-chat-panel.open { display: flex; }

@keyframes simSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.sim-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(79, 166, 156, 0.12);
  border-bottom: 1px solid rgba(236, 232, 220, 0.08);
}
.sim-chat-head b { font-size: 15px; color: var(--w-text); }
.sim-chat-head span { display: block; font-size: 11px; color: var(--w-muted); margin-top: 2px; font-weight: 400; }
.sim-chat-close {
  border: 0;
  background: transparent;
  color: var(--w-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.sim-chat-close:hover { color: var(--w-text); }

.sim-chat-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
}
.sim-chat-tab {
  flex: 1;
  border: 1px solid rgba(236, 232, 220, 0.12);
  background: transparent;
  color: var(--w-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sim-chat-tab.active {
  color: var(--w-text);
  border-color: var(--w-teal);
  background: rgba(79, 166, 156, 0.12);
}

.sim-chat-body { padding: 14px 16px 16px; overflow-y: auto; }
.sim-chat-body label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--w-muted);
  margin: 0 0 6px;
}
.sim-chat-body select,
.sim-chat-body input,
.sim-chat-body textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(236, 232, 220, 0.12);
  background: var(--w-card);
  color: var(--w-text);
  font: 14px/1.4 system-ui, sans-serif;
}
.sim-chat-body textarea { min-height: 88px; resize: vertical; }
.sim-chat-body select:focus,
.sim-chat-body input:focus,
.sim-chat-body textarea:focus {
  outline: 2px solid rgba(79, 166, 156, 0.35);
  border-color: var(--w-teal);
}

.sim-chat-actions { display: flex; flex-direction: column; gap: 8px; }
.sim-chat-send {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--w-gold);
  color: #0A1219;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.sim-chat-send:disabled { opacity: 0.6; cursor: wait; }
.sim-chat-wa {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--w-teal);
  text-decoration: none;
}
.sim-chat-wa:hover { text-decoration: underline; }
.sim-chat-msg { font-size: 12px; min-height: 1.2em; margin-top: 4px; }
.sim-chat-msg.ok { color: var(--w-teal); }
.sim-chat-msg.err { color: var(--w-red); }

/* ---- Social proof (premium) ---- */
.sp-root {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: calc(var(--w-z) - 1);
  width: min(360px, calc(100vw - 110px));
  pointer-events: none;
}
.sp-root.sp-app { top: 76px; bottom: auto; }
.sp-root.sp-hidden { display: none; }

.sp-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 14px 14px;
  background: rgba(8, 12, 18, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: auto;
  overflow: hidden;
}
.sp-card.show { opacity: 1; transform: translateX(0); }

.sp-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--w-gold), #8b6914);
}
.sp-accent.sp-t-research { background: linear-gradient(180deg, #5ec4b6, #2d7a70); }
.sp-accent.sp-t-pro, .sp-accent.sp-t-purchase { background: linear-gradient(180deg, var(--w-gold), #c9a227); }
.sp-accent.sp-t-support { background: linear-gradient(180deg, #6b9fd4, #3d6a9b); }
.sp-accent.sp-t-quote, .sp-accent.sp-t-order { background: linear-gradient(180deg, #22c55e, #15803d); }
.sp-accent.sp-t-delivery { background: linear-gradient(180deg, #f59e0b, #b45309); }

.sp-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f4f0e6;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.2);
  margin-left: 4px;
}
.sp-avatar.sp-t-research { background: linear-gradient(135deg, rgba(94, 196, 182, 0.2), rgba(45, 122, 112, 0.1)); border-color: rgba(94, 196, 182, 0.25); }
.sp-avatar.sp-t-income { background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(91, 33, 182, 0.1)); border-color: rgba(139, 92, 246, 0.25); }
.sp-safra .sp-avatar { background: linear-gradient(135deg, rgba(0, 150, 57, 0.25), rgba(0, 100, 40, 0.1)); border-color: rgba(0, 150, 57, 0.3); color: #e8f5e9; }
.sp-safra .sp-card { border-color: rgba(0, 150, 57, 0.22); }
.sp-safra .sp-accent { background: linear-gradient(180deg, #009639, #ffd100); }

.sp-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--w-gold);
  margin-bottom: 4px;
}
.sp-safra .sp-label { color: #7dd87a; }

.sp-text {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--w-text);
  line-height: 1.45;
  margin: 0 0 5px;
}

.sp-meta {
  font-size: 0.7rem;
  color: var(--w-muted);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}

.sp-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--w-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
}
.sp-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }

/* Legacy classes (compat) */
.sim-proof { display: none !important; }

@media (max-width: 640px) {
  .sp-root { left: 12px; bottom: 88px; width: calc(100vw - 88px); }
  .sp-root.sp-app { top: 68px; }
  .sim-chat-btn span.lbl { display: none; }
  .sim-chat-btn { padding: 14px; border-radius: 50%; }
}
