/* ============================================================
   EpicTV — funil self-serve (teste grátis + checkout PIX + chat).
   Camada ADITIVA: só atua quando window.EPICTV_FUNNEL.apiBase está definido.
   Reusa os tokens de :root do style.css.
   ============================================================ */

.ef-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 8, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
  opacity: 0;
  transition: opacity var(--transition-base, 0.3s ease);
}
.ef-modal-overlay.ef-open { opacity: 1; }

.ef-modal {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card, #0f0f1a);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 20px);
  padding: 28px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(16px) scale(0.98);
  transition: transform var(--transition-base, 0.3s ease);
  font-family: var(--font-primary, 'Inter', sans-serif);
}
.ef-modal-overlay.ef-open .ef-modal { transform: translateY(0) scale(1); }

.ef-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #a0a0b8);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast, 0.2s ease);
}
.ef-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.ef-modal h3 {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: var(--text-primary, #f0f0f5);
}
.ef-modal p.ef-sub { color: var(--text-secondary, #a0a0b8); font-size: 0.92rem; margin: 0 0 18px; }

.ef-field { margin-bottom: 14px; }
.ef-field label { display: block; font-size: 0.82rem; color: var(--text-tertiary, #6a6a82); margin-bottom: 6px; }
.ef-field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-tertiary, #12121e);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  color: var(--text-primary, #f0f0f5);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition-fast, 0.2s ease);
}
.ef-field input:focus { outline: none; border-color: var(--accent-purple, #a855f7); }

.ef-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md, 12px);
  background: var(--gradient-primary, linear-gradient(135deg, #a855f7, #3b82f6));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition-fast, 0.2s ease), transform var(--transition-fast, 0.2s ease);
}
.ef-btn:hover { opacity: 0.92; }
.ef-btn:active { transform: translateY(1px); }
.ef-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ef-btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--text-primary, #f0f0f5);
}

/* plan picker */
.ef-plans { display: grid; gap: 10px; margin-bottom: 16px; }
.ef-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-tertiary, #12121e);
  border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  transition: border-color var(--transition-fast, 0.2s ease);
}
.ef-plan:hover { border-color: var(--border-hover, rgba(168, 85, 247, 0.3)); }
.ef-plan.ef-selected { border-color: var(--accent-purple, #a855f7); background: var(--gradient-glow, rgba(168, 85, 247, 0.12)); }
.ef-plan-label { font-weight: 600; color: var(--text-primary, #f0f0f5); }
.ef-plan-price { font-family: var(--font-display, sans-serif); color: var(--accent-purple, #a855f7); font-weight: 700; }

/* pix result */
.ef-pix { text-align: center; }
.ef-pix img { width: 220px; height: 220px; border-radius: var(--radius-md, 12px); background: #fff; padding: 8px; margin: 8px auto 14px; }
.ef-copy {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.ef-copy input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-tertiary, #12121e);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 8px);
  color: var(--text-secondary, #a0a0b8);
  font-size: 0.8rem;
  font-family: monospace;
}
.ef-copy button { padding: 0 16px; white-space: nowrap; width: auto; }

.ef-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary, #a0a0b8);
  margin-top: 10px;
}
.ef-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-top-color: var(--accent-purple, #a855f7);
  border-radius: 50%;
  animation: ef-spin 0.8s linear infinite;
}
@keyframes ef-spin { to { transform: rotate(360deg); } }

.ef-creds {
  background: var(--bg-tertiary, #12121e);
  border: 1px solid var(--accent-purple, #a855f7);
  border-radius: var(--radius-md, 12px);
  padding: 16px;
  margin: 12px 0;
  text-align: left;
}
.ef-creds div { margin: 4px 0; font-size: 0.95rem; }
.ef-creds strong { color: var(--accent-purple, #a855f7); }

.ef-msg { font-size: 0.9rem; color: var(--text-secondary, #a0a0b8); margin: 10px 0; text-align: center; }
.ef-msg.ef-err { color: #f87171; }
.ef-msg.ef-ok { color: #4ade80; }

/* ===== chat widget ===== */
.ef-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary, linear-gradient(135deg, #a855f7, #3b82f6));
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
  z-index: 9990;
  transition: transform var(--transition-fast, 0.2s ease);
}
.ef-chat-fab:hover { transform: scale(1.06); }

.ef-chat {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 130px);
  background: var(--bg-card, #0f0f1a);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 20px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9991;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.ef-chat.ef-open { display: flex; }

.ef-chat-head {
  padding: 16px;
  background: var(--gradient-primary, linear-gradient(135deg, #a855f7, #3b82f6));
  color: #fff;
  font-family: var(--font-display, sans-serif);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ef-chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ef-bubble { max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: 0.9rem; line-height: 1.4; }
.ef-bubble.ef-bot { align-self: flex-start; background: var(--bg-tertiary, #12121e); color: var(--text-primary, #f0f0f5); border-bottom-left-radius: 4px; }
.ef-bubble.ef-user { align-self: flex-end; background: var(--accent-purple, #a855f7); color: #fff; border-bottom-right-radius: 4px; }
.ef-chat-foot { padding: 12px; border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)); display: flex; gap: 8px; }
.ef-chat-foot input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-tertiary, #12121e);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  color: var(--text-primary, #f0f0f5);
  font-family: inherit;
  font-size: 0.9rem;
}
.ef-chat-foot input:focus { outline: none; border-color: var(--accent-purple, #a855f7); }
.ef-chat-foot button {
  width: 42px;
  border: none;
  border-radius: var(--radius-md, 12px);
  background: var(--gradient-primary, linear-gradient(135deg, #a855f7, #3b82f6));
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 480px) {
  .ef-chat { bottom: 84px; height: 70vh; }
}
